just add if ( m_wndToolBar.OnCmdMsg(...) ) { return TRUE; }
in function CMainFrame::OnCmdMsg(...)
before return default process.
Rockone
Posts
-
ON_COMMAND_EX -
ON_COMMAND_EXI already try some cases, it works well in doc/view case. I get some source codes from sourceforge.net, it uses ON_COMMAND_EX and is not doc/view case. it just has CMainFrame and a view derived from CWnd, without doc.
-
ON_COMMAND_EXI need process the message in the child window and parent window. child window uses ON_COMMAND_EX and parent window uses ON_COMMAND.
-
ON_COMMAND_EXThank you for your reply. I already google it and search it on codeproject and codeguru before posting this message. Yes, it works well for Doc & View architecture. my architecture is CMainFrame and CMyView (derived form CWnd, not CView) and without Doc. And it has a custom tool bar and a custom status bar.
-
ON_COMMAND_EXit seems that ON_COMMAND_EX just works in doc/view architecture. Can anyone give me some tips about it? thank you.
-
how to copy the bitmap data to clipboard?thank you very much, this one is work. http://www.codeproject.com/clipboard/clipnutshell.asp
-
how to copy the bitmap data to clipboard?Thank you. yes, i already try this function and COleDataSource::SetClipboard(). but they are not work. and below is my code.
if ( OpenClipboard() ) { EmptyClipboard(); SetClipboardData(CF_BITMAP, m_hDrawingSurface); CloseClipboard(); }
code using oleCOleDataSource* pDataSource = new COleDataSource; TRY { // Create a shared file and associate a CArchive with it CSharedFile file; CArchive ar(&file,CArchive::store); BITMAPFILEHEADER bmfh; int nBitsOffset = sizeof(BITMAPFILEHEADER) + m_bmpInfoHeader.biSize; LONG lImageSize = m_bmpInfoHeader.biSizeImage; LONG lFileSize = nBitsOffset + lImageSize; bmfh.bfType = 'B'+('M'<<8); bmfh.bfOffBits = nBitsOffset; bmfh.bfSize = lFileSize; bmfh.bfReserved1 = bmfh.bfReserved2 = 0; //Write the bitmap file header ar.Write(&bmfh, sizeof(BITMAPFILEHEADER)); //And then the bitmap info header ar.Write(&m_bmpInfoHeader, sizeof(BITMAPINFOHEADER)); ar.Write(m_pDrawingSurfaceBits, lImageSize); ar.Close(); // specify HGLOBAL handle to text data pDataSource->CacheGlobalData(CF_DIB, file.Detach()); pDataSource->SetClipboard(); } CATCH_ALL(e) { delete pDataSource; THROW_LAST(); } END_CATCH_ALL
-
how to copy the bitmap data to clipboard?at first, please visit this topic. http://www.codeproject.com/bitmap/drawing2bitmap.asp and my question is below. how to copy the bitmap data to clipboard? Thank you in advance.
-
how to capture a big window?thank you! i know that, but i have to get the big one.
-
how to capture a big window?thank you, i will give it a try.
-
how to capture a big window?i want to capture a window to a bitmap. when the document size is bigger than current viewable rectangle, if using the document size to the captured image will has a big black block.
CSize size = GetTotalSize(); CClientDC dc(this); CDC memDc; if(!memDc.CreateCompatibleDC(&dc)) { return ; } CBitmap bitmap; if( !bitmap.CreateCompatibleBitmap(&dc, size.cx, size.cy) ) { return ; } CBitmap* pOldBitmap = memDc.SelectObject(&bitmap); memDc.BitBlt(0, 0, size.cx, size.cy, &dc, 0, 0, SRCCOPY ); if( OpenClipboard() ) { EmptyClipboard(); SetClipboardData(CF_BITMAP, bitmap.GetSafeHandle()); CloseClipboard(); } memDc.SelectObject(pOldBitmap);
any suggestion or tips will be great help. thank you in advance. -
error LNK2019: unresolved external symbolThank your reply. I miss define a macro, so the dll cannot be export
-
error LNK2019: unresolved external symbolwhen I porting a win32 application to a PPC 2002 application, there are many link errors, but they are the same type, error LNK2019. .Exe project link options(Debug): .lib commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"wWinMainCRTStartup" /verbose /incremental:yes /pdb:"ARMDbg/fch.pdb" /map:"ARMDbg/fch.map" /debug /nodefaultlib:$(CENoDefaultLib) /out:"ARMDbg/fch.exe" /libpath:"..\vg\ARMDbg" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM .Exe project link options(Release): .lib commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"wWinMainCRTStartup" /incremental:no /pdb:"ARMRel/fch.pdb" /map:"ARMRel/fch.map" /nodefaultlib:$(CENoDefaultLib) /out:"ARMRel/fch.exe" /libpath:"..\vg\ARMRel" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM .Dll project link options(Debug): commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /verbose /dll /incremental:yes /pdb:"X86Dbg/.pdb" /map:"X86Dbg/.map" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /def:".\.def" /out:"X86Dbg/.dll" /implib:"X86Dbg/.lib" /pdbtype:sept /subsystem:$(CESubsystem) /MACHINE:IX86 .Dll project link options(Release): /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /verbose /dll /incremental:no /pdb:"ARMRel/.pdb" /map:"ARMRel/.map" /nodefaultlib:$(CENoDefaultLib) /def:".\.def" /out:"ARMRel/.dll" /implib:"ARMRel/.lib" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM a typical error message is bellow: myDoc.obj : error LNK2019: unresolved external symbol "public: bool __thiscall Quantity::Set(unsigned long)" (?Set@Quantity@@QAE_NK@Z) referenced in function "protected: void __thiscall CmyDoc::OverrideDefaultInitialValues (class IO_Rack *)" (?OverrideDefaultInitialValues@CmyDoc@@IAEXPAVIO_Rack@@@Z) The function in the Dll: >> bool Quantity::Set(unsigned long ulInput) >> { >> dBase = (double)(ulInput) ; >> return true ; >> } any tip or suggestion would of great help. Thank you advanced.