2014年2月12日
#
Effecitve STL 中第 21條: 永遠讓比較函數對相同元素返回false
2013年11月15日
#
IS 2009解決辦法
Installation Designer-Installation Infomation-General Infomation-Summary Infomation Stream- Template Summary
將默認的Intel改為Intel64或者AMD64
2013年11月12日
#
1. 關聯:注冊表[HKEY_CLASSES_ROOT]下新建主鍵“.xxx”,雙擊右側其“默認”項,填入“myfiletype”。再在 [HKEY_CLASSES_ROOT]下新建主鍵“myfiletype”,在“myfiletype”下新建“shell”,在“shell”下新建 “open”,在“open”下新建“command”;雙擊“command”右側的“默認”項填入你的程序路徑和名字,如c:\mydir \myapp.exe %1
2. 這樣,雙擊*.xxx就會執行你的程序。在VC 中AfxGetApp()->m_lpCmdLine即可得到被雙擊的文件的文件名。
3. 在程序中得到文件名后,怎么操作就隨你了。
2013年7月17日
#
在多線程環境下,在調用
AfxGetMainWnd()
時常得到空值,這是需要改為調用
AfxGetApp()->m_pMainWnd
2010年7月8日
#
顯示的位圖顯示的時候,色深是8的情況下,只有3通道的情況下不需要LUT表,其他情況都需要LUT表
char __bif[sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256];
BITMAPINFO& bif = *(BITMAPINFO*)__bif;
bif.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bif.bmiHeader.biWidth = width;
bif.bmiHeader.biHeight = height;
bif.bmiHeader.biPlanes = 1;
bif.bmiHeader.biBitCount = 8;
bif.bmiHeader.biCompression = BI_RGB;
bif.bmiHeader.biSizeImage = 0;
bif.bmiHeader.biXPelsPerMeter = 1;
bif.bmiHeader.biYPelsPerMeter = 1;
bif.bmiHeader.biClrUsed = 0;
bif.bmiHeader.biClrImportant = 0;
for(int i = 0; i < 256; ++i)

{
int b = i;
bif.bmiColors[i].rgbBlue = b;
bif.bmiColors[i].rgbGreen = b;
bif.bmiColors[i].rgbRed = b;
bif.bmiColors[i].rgbReserved = 0;
}
SetStretchBltMode(hDC, COLORONCOLOR);
StretchDIBits(hDC, destRt.left, destRt.top, destRt.right - destRt.left, destRt.bottom - destRt.top,
0,0,width,height,pImage,(BITMAPINFO*)&bif, DIB_RGB_COLORS, SRCCOPY);
2010年6月24日
#
2009年12月11日
#
前一陣子調試了一部分多線程程序。因為程序的運行周期比較短,而且運行的很頻繁。所以很多朋友提到的用日志文件的辦法不是很可行。沒辦法最后是一段一段的調試。
因為程序是多線程的,所以在debug的時候總是特別注意線程函數中的數據保護的工作,結果所有的數據都保護起來還是沒有用。最后,開始懷疑線程信號源的問題。終于在去掉了信號源中的一個延時后,程序變得穩定了。
最后,通過catch到一個易出錯的部分。查到其中存在static變量,去掉。終于穩定了。