COM组件技术名称解释
摘要:GUID:全局唯一标识。CLSID 或 ProgID :唯一地表示一个组件服务程序,那么根据这些ID,就可以加载运行组件,并为客户端程序提供服务了。IID :唯一的表示接口ID。COM 组件是运行在分布式环境中的。比如,你写了一个组件程序(DLL或EXE),那么使用者可能是在本机的某个进程内加载组件(INPROC_SERVER);也可能是从另一个进程中调用组件的进程(LOCAL_SERVER);也可能是在这台计算机上调用地球那边计算机上的组件(REMOTE_SERVER)。
阅读全文
posted @
2014-03-31 11:18
言止予思
阅读(395)
推荐(0) 编辑
C++11-新增正则表达式
摘要:1 #include <regex> 2 #include <iostream> 3 #include <string> 4 #include <atlstr.h> 5 6 static std::string U2A(CString cstring) 7 { 8 if (::IsBadString
阅读全文
posted @
2014-03-29 22:05
言止予思
阅读(992)
推荐(0) 编辑
BSTR与char*、cstring、CComBSTR的转换
摘要:1 // BSTR_Convert.cpp : 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include // _com_util::ConvertBSTRToString 6 #include //CComBSTR 7 #include 8 9 #pragma comment(lib, "comsuppw.lib")10 11 using namespace _com_util;12 13 int _tmain(int argc, _TCHAR* argv[])14 {15 /****** BSTR-
阅读全文
posted @
2014-03-27 18:05
言止予思
阅读(1426)
推荐(0) 编辑
ATL字符宏使用以及代码测试
摘要:1 // ATL_Convert.cpp : 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 #include 8 #include 9 10 11 //USES_CONVERSION; //使用ATL字符转换宏12 13 int _tmain(int argc, _TCHAR* argv[])14 {15 char a[12] = "china";16 USES_CONVERSION;17 ::MessageBoxW(NULL, A2W(a), L"&qu
阅读全文
posted @
2014-03-27 12:01
言止予思
阅读(324)
推荐(0) 编辑
获取与一个磁盘的组织以及剩余空间容量有关的信息以及代码测试
摘要:1 // GetFreeDisk.cpp : 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 8 9 using namespace std;10 bool CheckDiskSpeech()11 {12 ULARGE_INTEGER ulTotalSize; 13 ULARGE_INTEGER ulFreeSize; 14 ULARGE_INTEGER ulAvailLableSize; 15 16 CString...
阅读全文
posted @
2014-03-26 21:52
言止予思
阅读(203)
推荐(0) 编辑
关于cstring ->string-> const char * 用U2A一步转换 错误的内存问题
摘要:1 // CStringTest.cpp : 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 #include 8 9 using namespace std;10 11 static std::string U2A(CString cstring)12 {13 if (::IsBadStringPtr(cstring,-1))14 return "";15 16 int cchStr = ::WideCharToMultiByte(CP_ACP, 0, cst...
阅读全文
posted @
2014-03-25 11:32
言止予思
阅读(337)
推荐(0) 编辑
cstring、string、wstring、int、char*、tchar、 int、dword等相互转换代码输出测试
摘要:1 #include 2 #include // _TCHAR 3 #include 4 #include 5 #include //Cstring 6 #include //W2A宏 7 #include 8 9 using namespace std; 10 11 int _tmain(int argc,_TCHAR* argv[]) 12 { 13 /**********string->cstring ***********/ 14 //setlocale(LC_ALL, "Chinese-simplified"); 15 ...
阅读全文
posted @
2014-03-20 22:58
言止予思
阅读(434)
推荐(0) 编辑
关于MultiByteToWideChar与WideCharToMultiByte代码测试(宽字符与多字节字符的转换)以及字符串的转换代码测试
摘要:1 #pragma once 2 #include //getchar() 3 #include 4 #include //sysytem() 5 #include //std 6 #include //cstring 7 #include //cout 8 9 using namespace std;10 using std::wcout;11 12 int _tmain(int argc, _TCHAR* argv[])13 {14 /***** char* 转换 cstring *********/15 //方式一 直接赋值...
阅读全文
posted @
2014-03-20 13:39
言止予思
阅读(423)
推荐(0) 编辑
字符串转换
摘要:cstring 转 intunsigned int usAge = (unsigned int)_ttoi((CString)m_pEditAge->GetText());int 转 cstring例如:unsigned int usAge = (unsigned int)_ttoi((CString)m_pEditAge->GetText());方法一 char chDuf[4] = "";//这里的chDuf[]数组的元素个数要比字符串个数大CString strage;_itoa_s(usAge, chDuf, 10); //参数10是代表转换成十进制数s
阅读全文
posted @
2014-03-14 14:11
言止予思
阅读(357)
推荐(0) 编辑