Windows 8 Metro 应用开发入门(一):开发环境介绍
admin | 开发经验 | 2014-04-02
摘 要
Windows8已经发布,随之而来的基于WinRT的Metro应用也正向我们走来,正像它所宣传的:光滑、快、现代。看习惯了玻璃、立体风格的应用,或许Metro的简洁能给你留下不一样的体验。Visual Studio 2012为Metro应用提供了强有力的开发支持。磨刀不误砍柴工!这一章我们先来介绍一下开发环境的搭建及可能遇到的问题,最后再来一个简单的应用体验一下Me... [阅读全文]
wstring2string
admin | 类型转换 | 2014-04-01
C++
std::string ws2s(const std::wstring& ws)
{
std::string curLocale = setlocale(LC_ALL, NULL); // curLocale = "C";
setlocale(LC_ALL, "chs");
const wchar_t* _Source = ws.c_str();
size_t _Dsize = 2 * ws.size() + 1;
char *_Dest = new char[_Dsize];
memset(_Dest,0,... [阅读全文]
string2wstring
admin | 类型转换 | 2014-04-01
C++
std::wstring s2ws(const std::string& s)
{
setlocale(LC_ALL, "chs");
const char* _Source = s.c_str();
size_t _Dsize = s.size() + 1;
wchar_t *_Dest = new wchar_t[_Dsize];
wmemset(_Dest, 0, _Dsize);
mbstowcs(_Dest,_Source,_Dsize);
std::wstring result = _Dest;
... [阅读全文]
string.c_str()
admin | 类型转换 | 2014-04-01
C++
Call c_str() to get a const char * (LPCSTR) from a std::string.
It's all in the name:
LPSTR - (long) pointer to string - char *
LPCSTR - (long) pointer to constant string - const char *
LPWSTR - (long) pointer to Unicode (wide) string - wchar_t *
LPCWSTR - (long) pointer to constant Unicode (w... [阅读全文]
引入 excel.tlh 错误
admin | 二次开发 | 2014-04-01
编译出错的解决了 其实只要注释掉每个头文件的
#import “C:\\Program Files\\Microsoft Office\\Office12\\EXCEL.EXE” no_namespace
然后在CRange.h中的 VARIANT DialogBox() 改成 VARIANT _DialogBox() 就可以
[阅读全文]
MFC timer
admin | C++ | 2014-04-01
C++
ON_WM_TIMER()
virtual void OnTimer(UINT nIDEvent);
KillTimer(nIDEvent)
123
ON_WM_TIMER()virtual void OnTimer(UINT nIDEvent);KillTimer(nIDEvent)
[阅读全文]
C++使用OLE高速读写EXCEL的源码
admin | 取词 | 2014-04-01
http://www.cnblogs.com/fullsail/archive/2012/12/28/2837952.html
[阅读全文]
C++ Execute
admin | win32 | 2014-04-01
C++
BOOL Execute(LPCTSTR lpszProcessName, BOOL bForceAdmin, BOOL bWaitProcess)
{
BOOL bRet = FALSE;
PROCESS_INFORMATION processInfo;
STARTUPINFO si = {sizeof(STARTUPINFO)};
CString strCmdLine;
DWORD dwErrCode = 0;
HANDLE hProcess = NULL;
... [阅读全文]
Microsoft Speech API
admin | Windows api | 2014-03-31
Microsoft Speech API, Text-to-Speech : http://msdn.microsoft.com/en-us/library/ms720163(v=vs.85).aspx
An example :
C++
#include <stdafx.h>
#include <sapi.h>
int main(int argc, char* argv[])
{
ISpVoice * pVoice = NULL;
if (FAILED(::CoInitialize(NULL)))
return FALSE;
... [阅读全文]
让 COM 脱离注册表
admin | win32 | 2014-03-28
引言
在上一篇《在 DLL 中加入第二个 COM 类》的“单用户注册”一节中,我们曾提到脱离注册表依赖一事,现在我们来把这事儿给办了。
注册
我们在之前支持了“regsvr32 /n /i:user COMProvider.dll”这一注册命令。这一注册命令给了我们一定的扩展余地。从ATL默认的代码来看,对于DllInstall,目前已定义的命令行参数似乎只有user,于是我们可以定义... [阅读全文]