Things to Remember:在一個獨立的語句中將 new 出來的對象存入智能指標。如果疏忽了這一點,當異常發生時,可能引起微妙的資源泄漏。下面這個函數調用還是可能泄漏資源。為什嗎?processWidget(std::tr1::shared_ptr<Widget>(new Widget), priority()); 下面就來說明這是如何發生的。 在編譯器能產生一個對 processWidget
1. Multibyte shows to us as char*. While in fact, it can be any code page encoding, including gbk, utf8, etc. If a char* represents utf8 characters, we need to handle it specially in below way:// Convert unicode(windows default utf16) to utf8 char*
Essence: Wrap functions to read/write things from another module. Windows keep seperate heaps for debug and release - built DLLs and EXEs. So for example, calling a release DLL from a debug application EXE, any memory we allocate needs to be
For the details on how to initialize a GUID, check this page http://support.microsoft.com/kb/130869. (definitely we are using a new version compiler! So get to use #include<initguid.h>)Summary of a problem I met and finally find the above
You may meet below errors before:error C2220: warning treated as error - no 'object' file generated warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent
文章目錄 To edit a loaded project file in Visual Studio [From: http://msdn.microsoft.com/en-us/library/ms171487(VS.80).aspx] Visual StudioHow To: Edit Project Files MSBuild project files are written in a standard XML format,
Threading safety means: multiple threads can call the same method at the same time without corrupting your data/resources如果你的代碼所在的進程中有多個線程在同時運行,而這些線程可能會同時運行這段代碼。如果每次運行結果和單線程啟動並執行結果是一樣的,而且其他的變數的值也和預期的是一樣的,就是安全執行緒的。
[Copied from C++ coding standards-chapter 9] Easy on yourself, easy on the code: All other things being equal, notably code complexity and readability, certain efficient design patterns and coding idioms should just flow naturally from your
Macros for Custom Build CommandsYou can use the File and Directory drop-down lists to insert any of the following directory and filename macros in either grid at the current insertion point location. The File and Directory drop-down lists are on the
In the place you plan to post message:a. If you are sure the WM_Command can be handled by view/document, you can directly call View::OnCmdMsg() or Doc::OnCmdMsg() to post the message;b. If you don't know where in the command routing way will handle
Registry-Free COM Registration InstallShield 2008 With Reg-Free COM, COM data is written to an application manifest file that is stored in the application folder. The manifest file is an XML file that contains information about an application
使用“devenv.exe /edit ”命令在一個已經存在的vs執行個體裡開啟檔案 原文連結:You can use devenv.exe /edit to open a file in an existing Visual Studio instance操作步驟: 運行命令:devenv /edit ,可以在IDE裡開啟檔案。 你也可以建立一個cmd檔案,例如VSEdit.cmd,在檔案裡(可以用記事本)寫如下內容: @"devenv.exe" /edit
Pragma liblib - manipulate @INC at compile timeDESCRIPTIONThis is a small simple module which simplifies the manipulation of @INC at compile time.It is typically used to add extra directories to perl's search path so that later use or require
最近參加了公司的一個program competition,做個小工具。其中涉及到一個盲點。 需求是:在代碼中訪問另一個program的進程,擷取它的視窗控制代碼,並在它的視窗上對某一個控制項進行滑鼠點擊操作以執行相應的命令。google來baidu去,終於有思路了:原來需要用到MS的UI automation library。MS提供了面向c/c++的API,也提供了面向managed code的API。Extract some overview words from below MS
文章目錄 Deleted... And Still AroundCompact a PST File to Reduce Its Size in Outlook 轉自:http://email.about.com/od/outlooktips/qt/et_compact_pst.htmDeleted... And Still Around When you delete an email in Outlook, it goes to
Here is an MSDN link that describes what registration-free com is:http://msdn.microsoft.com/en-us/library/fh1h056h.aspxA whole walkthrough article: http://msdn.microsoft.com/en-us/library/ms973913.aspx Registration-Free COM InteropRegistration-free