标签:
#using <mscorlib.dll>
using namespace System;
using namespace System::Runtime::InteropServices;
#using "D:\ExerciseSample\AccessSample\Release\accessUpdate.dll"/* 需要调取的DLL */
using namespace accessUpdate;/* 使用命名空间 */
int _tmain(int argc, _TCHAR* argv[])
{
char*p = "C:\\Windows\\system\\NetLock.mdb" ;
long a = 5030201;
char room[32] = "8302" ;
Class1 ^myclass= gcnew Class1();
System::String ^aa = myclass->accessUpdate(Marshal::PtrToStringAnsi((IntPtr)( char*)p), a, Marshal::PtrToStringAnsi((IntPtr)(char *)room), true);
printf_s( "aa = %s\n",aa);
system( "pause");
return 0;
}
VC++调用C#动态链接库DLL
标签:
原文地址:http://www.cnblogs.com/deathmr/p/5777530.html