我的博客小站

2013年12月18日

命令行参数技巧:__argc,__argv

摘要: 几个可以使用的全局变量:_CRTIMP extern int __argc; /* count of cmd line args */_CRTIMP extern char ** __argv; /* pointer to table of cmd line args */_CRTIMP extern wchar_t ** __wargv; /* pointer to table of wide cmd line args */__argc、__argv、__wargv如果是MFC项目,可以使用CWinApp的m_lpCmdLine变量,注意这个m_lpCmdLi... 阅读全文

posted @ 2013-12-18 11:05 BIGSING 阅读(3207) 评论(0) 推荐(0) 编辑

_bstr_t可接受多字节、UNICODE字符串,方便用以字符集转换

摘要: 使用_bstr_t需要包含的头文件:#include #include // test.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;string ws2ms(const wstring& ws){ _bstr_t t = ws.c_str(); char* pchar = (char*)t; return pchar;}wstring ms2ws(const string& s){ _bstr_t t = s.c_str(); 阅读全文

posted @ 2013-12-18 10:46 BIGSING 阅读(763) 评论(0) 推荐(0) 编辑

导航

我的博客小站