若使用控制台的「新增或移除程式」無法移除 vs 2008,發生
「A problem has been encountered while loading the setup components. Canceling setup.」
錯誤訊息。到官方網站下載 AutoUninstallTool 就可以完全移除 vs2008了。
參考 : 解除安裝 Visual Studio 2008
若使用控制台的「新增或移除程式」無法移除 vs 2008,發生
「A problem has been encountered while loading the setup components. Canceling setup.」
錯誤訊息。到官方網站下載 AutoUninstallTool 就可以完全移除 vs2008了。
參考 : 解除安裝 Visual Studio 2008
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 ;
發生 redefniiton of typdef 的情形
view plain
C++:
// in a.h
typedef struct tagNBestS {
.....
}NBestS;
// in b.h
#ifndef NBestS
typedef struct tagNBestS NBestS;
#endif
編譯時發生
error: redefinition of typedef ‘NBestS
解決的方法
view plain
C++:
// in a.h
#ifndef __cplusplus
typedef struct NBestS NBestS;
#endif
struct NBestS {
....
};
//in b.h
struct NBestS;
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 [...]
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 [...]