c / c++ /vc µÄһЩС֪ʶ
´ò¿ªÎļþ»òÕß³ÌÐò
1¡¢ShellExecute(0,"open","c:\\abc.exe","","",SW_SHOW);
2¡¢WinExec("c:\\a.exe",SW_SHOW);
3¡¢system("dir c:\\");
¹Ø±ÕÎļþ
m_hwnd = FindWindows("Notepad","a.txt-¼Çʱ¾");
SendMessage(m_hwnd,WM_SYSCOMMAND,SC_CLOSE,0);
Òþ²ØDOS´°¿Ú
#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )
¹âÇý¿ª¹Ø
#include <windows.h>
#include <mmsystem.h>
mciSendString("set cdaudio door open",NULL,0,0);
mciSendString("set cdaudio door closed",NULL,0,0);
Õâ¸ö¶«¶«ÊÇÎÒÓÃÀ´ÏÅ»£Í¬Êµģ¬(*^__^*) ÎûÎû……
ÔÚÒ»¸öÆáºÚµÄÍíÉÏ£¬ÉìÊÖ²»¼ûÎåÖ¸£¬ÎÒµÄÒ»¸öͬÊÂÔڼӰ࣬……£¬Í»È»ÎҵĵçÄÔ²¥·ÅÁË¿Ö²ÀÉúÉùÒô¡¢¹âÇýÒ»³öÒ»½øµÄ£¨ÊÂÏÈ×¼±¸ºÃ£©……
½á¹ûÎÒµÄͬÊÂÒ»¼¤¶¯……°ÑÎÒµçÄԵĵçÔ´¸ø°ÎÁË£¡
·¾¶»ñÈ¡
char path[200];
GetCurrentDirectory(200,path);//»ñÈ¡µ±Ç°Â·¾¶ ²»°üº¬±¾³ÌÐò
GetModuleFileName(NULL,path,200);//»ñÈ¡µ±Ç°Â·¾¶ °üº¬±¾³ÌÐò
SHGetSpecialFolderPath(NULL,path,CSIDL_STARTUP,TRUE);//»ñÈ¡¿ªÊ¼Æô¶¯Â·¾¶
GetSystemDirectory(path,200);//»ñȡϵͳ·¾¶
char ºÍ CString ת»¯
char lp[256]; CString temp;
1¡¢
strcpy(lp,(LPCTSTR)temp);
lp = (LPTSTR)(LPCTSTR)temp;
2¡¢
temp = CString(lp);
temp.Format("%s",lp);
char µ½ LPCTSTR
char ch[256];
_bstr_t a;
a=ch; //a¼´ÎªLPCTSTR
TCHAR µ½ char
TCHAR exe[200];
char path[200];
setlocale(LG_ALL,"chs");
wcstombs(path,exe,200);
Ïà¹ØÎĵµ£º
ת×Ô£ºhttp://commandos.blog.51cto.com/154976/130652
Ò»¡¢ »·¾³×¼±¸
ÔÚ±¾ÎÄÖУ¬ËùÓгÌÐò¾ùÔÚLinuxÏ¿ª·¢Íê³É£¬¾²âÊÔÄܹ»Õý³£ÔËÐС£
ÔÚ¿ª·¢¹ý³ÌÖУ¬ÎÒÃÇÐèÒªÓõ½gSOAP£¬¿ÉÒÔ´ÓÒÔÏÂÍøÖ·ÏÂÔØ»ñµÃ£º[url]http://www.cs.fsu.edu/~engelen/soap.html[/url]
ÎÒÏÂÔصÄÊÇgsoap_2.7.12.tar.gz
ÏÂÔØÏÂÀ´½âѹËõ£¬°´Õý³£°²×°¹ý ......
¹ØÓÚ C/C++ º¯Êýµ÷ÓÃÔ¼¶¨£¬´ó¶àÊýʱºò²¢²»»áÓ°Ïì³ÌÐòÂß¼£¬µ«Óöµ½¿çÓïÑÔ±à³Ìʱ£¬Á˽âһϻ¹ÊÇÓкô¦µÄ¡£
VC ÖÐĬÈϵ÷ÓÃÊÇ __cdecl ·½Ê½£¬Windows API ʹÓà __stdcall µ÷Ó÷½Ê½£¬ÔÚ DLL µ¼³öº¯ÊýÖУ¬ÎªÁ˸ú Windows API ±£³ÖÒ»Ö£¬½¨ÒéʹÓà __stdcall ·½Ê½¡£
µ÷ÓÃÔ¼¶¨¸ú¶ÑÕ»Çå³ýÃÜÇÐÏà¹Ø¡£Èç¹ûдһ¸ö»ã±àº¯Êý£¬¸ø C/C++ ......
1.1 ±äÁ¿×÷ÓÃÓò
1.1.1 ¼¸ÖÖ³£¼ûÀàÐͱäÁ¿µÄ×÷ÓÃÓò
×÷ÓÃÓò£¨scope£©»òÕ߿ɼûÐÔÊÇÖ¸±äÁ¿ÔÚ³ÌÐòÄڵĿɼûºÍ¿ÉÒýÓõķ¶Î§¡£
±ÈÈç:
1¡¢ È«¾Ö±äÁ¿ÔÚËùÓеÄÎļþ¶¼¿É¼û£¬ÄÇËûµÄ×÷ÓÃÓò¾ÍÊÇËùÓÐÎļþ£»
2¡¢ static¶¨ÒåµÄÈ«¾Ö±äÁ¿£¬Ö»ÔÚ¶¨ÒåËüµÄÔ´ÎļþÖпɼû£¬ÄÇËûµÄ×÷ÓÃÓò¾ÍÊÇÆäËùÔÚµÄÔ´Îļþ£»
3¡¢ º¯ÊýÄÚ²¿µÄ¾Ö²¿±äÁ¿£¬Ö»ÔÚÆ亯Êý ......
ÀûÓÃÊÀ½ç×îС×î¿ìµÄC±àÒëÆ÷´òÔì×Ô¼ºµÄC±à¼Æ÷
¼ò½étinycc ÊÀ½çÉÏ×îС±àÒëËÙ¶È×î¿ìµÄCÓïÑÔ±àÒëÆ÷ ¸÷ÏÄܽø¹Ù·½È¥¿´
TCC¹Ù·½ÏÂÔصØÖ·£ºhttp://ftp.twaren.net/Unix/NonGNU/tinycc/tcc-0.9.25-win32-bin.zip
ÎÒÖªµÀ ´ó¼Ò»ù±¾É϶¼ÓùýWIN—TC°É ÌرðÊÇÉϹý´óѧµÄ CÓïÑÔÈëÃÅʱÓõĶ¼ÊÇ
ËûµÄ²Ù×÷½çÃæÈçͼ
¹þ¹þ ¿´ÏÂÍ ......
±í´ïʽµÄ¸±×÷ÓÃ
ÔËËã·ûµÄÓÅÏȼ¶Óë½áºÏÐԹ涨Á˱í´ïʽÖÐÏàÁÚÁ½¸öÔËËã·ûµÄÔËËã´ÎÐò£¬µ«¶ÔÓÚË«Ä¿
ÔËËãµÄ²Ù×÷Êý£¬C++ûÓй涨ËûÃǵļÆËã´ÎÐò¡£ÀýÈ磬¶ÔÓÚ±í´ïʽ£º
exp1 + exp2;
ÏȼÆËã exp1 »¹ÊÇ exp2£¿²»Í¬µÄ±àÒëÆ÷Óв»Í¬µÄ×ö·¨¡£
ÔÚÊýѧÉÏ£¬¶ÔÓÚË«Ä¿ÔËËã·û£¬²»ÂÛÏȼÆËãÄÄÒ»¸ö²Ù×÷Êý£¬ÒªÇó×îÖÕ¼ÆËã½á¹ûÒ»Ñù¡£
ÔÚ C++ ......