cÓÃapiµ÷ÓöԻ°¿ò
#include <windows.h>
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nShowCmd )
{
OPENFILENAME ofn;
//ÔÚÄÚ´æÖпª±ÙÒ»¿é¿Õ¼ä£¬´æ·ÅÓû§Ñ¡È¡µÄÎļþÃû
char szFile[MAX_PATH];//MAX_PATHÊÇϵͳ¶¨ÒåµÄÒ»¸öºêֵΪ260£¬Windows²Ù×÷ϵͳÎļþ·¾¶µÄ×î´ó³¤¶È
ZeroMemory(&ofn,sizeof(ofn));//½«Õâ¸ö½á¹¹Ìå±äÁ¿¶¨ÒåΪ0
ofn.lStructSize = sizeof(ofn);//»ñÈ¡½á¹¹ÌåµÄ´óС
ofn.lpstrFile = szFile;//szFileÊÇÒ»¸ö×Ö·ûÊý×飬ÄÇôszFileÕâ¸öÃû×־ʹú±íÕâ¸ö×Ö·ûÊý×éµÄÊ×µØÖ·ÕâÊÇÒ»¸öÖ¸ÕëµÄÓ¦Ó㬰ѽÓÊÕÑ¡ÔñÎļþÃûµÄÊý×éµÄµØÖ·´«µÝµ½GetOpenFileNameº¯ÊýÖС£
ofn.lpstrFile[0] = TEXT('\0');//Ч¹ûµÈ¼ÛÓÚZeroMemory(szFile,sizeof(szFile));
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = TEXT("ËùÓÐÎļþ(*.*)\0*.*\0Text(*.TXT)\0*.TXT\0");
ofn.nFilterIndex = 1;//ĬÈÏÑ¡ÔñµÄ¹ýÂËÆ÷£¬Ë÷Òý´Ó1¿ªÊ¼
// Ö¸Ïò½ÓÊÕÑ¡ÔñµÄÎļþµÄÎļþÃûºÍÀ©Õ¹ÃûµÄ»º³å£¨²»´ø·¾¶ÐÅÏ¢£©¡£Õâ¸ö³ÉÔ±¿ÉÒÔÊÇNULL¡£
ofn.lpstrFileTitle = NULL;
//Ö¸¶¨lpstrFileTitle»º³åµÄ´óС£¬ÒÔTCHARsΪµ¥Î»¡£¶ÔÓÚANSI°æ±¾£¬ÊÇ×ֽڵĸöÊý£»¶ÔÓÚUnicode°æ±¾£¬ÊÇ×ֽڵĸöÊý¡£Èç¹ûlpstrFileTitleÊÇNULL£¬Õâ¸ö³ÉÔ±±»ºöÂÔ¡£
ofn.nMaxFileTitle = 0;
//Ö¸ÏòÒÔ¿Õ×Ö·û½áÊøµÄ×Ö·û´®£¬¿ÉÒÔÔÚÕâ¸ö×Ö·û´®ÖÐÖ¸¶¨³õʼĿ¼¡£
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_EXPLORER |OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;//OFN_PATHMUSTEXIST·¾¶±ØÐë´æÔÚ£¬OFN_FILEMUSTEXISTÎļþ±ØÐë´æÔÚ
if (GetOpenFileName(&ofn))
{
MessageBox(NULL,szFile,"",MB_OK);
}
return 0;
}
Ïà¹ØÎĵµ£º
ijЩÇé¿öÏÂÏ£Íûº¯ÊýµÄ²ÎÊý¸öÊý¿ÉÒÔ¸ù¾ÝÐèҪȷ¶¨¡£µäÐ͵ÄÀý×ÓÓдó¼ÒÊìϤµÄº¯Êýprintf()¡¢scanf()ºÍϵͳµ÷ÓÃexecl()µÈ¡£ÄÇôËüÃÇÊÇÔõÑùʵÏÖµÄÄØ£¿C±àÒëÆ÷ͨ³£ÌṩÁËһϵÁд¦ÀíÕâÖÖÇé¿öµÄºê£¬ÒÔÆÁ±Î²»Í¬µÄÓ²¼þƽ̨Ôì³ÉµÄ²îÒ죬Ôö¼Ó³ÌÐòµÄ¿ÉÒÆÖ²ÐÔ¡£ÕâЩºê°üÀ¨va_start¡¢ va_argºÍva_endµÈ¡£
²ÉÓÃANSI±ê×¼ÐÎʽʱ£¬²ÎÊý¸öÊý¿É± ......
ÔÚ<TCHAR.h>Í·ÎļþÀÓÐÕâôһ×é²Ù×÷ÎļþµÄºê
#define _tfdopen _wfdopen
#define _tfsopen _wfsopen
#define _tfopen _wfope ......
ǰЩÌì¿´ÁËÀî¸Õ<struts2+hibernate+spring>ÄÇÊéÉϵÄhibernate£¬ÅäÖÃÎļþÒ²ÊÇ°´ÕÕÉÏÃæÇýøhibernate.cfg.xmlÎļþµÄ£¬Student.javaÅäÖõÄStudent.hbm.xmlÎļþ¾õµÃҲûʲôÎÊÌ⣬µ«²»Öªµ½Ôõô»ØʾÍÊDZ¨ connection can not open¡£ÓôÃÆ°¡£¬ºóÀ´ÎҾͰÑÊéÀïÃæµÄÅäÖÃÎļþºÍÔ´Â룬¸´ÖƵ½MyEclipseÏÂÃæµÄÒ»¸öÐÂwebÏîÄ¿ÖУ¬ÔËÐ ......
¸ãÁ˼¸ÌìµÄÎÊÌâ¡£±àÒëÒ»¸öÎļþʱ,ÀÏÊdzöÏÂÃæÕâ¸ö´í.
checking for C compiler default output file name… configure: error: C compiler cannot create executables
û·¨×Ó,ÕÒ¸ßÈË°ïÎÒ´¦Àí,¹þ¹þ….¼Ç¼ÏÂÀ´.ÒòΪ64λµÄ»úÆ÷£¬Ä¬È϶ÔCFLAGSµÄÕâÊǽøÐÐÁËÉèÖÃ,ËùÒÔʹÓÃÏÂÃæµÄÃüÁîÇå¿ÕËû¾ÍÐÐÁË£¬ÕâÑùÈí¼þ¾Í²»»á±¨ ......