|
bsaksida wrote: Did you tried example?
Nope, dont have time to do that today
Do the columns appear on the screen?
System.IO.Path.IsPathRooted() does not behave as I would expect
|
|
|
|
|
Yes everything was ok, except i cant get Index key for specific column.
|
|
|
|
|
Found a workaround this problem:
MessageBox::Show(listView1->Columns[1]->Text);
If i used it in the for loop, i coud get index ot the columns
|
|
|
|
|
Guys,
I'm trying a little test app in C++. I added a button and an event handler for this button.
I'm creating a test app that has to call some dll functions in late binding. Although I have done this before I tried to do a simple AfxMessageBox just to get the hang of it again. And it fails (yes this line: AfxMessageBox("Test"); fails. Even CString test = "My test here."; fails.)
so what did I forget? (I made a MFC app via the wizard, it gave me an error when adding the control variable for the button, but the rest it did just fine). MSDN says I have to do it like this. (and my memory, pray to God it didn't fail me, says so too;P)
the error message I get is :
Error 1 error C2440: 'initializing' : cannot convert from 'const char [9]' to 'ATL::CSimpleStringT<BaseType>' d:\projects\projects c++\loaddlltest\loaddlltest\loaddlltestdlg.cpp 92
tnx...
[MODIFIED]It doesn't work in 2005, it does work in 6.0 ...[/MODIFIED]
V.
If I don't see you in this world, I'll see you in the next one... And don't be late. (Jimi Hendrix)
|
|
|
|
|
AfxMessageBox(_T("Test"));
CString test = _T("My test here.");
led mike
|
|
|
|
|
works idd, I'll have to look up why some day .
tnx
|
|
|
|
|
I think it is just because the default project settings in VS2005 is UNICODE.
led mike
|
|
|
|
|
BOOL WriteFile(
HANDLE hFile, // handle to file to write to
LPCVOID lpBuffer, // pointer to data to write to file
DWORD nNumberOfBytesToWrite, // number of bytes to write
LPDWORD lpNumberOfBytesWritten, // pointer to number of bytes written
LPOVERLAPPED lpOverlapped // pointer to structure for overlapped I/O
);
When using this function and it's return false (failed) can i rely on lpNumberOfBytesWritten value?
(no answer in MSDN)
|
|
|
|
|
g_sasha wrote: (no answer in MSDN)
Really? In the documentation [^]it says:
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
led mike
|
|
|
|
|
I asking something else, Can i rely on LPDWORD lpNumberOfBytesWritten,
parameter in case of failure
|
|
|
|
|
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
|
|
|
|