随笔分类 -  C++

摘要:按照默认规定,只有一个参数的构造函数也定义了一个隐式转换,将该构造函数对应数据类型的数据转换为该类对象,如下面所示:class String {String ( const char* p );// 用C风格的字符串p作为初始化值//…}String s1 = “hello”;//OK 隐式转换,等价于String s1 = String(“hello”);但是有的时候可能会不需要这种隐式转换,如下:class String { String ( int n );//本意是预先分配n个字节给字符串String ( const char* p );// 用C风格的字符串p作为初始化值//…}下面 阅读全文
posted @ 2013-10-24 12:57 呵呵·· 阅读(227) 评论(0) 推荐(0)
摘要:/************************************************************************//* 函数名: EnQrCode *//* 功能: 生成二维码bmp图片 *//* 参数: *//* strPathN... 阅读全文
posted @ 2013-10-12 15:32 呵呵·· 阅读(1030) 评论(0) 推荐(0)
摘要:CPaintDC dc(this);// device context for painting CRect rtClient; GetClientRect(rtClient); //获取客户区尺寸、位置信息 /////// 利用CFont::CreateFont(...)函数实现竖写汉字//////// CFont myFont; //创建字体对象 //创建逻辑字体 myFont.CreateFont(40, //字体高度(旋转后的字体宽度)=56 10, //字体宽度(旋转后的字体高度)=20 2700, //... 阅读全文
posted @ 2013-09-22 14:27 呵呵·· 阅读(342) 评论(0) 推荐(0)
摘要:#define FUNC_ADDR(hDll, func) pf##func func = \(pf##func)GetProcAddress(hDll,#func);\if(! func) {\AfxMessageBox("GetAddrErr"#func);\}HMODULE hDll = LoadLibrary("InvoicePrintMP512.dll");if(!hDll) {AfxMessageBox("LoadErr");}FUNC_ADDR(hDll, OpenDevice)FUNC_ADDR(hDll, Close 阅读全文
posted @ 2013-07-16 12:02 呵呵·· 阅读(301) 评论(0) 推荐(0)