System::Windows::Forms Namespace ??
-
Hi all, I am writing a console app which will in turn run a windows application then simulate sending keyboard command to the application. I have been able to run the app and get it's handle and all that - every thing here is fine. To issue keyboard command I will have to use the SendKeys::SendWait("%F"); The '%F' simulates the Alt-F to access the menu. Seeing that SendKeys is a member of the System::Windows::Form namespace I have to include this in my code, which I have done like this:
#using "System.Windows.Forms.dll" using namespace System::Windows::Forms;
When I then compile the code, I get the following errors: : error C3083: 'Windows': the symbol to the left of a '::' must be a type : error C2039: 'Forms' : is not a member of 'System' : error C2871: 'Forms' : a namespace with this name does not exist : error C3083: 'Windows': the symbol to the left of a '::' must be a type : error C3083: 'Forms': the symbol to the left of a '::' must be a type : error C3083: 'SendKeys': the symbol to the left of a '::' must be a type : error C2039: 'SendWait' : is not a member of 'System' : error C3861: 'SendWait': identifier not found So, what have I done wrong and how is this rectified ?? Pete PS: Writing with VC++ 2005 -
Hi all, I am writing a console app which will in turn run a windows application then simulate sending keyboard command to the application. I have been able to run the app and get it's handle and all that - every thing here is fine. To issue keyboard command I will have to use the SendKeys::SendWait("%F"); The '%F' simulates the Alt-F to access the menu. Seeing that SendKeys is a member of the System::Windows::Form namespace I have to include this in my code, which I have done like this:
#using "System.Windows.Forms.dll" using namespace System::Windows::Forms;
When I then compile the code, I get the following errors: : error C3083: 'Windows': the symbol to the left of a '::' must be a type : error C2039: 'Forms' : is not a member of 'System' : error C2871: 'Forms' : a namespace with this name does not exist : error C3083: 'Windows': the symbol to the left of a '::' must be a type : error C3083: 'Forms': the symbol to the left of a '::' must be a type : error C3083: 'SendKeys': the symbol to the left of a '::' must be a type : error C2039: 'SendWait' : is not a member of 'System' : error C3861: 'SendWait': identifier not found So, what have I done wrong and how is this rectified ?? Pete PS: Writing with VC++ 2005you don't need to use #using "System.Windows.Forms.dll" yust by adding namespace, you aotomaticly add references
Fritzables wrote:
SendKeys::SendWait("%F"); The '%F' simulates the Alt-F to access the menu.
Dou you men like this: menu1->Text = "&File"; // ALT-F menu2->Text = "&Edit"; // ALT-E menu3->Text = "E&xit"; // ALT-X
-
you don't need to use #using "System.Windows.Forms.dll" yust by adding namespace, you aotomaticly add references
Fritzables wrote:
SendKeys::SendWait("%F"); The '%F' simulates the Alt-F to access the menu.
Dou you men like this: menu1->Text = "&File"; // ALT-F menu2->Text = "&Edit"; // ALT-E menu3->Text = "E&xit"; // ALT-X
Ok..... I have now taken out the line:
#using "System.Windows.Forms.dll"
And now just using:using namespace System::Windows::Forms;
But still when compiling I get the following errors:: error C3083: 'Windows': the symbol to the left of a '::' must be a type : error C2039: 'Forms' : is not a member of 'System' : error C2871: 'Forms' : a namespace with this name does not exist
Pete -
Hi all, I am writing a console app which will in turn run a windows application then simulate sending keyboard command to the application. I have been able to run the app and get it's handle and all that - every thing here is fine. To issue keyboard command I will have to use the SendKeys::SendWait("%F"); The '%F' simulates the Alt-F to access the menu. Seeing that SendKeys is a member of the System::Windows::Form namespace I have to include this in my code, which I have done like this:
#using "System.Windows.Forms.dll" using namespace System::Windows::Forms;
When I then compile the code, I get the following errors: : error C3083: 'Windows': the symbol to the left of a '::' must be a type : error C2039: 'Forms' : is not a member of 'System' : error C2871: 'Forms' : a namespace with this name does not exist : error C3083: 'Windows': the symbol to the left of a '::' must be a type : error C3083: 'Forms': the symbol to the left of a '::' must be a type : error C3083: 'SendKeys': the symbol to the left of a '::' must be a type : error C2039: 'SendWait' : is not a member of 'System' : error C3861: 'SendWait': identifier not found So, what have I done wrong and how is this rectified ?? Pete PS: Writing with VC++ 2005 -
Have you added a reference to the "System.Windows.Forms.dll" ? If not, reference this dll in your project and then try compiling the code. Hope this might help you. Girish K
G'Day Girish, Yea, I had that in my original code:
#using <System.Windows.Forms.dll>
and also had:using namespace System::Windows::Forms;
But I was told to take the top line out as the namespace will reference the DLL. But when I compile either way I still get that same error code. Pete -
G'Day Girish, Yea, I had that in my original code:
#using <System.Windows.Forms.dll>
and also had:using namespace System::Windows::Forms;
But I was told to take the top line out as the namespace will reference the DLL. But when I compile either way I still get that same error code. Petego to menu: Project->(Your Project Name) Properties->Common Properties On the right you will see references And you can click Add Reference. Other oproblem coud be: Under General, look if you have Common Language Runtime Support. As long as you have with /clr Third possible. You can have problem with a code. If so then try to add a comment to all includes. If you have a problem with client, yust to be same make an test project. But this namespace would automaticly be in use
-
G'Day Girish, Yea, I had that in my original code:
#using <System.Windows.Forms.dll>
and also had:using namespace System::Windows::Forms;
But I was told to take the top line out as the namespace will reference the DLL. But when I compile either way I still get that same error code. PeteHi Pete, I am not sure whether you got my query correctly. Try this , Right click on the Project and Choose References. Then Add reference to "System.Windows.Forms.dll". Try to compile your code after you have added this line using namespace System::Windows::Forms; Compile and check if it works. If this does not work, then please post your code snippet.. Thanks & Regards, Girish K
-
Hi Pete, I am not sure whether you got my query correctly. Try this , Right click on the Project and Choose References. Then Add reference to "System.Windows.Forms.dll". Try to compile your code after you have added this line using namespace System::Windows::Forms; Compile and check if it works. If this does not work, then please post your code snippet.. Thanks & Regards, Girish K
G'Day Girish, Yep ya right.... thought you meant
#using
You know us Aussies.... a bit slow :-D Thanks for the tip off and will try again in the morn when I get back to work. Take care mate and have a good one. Pete -
go to menu: Project->(Your Project Name) Properties->Common Properties On the right you will see references And you can click Add Reference. Other oproblem coud be: Under General, look if you have Common Language Runtime Support. As long as you have with /clr Third possible. You can have problem with a code. If so then try to add a comment to all includes. If you have a problem with client, yust to be same make an test project. But this namespace would automaticly be in use
G'Day bsaksida, Have a look at my reply to Girish...... Thanks for the hand on this. Pete
-
Hi Pete, I am not sure whether you got my query correctly. Try this , Right click on the Project and Choose References. Then Add reference to "System.Windows.Forms.dll". Try to compile your code after you have added this line using namespace System::Windows::Forms; Compile and check if it works. If this does not work, then please post your code snippet.. Thanks & Regards, Girish K
Hey Girish, I have just tried your suggestion - and I am back up and running. Thanks again and have a great Xmas. Pete
-
Hey Girish, I have just tried your suggestion - and I am back up and running. Thanks again and have a great Xmas. Pete