在.c中加入如下代码即可:
#pragma comment(linker,"/subsystem:windows")
#pragma comment(linker, "/ENTRY:mainCRTStartup")
subsystem有windows和console两种,选console的话在os呼叫程序的时候会先开一个console的window。
entry有mainCRTStartup和WinMain两种,选前者os调用的是传统的main函数,后者则调用WinMain函数。
另外,win32的console其实是很强大的,可以使用mfc类,可以创建进程、线程,可以进行socket通信,可以发进程、线程间消息,除了gui相关不能用以外和window应用没有什么区别。
阅读全文>发表于 @ 2008年05月22日 17:24:00|评论(loading...)|编辑
<p>// win32pro.cpp : Defines the entry point for the application.<br />// </p><p>#include "stdafx.h"<br />#include "resource.h"</p><p>#define MAX_LOADSTRING 100</p><p>// Global Variables:<br />HINSTANCE hInst; // current instance<br />TCHAR szTitle[MAX_LOADSTRING]; // The title bar text<br />TCHAR szWindowClass[MAX_LOADSTRING];// 注册类名</p><p>// Foward declarations of functions included 阅读全文>
发表于 @ 2008年05月22日 14:07:00|评论(loading...)|编辑