|
g_sasha wrote: in case of failure
don't you think that might depend on what the error from GetLastError is? Why have you not posted the Error information?
led mike
|
|
|
|
|
There is no error (yet), i dont think it's depend on GetLastError, i think it's should be just yes/no answer.
Can you think of example where it may be depend on error ?
|
|
|
|
|
Probably a bad idea. And you're asking in the wrong forum
System.IO.Path.IsPathRooted() does not behave as I would expect
|
|
|
|
|
|
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:
<br />
#using "System.Windows.Forms.dll"<br />
using namespace System::Windows::Forms;<br />
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
|
|
|
|
|
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:
<br />
#using "System.Windows.Forms.dll"<br />
And now just using:
<br />
using namespace System::Windows::Forms;<br />
But still when compiling I get the following errors:
<br />
: error C3083: 'Windows': the symbol to the left of a '::' must be a type<br />
: error C2039: 'Forms' : is not a member of 'System'<br />
: error C2871: 'Forms' : a namespace with this name does not exist<br />
Pete
|
|
|
|
|
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:
<br />
#using <System.Windows.Forms.dll><br />
and also had:
<br />
using namespace System::Windows::Forms;<br />
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
|
|
|
|
|
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
|
|
|
|
|
G'Day Girish,
Yep ya right.... thought you meant #using
You know us Aussies.... a bit slow
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
|
|
|
|
|
Hey Girish,
I have just tried your suggestion - and I am back up and running.
Thanks again and have a great Xmas.
Pete
|
|
|
|
|
Great !!!
You too have a great X'Mas ...
Regards,
Girish
|
|
|
|
|
Hi,
I am using the copiled HTML help for my project. Earlier it was Winhelp. I am calling the HtmlHelp API as below from my code:
HtmlHelp (m_hWnd, "POM.chm", HH_HELP_CONTEXT, lHelpID);
here lHelpID is the mapid of my text/edit box for which i want to open help.
The problem here is when I use F1 key to open help for two diffrent text box (say FirstName and latname text boxes) it open the help for one and not for other textbox. But in help file the help tags for both textboxes are set up and directed to same topic.
Can anyone please help if they have encountered similar problem?
|
|
|
|
|
Hi all,
I wrote an application in VS2K5 using CLI, and when I copy the application to another computer and try to run it i get the folloing error:
(Please note the computer has .Net Framework on it)
Error Msg:
"The application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem"
Can any one help ???
The only programmers that are better than C programmers are those who code in 1's and 0's.....
 Programm3r
|
|
|
|
|
Hi,
I am new to c++ and I will use it in my thesis on image processing.
I wrote a piece of code to read a ppm image file. in order to read the magic number (the number indicating the type of the image file whether it is ppm, bmp, jpeg or etc. this magic number is in the header section of the image) i create a char pointer magicNumber:
char *magicNumber;<br />
magicNumber = new char[2];
and pass it into the function PPMreadHeader. My intent is to fill the pointer inside the function and write the magicnumber in the console outside the function.
i have an array in the PPMreadHeader fuinction in order to read the file line by line. I have a local char pointer "word":
<br />
char line[255];<br />
char * word;
when i read the magicnumber (it is "P6" for ppm files) i assign it to the local pointer word:
word=line;
if i try to write the magic number in the function using the local pointer:
cout<<word<<endl;
there is no problem, it writes p6 to the console. however, if i first copy the word into the magicnumber pointer that i create in the main function:
*magicNumber=*word;<br />
*(magicNumber+1)=*(word+1);
and then try to print out the pointer to the consolelike below:
cout<<"magicNumber: "<<magicNumber<<endl;
then it writes:
magicNumber:P6ııııİİ
which not i want. it writes the p6 which is what i want to write to the console, but it writes more than p6. within the function when i write the local pointer "word" it just writes the P6, nothing more. Could you please help me on this.
You may advise other alternatives to write the magic number on to the console but even you do this, i still want to learn what is wrong with my coding. i spent a lot of time on this and i could not fix it.
Thank you in advance.
|
|
|
|
|
Did you read this post: The C++ / CLI is for managed and mixed-mode C++ programming only
you can find it on the top of first page of (Managed) C++/CLI.
This question shoud be in Visual C++ / MFC
|
|
|
|
|
I am using vs05
Thread ^thd = gcnew Thread(gcnew ThreadStart(CountTime));
error:
Error 1 error C3867: 'test::mainForm::CountTime': function call missing argument list; use '&test::mainForm::CountTime' to create a pointer to member c:\projects\test\mainForm.h 445
Error 2 error C3350: 'System::Threading::ThreadStart' : a delegate constructor expects 2 argument(s) c:\projects\test\mainForm.h 445
I can't find any correct info in help.
ps: I already checked Codeproject, but all articles are about VB.NET and C#
|
|
|
|
|
|
thanks it worked. One of my tries was exactly same expect it had CountTime(), but it shoud CountTime without ()
|
|
|
|
|
Read the error message, it's telling you what's wrong
use '&test::mainForm::CountTime' to create a pointer to member
|
|
|
|
|
I'm playing with this for first time. Anyhoot.. in the output its telling me that the leak occured in crtdbg.h instead of Test.h. Is this normal behavior?
<br />
#define _CRTDBG_MAP_ALLOC<br />
#include <stdlib.h><br />
#include <crtdbg.h><br />
<br />
#include "Test.h"
<br />
int main()<br />
{<br />
_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );<br />
_CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT );<br />
_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE );<br />
_CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT );<br />
_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE );<br />
_CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT );<br />
<br />
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );<br />
<br />
<br />
<br />
<br />
<br />
_ASSERT(false);
<br />
int * leakyInt = new int;
<br />
Test test;
<br />
return 0;<br />
}<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
|
|
|
|
|
This is the C++/CLI forum. You should post your question in the MFC/Visual C++ forum to receiver your request answer.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|