可以任何正文告诉如何在托管c ++中将System :: IntPtr转换为char*这是我的主要功能
int main(void)
{
String* strMessage = "Hello world";
CManagedClass* pCManagedClass = new CManagedClass();//working
pCManagedClass->ShowMessage(strMessage);//working
****above said error here***
char* szMessage = (char*)Marshal::StringToHGlobalAnsi(strMessage);
CUnmanagedClass cUnmanagedClass; cUnmanagedClass.ShowMessageBox(szMessage);
Marshal::FreeHGlobal((int)szMessage);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
提前致谢
我创建了一个C#控制台应用程序,其中包含命名空间System和System.Data
另外,我补充说Microsoft.SqlServer.Smo.
当我尝试从命令提示符编译时,它显示错误为:
SqlSmoDiscovery.cs(3,27):错误CS0234:命名空间"Microsoft.SqlServer"中不存在类型或命名空间名称"Management"(您是否缺少程序集引用?)SqlSmoDiscovery.cs(4,27):error CS0234:名称空间"Microsoft.SqlServer"中不存在类型或命名空间名称"管理"(您是否缺少程序集引用?)
但它是从Visual Studio编译的.
我正在从命令提示符编译输出为纯C#dll.
我的项目:
然后我导航到G:\ SqlDisc:> csc/target:library/r Micrsoft.SqlServer.Smo.Dll
SqlSmoDiscovery.cs,但它显示erroe为
错误CS0006:找不到元数据文件"Microsoft.SqlServer.Smo.dll"
我想在Windows XP上用PHP做一个示例程序.
我是否需要任何特殊软件才能使其正常工作?
我担心我只需打开记事本键入PHP程序并使用php扩展名保存.然后我用浏览器打开它作为HTML文件.但它不起作用.
请帮忙
提前致谢
我在VS2003中构建了一个解决方案.现在我想迁移到VS2003.我知道当我在VS2005中打开VS2003解决方案时,IDE会将解决方案转换为VS2005.
但是当我在转换向导中单击convert时,我收到以下错误窗口:
e:\Test.vcproj can not be opened because it's project type(vc.proj) is not supported by the version of the application.to open this use a version that support this
我该如何解决这个问题?
任何帮助都非常感谢.