幸福视觉海外婚纱摄影:vb.net如何引用C++写DLL文件?及函数的调用方法?

来源:百度文库 编辑:神马品牌网 时间:2024/05/11 19:44:27
C++函数如下:
bool winapi connectplayserver
(
char* address,
DWORD Port,
DWORD DataPart,
char* Username
);

试试这个:
<DllImport(\"Data.dll\")> Private Shared Function ConnectPlayServer(ByVal Address As String, ByVal Port As Integer, ByVal DataPort As Integer, ByVal Username As String) As Boolean

End Function
Private Declare Auto Function a Lib \"Lib.dll\" (ByVal i As Integer) As String

不可以,没有CLR头的DLL在.net中不能引用。