|
ops, sorry for the mistake. The reason I need the converion is because I am merging code from different VC projects and versions. Some code use std::string variables and the other system::String ^
Thanks. I will post it in the correct place
|
|
|
|
|
If only it were that simple...
Here's my attempt at code that gets the raw wide characters from a CLR String into a std::wstring - I'll leave the conversion to ASCII to you - there are plenty of examples of how to do that part of it...
String^ ss = "hello";
std::wstring s;
array<wchar_t>^ chars = ss->ToCharArray();
pin_ptr<wchar_t> charPtr = &chars[0];
s = std::wstring(charPtr, charPtr+ss->Length);
Microsoft's suggested solution is here[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Hi all!
i have injected the kernel32.dll for the "CreateFileW" and i have customized the funcation.
i wana log only the files created by the user not by the system exe and dll and processes.
i have filtered by using "dwCreationDisposition" and dwFlagsAndAttributes
even though i cant filter some of the files created temperarily and some exe files.
has anybody known any filtering techniques in the kernel.
i welcome if someone leads me for a good technique
Thanks all!
Regards
Jack
|
|
|
|
|
I added a static variable in a file "shared.h"
static bool bDone;
and inclued in "shared.h" in two file "abc.cpp" and "xyz.cpp"
because I want to set the value in "abc.cpp" and use it in "xyz.cpp".
But when I do this I get the below linker error
error LNK2001: unresolved external symbol "public: static bool bDone, before addition of this variable every thing compiles fine
Please advice
|
|
|
|
|
By declaring it static , you've restricted the scope of that variable to the file where it is declared. You might want to look into the keyword extern (declare the variable globally without the static keyword and declare it as extern where you are trying to use it)
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
so in my case I should do as below
Shared.h
bool bDone;
abc.h
#include "Shared.h"
extern bDone;
xyz.h
#include "Shared.h"
extern bDone;
If I am not worng
|
|
|
|
|
Are you going to wait until I say "yes, go ahead"? Why not try it in the IDE and ask queries if it didn't work?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Now I get the below error
error LNK2005: "bool m_Cursor" (?m
.exe : fatal error LNK1169: one or more multiply defined symbols found
|
|
|
|
|
<a href="http://msdn.microsoft.com/en-us/library/dabb5z75(VS.80).aspx" target="_blank" title="New Window">__declspec</a>(<a href="http://msdn.microsoft.com/en-us/library/5tkz6s71(VS.80).aspx" target="_blank" title="New Window">selectany</a>) bool bVar;
#include "MyHeader.h"
extern bool bVar = 0;
#include "MyHeader.h"
extern bool bVar = 1;
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
No luck
now I got
.obj : error LNK2001: unresolved external symbol "bool m_BusyCursor"
|
|
|
|
|
do it all extern (declaration), AND "bool bDone = false;" in the Shared.cpp (instanciation)
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Now I get the below error
error LNK2005: "bool m_Cursor" (?m
.exe : fatal error LNK1169: one or more multiply defined symbols found
|
|
|
|
|
I dont believe that you have done what i wrote.
Make only 1 instance of your bool !!!!
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
hello Friends
I want to save zip file.is any function that displays a dialog that asks user where to save in?Thanks In Advance.
Regards
Yogesh
|
|
|
|
|
CFileDialog: Lets user select a filename to open or save
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
I m not using MFC .Please suggest me if any in c++ or win32?
Regards
Yogesh
|
|
|
|
|
See GetSaveFileName .
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
GetSaveFileName() will do the job
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi,
Please let me know is there any API to Get the Drive in which im inserting the Disk..
|
|
|
|
|
See GetLogicalDrives .
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
But how will i know in which drive my disk is inserted
|
|
|
|
|
Hi
Get GetLogicalDrives.
and use the folloing function to find out the drive type
UINT uDriveType = GetDriveType(sDriveLabel)
0 - Unknown drive
1 - Invalid Path
2 - Removable Drive
..etc
Regards
.....Jack
|
|
|
|
|
Handle WM_DEVICECHANGE message
|
|
|
|
|
If possible can u suggest me any sample regarding the same...
|
|
|
|