data conversion
-
How can I convert a String* data to char*? Is it possible to do Type convertion between managed type and unmanaged type. Is there any article which gives an explanation on this type conversion? Please help. vini
-
Hello,
char* str= (char*)Marshal::StringToHGlobalAnsi("Hello World");
With Regards, R.Selvam -
Thanks. But now I get an error " error C2440: 'type cast' : cannot convert from 'System::IntPtr' to 'char *' ". Pls help. vini
Hello, look this, http://www.codeproject.com/dotnet/managed_unmanaged.asp With Regards, R.Selvam
-
Hello, look this, http://www.codeproject.com/dotnet/managed_unmanaged.asp With Regards, R.Selvam
R.selvam wrote: _Hello, look this, http://www.codeproject.com/dotnet/managed\_unmanaged.asp_ Thanks very much. But now I get another error when I include the namespace System::Runtime::InteropServices. error C2872: 'FILETIME' : ambiguous symbol could be 'D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinDef.h(354) : _FILETIME FILETIME' or 'stdafx.cpp(0) : System::Runtime::InteropServices::FILETIME'. Kindly help. Vini
-
Hello, look this, http://www.codeproject.com/dotnet/managed_unmanaged.asp With Regards, R.Selvam
Now its fine. I changed my function call to IntPtr ip=System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi("hello World"), instead of including the namespace in the using namespace stmt and then calling the function as IntPtr ip=Marshal::StringToHGlobalAnsi("Hello World"). Thanks for the help Vini
-
Now its fine. I changed my function call to IntPtr ip=System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi("hello World"), instead of including the namespace in the using namespace stmt and then calling the function as IntPtr ip=Marshal::StringToHGlobalAnsi("Hello World"). Thanks for the help Vini
-
Now its fine. I changed my function call to IntPtr ip=System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi("hello World"), instead of including the namespace in the using namespace stmt and then calling the function as IntPtr ip=Marshal::StringToHGlobalAnsi("Hello World"). Thanks for the help Vini