vincen

2014年2月12日 #

std::sort使用中注意的问题

Effecitve STL 中第 21条: 永远让比较函数对相同元素返回false

posted @ 2014-02-12 09:48 vincen 阅读(643) | 评论 (0)编辑 收藏

2013年11月15日 #

ISDEV : error -5008: Intel64 or AMD64 must be specified in the template of the Summary Stream

IS 2009解决办法
Installation Designer-Installation Infomation-General Infomation-Summary Infomation Stream- Template Summary
将默认的Intel改为Intel64或者AMD64

posted @ 2013-11-15 09:40 vincen 阅读(1424) | 评论 (0)编辑 收藏

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. 在程序中得到文件名后,怎么操作就随你了。

posted @ 2013-11-12 11:24 vincen 阅读(268) | 评论 (0)编辑 收藏

2013年7月17日 #

关于AfxGetMainWnd()

在多线程环境下,在调用
AfxGetMainWnd()
时常得到空值,这是需要改为调用
AfxGetApp()->m_pMainWnd

posted @ 2013-07-17 15:14 vincen 阅读(382) | 评论 (0)编辑 收藏

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);

posted @ 2010-07-08 16:38 vincen 阅读(274) | 评论 (0)编辑 收藏

2010年6月24日 #

配置文件的注释符

配置文件的注释可以另起一行或者以;作为开始

posted @ 2010-06-24 10:24 vincen 阅读(479) | 评论 (0)编辑 收藏

2009年12月11日 #

多线程程序调试感想

前一阵子调试了一部分多线程程序。因为程序的运行周期比较短,而且运行的很频繁。所以很多朋友提到的用日志文件的办法不是很可行。没办法最后是一段一段的调试。
因为程序是多线程的,所以在debug的时候总是特别注意线程函数中的数据保护的工作,结果所有的数据都保护起来还是没有用。最后,开始怀疑线程信号源的问题。终于在去掉了信号源中的一个延时后,程序变得稳定了。

最后,通过catch到一个易出错的部分。查到其中存在static变量,去掉。终于稳定了。


posted @ 2009-12-11 23:25 vincen 阅读(256) | 评论 (0)编辑 收藏

仅列出标题