15 一月, 2009
Posted by: asd In: 科技新知| 軟體使用
想要在其它沒裝 vc9 的 windows 電腦,執行 vc9 build 的執行檔
有兩種方法
Method1
安裝 visual studio 2008 redistributable package
就不用copy一堆 runtime 需要的 dll 到執行檔的工作目錄。
Method2
用 dependency walker 先查看 exe 需要用到哪些其它系統沒有的 dll,將 dll 複製和exe放在一起。這些 dll 可到 C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86 找到。如 runtime-c library 需要 msvcp90.dll、msvcr90.dll, mfc 需要 mfc90.dll。
還需要拷貝
C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest
C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.MFC\Microsoft.VC90.MFC.manifest (若用到 mfc)
和 exe 放在一起。
14 四月, 2008
Posted by: asd In: 科技新知| 軟體使用
vc6 debug 發生如下的錯誤訊息
One or more breakpoints cannot be set and have been disabled. Execution will stop at the beginning of the program.
解決的方法
project->setting->c/c++-general->debug info->program databse for edit and continue ;
11 一月, 2008
Posted by: asd In: 科技新知| 軟體使用
vc6 只能和 2001.Oct msdn 整合,此 plugin可解決這個問題,使 vc6 使用較新版本的 msdn。 若電腦裝了不只一個版本的 msdn,它可以讓你切換使用不同版本的 msdn,如下圖所示
參考: VC++ 6 的 MSDN 插件
28 八月, 2006
Posted by: asd In: 科技新知| 軟體使用
VC6下用 Debug 模式執行EnumWindow 發生如下圖有關暫存器 ESP 的錯誤,Release 模式又ok
view plain
C++:
EnumWindows((WNDENUMPROC)EnumWindowsProc, 0);
BOOL EnumWindowsProc(HWND hWnd, long lParam)
{
char Buff[1000], NameOfClass[1000];
HWND hChild;
GetWindowText(hWnd, Buff, 1000);
GetClassName(hWnd, NameOfClass, 1000);
if (strcmp(NameOfClass, "Notepad") == 0) {
hChild = GetWindow(hWnd, GW_CHILD);
GetClassName(hChild, NameOfClass, 1000);
GetWindowText(hChild, Buff, 1000);
g_hWnd = hChild;
return FALSE;
}
return TRUE;
}
Solution
do NOT use the compile option "/Gz", this option changes the calling convention
/Gd __cdecl calling convention
/Gr __fastcall calling convention
/Gz [...]
22 八月, 2006
Posted by: asd In: 科技新知| 軟體使用
Build MFC UNICODE Program 時發生錯誤
msvcrtd.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16
產生原因
The linker is looking for the entry point for a console application, but the application is being compiled and linked as a windows application (i.e. not a console application).
This error has been observed after changing the project settings from using MBCS to UNICODE characters.
解決方法
Under [...]