Casting problem (String* to LPCVOID)
-
Hello... I have a function called:
MyFunction(LPCVOID lpBuffer)
{
//... do something...
}But my parameter is a String*, for example:
String* s = "Hello World";
Are there any possibilities to cast String* to LPCVOID ?
i'd like to know one thing though : where is defined the type LPCVOID ? isn't it an MFC type ?
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
-
Hello... I have a function called:
MyFunction(LPCVOID lpBuffer)
{
//... do something...
}But my parameter is a String*, for example:
String* s = "Hello World";
Are there any possibilities to cast String* to LPCVOID ?
-
Hello... I have a function called:
MyFunction(LPCVOID lpBuffer)
{
//... do something...
}But my parameter is a String*, for example:
String* s = "Hello World";
Are there any possibilities to cast String* to LPCVOID ?
You can't do a plain cast from a managed pointer to an unmanged one, you need to pin the managed pointer so the underlying object doesn't move during GCs.
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ