整理和收集一些简单实用的代码片段,既方便自己也方便大家
关于两个用于创建和销毁二维动态数组的宏
摘要:两个宏,用来创建和销毁二维动态数组的:#define matrix_allocate(matrix,width,height,TYPE) {\matrix=new TYPE *[height];\for(int _i=0;_i<height;_i++)\ matrix[_i]=new TYPE[width];\} #define matrix_delete(matrix,wid...
阅读全文
posted @
2006-03-25 00:17
vcfly
阅读(810)
推荐(0)
关于各种字符类型的指针的转换
摘要:#include { CString filepath; USES_CONVERSION;//只需要在一个函数段内声明一次即可进行多次转换,详见该宏的定义 LPCOLESTR lpwFileName = T2COLE(filepath); //转换T类型为宽字符 //其他类型的相互转换,可在msdn里查找T2COLE, //或者直接去查...
阅读全文
posted @
2006-03-25 00:10
vcfly
阅读(690)
推荐(0)
About CEdit::LineLength
摘要:以前想获取edit ctrl中的每一行的字符串内容,发现MSDN上如下的代码: #ifdef _DEBUG // The pointer to my edit. extern CEdit* pmyEdit; int i, nLineCount = pmyEdit->GetLineCount(); CString strText, strLine; // Dump every...
阅读全文
posted @
2005-10-11 16:58
vcfly
阅读(2213)
推荐(0)
实用的全屏切换(ZZ)
摘要:void CMainFrame::FullScreen(){ m_bFullScreen=!m_bFullScreen; LONG style = ::GetWindowLong(this->m_hWnd,GWL_STYLE); if(m_bFullScreen)// { style &= ~(WS_DLGFRAME | WS_THICKFRAME); SetWindowLong(this-...
阅读全文
posted @
2005-06-16 10:00
vcfly
阅读(782)
推荐(0)