Windows Socket 网络编程 MFC类 CSocket

 

Switching Windows Project and Console Project

If you build up a win32 console project and want to convert to windwos application. You should change the subsystem property on link/subsystem from /console to /system. And then choose to change macro _CONSOLE to _WINDOWS. And then choose to change its entry function.

For console application:

int main(int argc, char * argv[])
int main()
int _tmain(int argc, TCHAR * argv[])
int _tmain()
int wmain(int argc, wchar_t * argv[])
int wmain()
 
For windows application:
int WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nShowCmd
)

if you using wrong entry signature, you will get compile error about:

error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

 

CSocket inherited from CAsyncSocket

Low Leve: CAsyncSocket

High Level: CSocket

1. Construct CSocket

2.

archive programming

你可能感兴趣的:(Windows Socket)