在要调用回调函数的类中声明:
CallFun.h
//返回类型为void, 参数类型为std::string
typedef void(*PCALLBACKFunc) (std::string );
class CallFun{
private:
PCALLBACKFunc m_pCallBack;
public:
void setCallBack(PCALLBACKFunc Func);
void runCallBack(std::string strMsg);
}
CallFun.cpp
void CallFun::s ...
class Shape
class Triangle : public Shape
1.shared_ptr
定义类:
typedef boost::shared_ptr<class Shape> ShapeSharedPtr;
实例化:
ShapeSharedPtr shapeSP = ShapeSharedPtr(new Shape());
定义数组:
typedef boost::shared_ptr<std::vector<ShapeSharedPtr>> ShapeListSharedPtr;
辅助定义:
typedef std:: ...
在全英文的XP中,在非unicode的程序中输入的中文会转为“??”。
通过截获WM_IME_COMPOSITION消息得到输入的字符串
ImmGetCompositionStringW得到Unicode
WideCharToMultiByte转换为ANSI
BOOL CchartestDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_IME_COMPOSITION)
{
HIMC hIMC;
HWND hWnd=pMsg->hwnd;
DWORD dwSize;
WCHAR l ...







评论排行榜