Add reference of wlanapi.dll in windows 8 - wlanapi

I want to measure signal strength of Wifi by using wlanapi function.My code is giving me error on using NativeWifi statement. How do i add reference to wlanapi.dll in windows 8?

You will have to download the dll from codeplex. Just search for nativewifi codeex. Then add reference to this dll using visual studio (right click -> Add reference)

Related

VS 2013 Ultimate: Add new Elements, Windows Form missing

When creating a new project I can select a new Windows Forms Project. It will open me a new project with a new windows form. When right clicking my opened project and going for add => Windows Form it will only open the "new element" mask, where Windows Forms, WPF and other templates are missing.
I already tried Visual Studio C# Can't make new windows form project devenv /installvstemplates, but it didn't work out telling me the templates were missing.
The following files were passed with the commandline:
\installvtemplates
These files were not found and could not be load.
What do I have to do, to get my WinForm templates back and where can I configure those? I can not just reinstall Visual Studio 2013 Ultimate, because I do not have an installation medium nor they key (Like nobody in my company can tell where to find it).
In the screenshot below you can see the mask, where I used to have a lot more templates. In this case we only have Inherited Forms and Inherited User Control as avaliable templates.
This is what I get when I go for new project, Windows Forms is avaliable here.
( Win Forms Objects not avaliable )
The template files are avaliable at C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplates\VisualBasic so I am pretty sure it has to be an option somewhere in the settings. Any ideas?
After a few hours of trying I found a solution myself. It might not be the official way, but it seems to be working. I did the following steps:
Go to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplates\VisualBasic and check if the templates are avaliable
If they are avaliable copy the directory Windows Forms
Paste the copied directory to C:\Users\%USERNAME%\Documents\Visual Studio 2013\Templates\ItemTemplates\Visual Basic
Start Visual Studio
Go into a project and try to add a new element. This step will take a while loading. I think visual studio now detects the new templates in your documents folder and refreshes all templates.
When it has finished loading you will see almost all templates twice. That's good news!
Close Visual Studio and delete the directory in C:\Users\%USERNAME%\Documents\Visual Studio 2013\Templates\ItemTemplates\Visual Basic\ we just pasted.
Restart Visual Studio
Profit
Tested on Windows 10 / Visual Studio 2013 Ultimate

Unable to use Visual Studio project on different computer

I was working on a project (winforms, C++/Cli) on my desktop. When I copy project files to use it in my laptop, designer do not open. References to the 3rd party library[MetroFramework] is properly linked (project compile & run fine, no build error) but if I open designer I receive the following error
C++ CodeDom parser error: Line:99,Column:27 --unknown type".please
make sure that the assembly that contains this type is referenced. if
this is a part of your development project, make sure that the project
has been successfully built"
code at line 99:
this->metroTabControl1 = (gcnew MetroFramework::Controls::MetroTabControl());
Note: In designer, if I click on ignore & Continue, I get plain win form. Here if I drag & drop MetroFramework's UI control (metroTabControl) it display's fine. but if i close & reopen designer again i see the same error!!
Tried few suggestions from here & here, none of them worked!
Remove all toolbox items and references. Provide full path in vcproj. Remove and then connect the respective DLL required.

Windows Forms Control Library template

we are trying to use an activex control from WPF to save a rewrite right now. Found this article , https://msdn.microsoft.com/en-us/library/ms742735(v=vs.100).aspx that refers to the Windows Forms Control Library Template. now I have Visual Studio 2015 Community Edition and there is no such template. Googled and just found pages with no usable content. was wondering if I could be pointed to where this exist or is there an alternative?
The Windows Forms Control Library Template is a litte bit difficult to find. In my Visual Studio 2015 implementation I have it in the directory Visual C#\Windows\Classic Desktop. If you don't have this template, at least for Windows Forms you can also choose template Class Library and later change it in in such a way that you can use the Testcontainer when debugging your class library.
For how to achieve this see the post of Arnshea (6 upvotes) in this link A project with output type of class library cannot be started directly - with a startup exe. I have used his technique when I accidently used the wrong template when starting my projects.
Regards JRB

error LNK2019 :unresolved external symbol_main referenced in function tmainCRTsetup [duplicate]

I just installed Visual Studio 2012 express for Desktop. I can't see any place to create a GUI application with C++ ! Where is this "Windows Form Application" used to exists in Visual C++ 2010 ? Where are these drag and drop controls? I installed this because I got details telling this supports GUI intellisense (Visual C++: Unable to invoke method from another class)
It is an unsubtle hint that they want you to stop creating C++/CLI Winforms applications. The plumbing is still in place however, at least for VS2012 and VS2013. This might not be the case in a future one.
You can turn a CLR console application into a Winforms application with these steps:
Start with File + New + Project, CLR node, CLR Console Application
Project + Add New Item, UI node, Windows Form
Project + Properties, Linker, System, SubSystem = Windows
Project + Properties, Linker, Advanced, Entry Point = main
Change the pre-generated .cpp file to look like this:
#include "stdafx.h"
#include "MyForm.h"
namespace ConsoleApplication45 { // Change this!!
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
int main(array<System::String ^> ^args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Application::Run(gcnew MyForm());
return 0;
}
}
Note that you'll need to change the namespace name to your project name. Press F5 to test. You can design the form as normal once everything checks out.
NOTE, Visual Studio 2015 has a nasty static initialization order bug in the CRT that can cause the app to crash instantly with an AVE at startup if the project contains any native C++ code. As yet an unfixed bug, the somewhat inevitable hazard of having these project templates removed. A possible workaround is to change the Entry Point (4th bullet).
For a project that targets x86, copy paste this string:
?mainCRTStartupStrArray##$$FYMHP$01AP$AAVString#System###Z
For a project that targets x64, copy paste:
?mainCRTStartupStrArray##$$FYMHP$01EAPE$AAVString#System###Z
Somewhere around VS2017 the designer fails to open a new form with a cryptic error message. Workaround is to build the project first, use Build > Build.
Remove the #include "stdafx.h" and this works well for VS 2022. The form must be hand coded since the Form Designer support was removed starting with VS 2012.

Where is the System.Windows.Forms.Integration namespace?

I can't seem to find it, trying to keyboard input in a wpf form spawned from a winforms form. Found this: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/442782b1-00a1-4e2e-9cc6-ae99b6699126/ But when I try to use it, VS2008 complains about not being able to find the System.Windows.Forms.Integration namespace. I couldn't find a reference in the add references.
The only thing I can think of it maybe because it was a VS2005 project ported to VS2008?
You'll need to add a reference to WindowsFormsIntegration. If you do a Add Reference in Visual Studio, it will be near the last DLL available in the .Net tab
On my machine it's located at
%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.0\WindowsFormsIntegration.dll
Visual Studio filters the available namespaces according to the type of project you chose. If you need a namespace that is not listed, click the [Add...] button on the references tab of your project's properties. This will pop-up the Reference Manager window. Choose "Framework" from the list of Assemblies in the left-hand panel. This will display all the Microsoft provided namespaces. You will find WindowsFormsIntegration there.
Just came across the same problem.
While adding a reference to WindowsFormsIntegration.dll didn't work as this has no WF controls in it, I did find that adding a reference to System.Windows.Forms worked perfectly fine.
Use newer:
%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\WindowsFormsIntegration.dll

Resources