Roger Luo

超越梦想一起飞
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Windows Socket 网络编程 MFC类 CSocket

Posted on 2013-02-28 15:34  Roger Luo  阅读(605)  评论(0编辑  收藏  举报
 

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