Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
U

ucc801

@ucc801
About
Posts
11
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How do save a screen to a bitmap
    U ucc801

    You need to create a memory bitmap at first and then drawing it on this memory bitmap,when finished,please convert CBitmap to bitmap file,I think the following sample codes to be useful to you (You cann't build it,it is only a sample): BOOL CMyCanvasCore::DoDrawImage(CImage* pImage, CDC* pDC) { BOOL bSuccess = FALSE; CDC dcMem; CBitmap bmp; CDC dcScreen; dcScreen.Attach(::GetDC(0)); if (pDC == NULL) { pDC = &dcScreen; } dcMem.CreateCompatibleDC(pDC); CRect rcVirtual(GetVirtualOrigin(), GetVirtualSize()); CSize szBitmap(rcVirtual.Width(), rcVirtual.Height()); PrepareDrawDC(pDC, FALSE); pDC->LPtoDP(&szBitmap); BOOL bBmpCreated = bmp.CreateCompatibleBitmap(pDC, szBitmap.cx, szBitmap.cy); if (bBmpCreated) { dcMem.SelectObject(&bmp); const CPoint ptOldLogOrg = GetLogOrigin(); CRect rcMargins; GetMargins(rcMargins); CSize szMargins(rcMargins.left, rcMargins.top); FODPtoLP(&szMargins); CPoint ptTopLeft(GetVirtualOrigin()); ptTopLeft.x += szMargins.cx; ptTopLeft.y += szMargins.cy; SetLogOrigin(ptTopLeft.x, ptTopLeft.y); PrepareDrawDC(&dcMem, FALSE); // Draw background. DoDrawBackGround(&dcMem,rcVirtual); GetCurrentModel()->OnDrawShapeNormal(&dcMem); SetLogOrigin(ptOldLogOrg.x, ptOldLogOrg.y); // pImage->MakeNewBitmap(&dcMem, &bmp); bSuccess = TRUE; } dcScreen.Detach(); return bSuccess; } Jack --------------------------------------------------------------------------------- XD++ MFC/C++ Flow/Diagram Library -- http://www.ucancode.net

    C / C++ / MFC graphics question

  • status bar
    U ucc801

    With the following steps: 1.Define a value,such as ID_FO_INDEX_MOUSEPOS. static UINT indicators[] = { ID_SEPARATOR, // status line indicator ID_FO_INDEX_MOUSEPOS, ID_INDICATOR_CAPS, ID_INDICATOR_NUM, ID_INDICATOR_SCRL, }; 2.Add a update message to your view. afx_msg void OnUpdateMousePos(CCmdUI *pCmdUI); ON_UPDATE_COMMAND_UI(ID_FO_INDEX_MOUSEPOS, OnUpdateMousePos) 3.Change it with the following style: void CFOPCanvasCore::OnUpdateMousePos(CCmdUI *pCmdUI) { pCmdUI->SetText(m_IndMousePosString); } Jack --------------------------------------------------------------------------------- XD++ MFC/C++ Flow/Diagram Library -- http://www.ucancode.net

    C / C++ / MFC question c++

  • Forming Grid using Rectangles
    U ucc801

    Use class CPen to create a cyan pen,such as: CPen newPen(PS_SOLID,1,RGB(...)); Then select it to DC by call SelectObject of CDC. Use class CBrush to create a red brush,such as: CBrush brush(RGB(255,0,0)); Then select it to DC by call SelectObject of CDC. Now it will be correct. Jack --------------------------------------------------------------------------------- XD++ MFC/C++ Flow/Diagram Library -- http://www.ucancode.net

    C / C++ / MFC help c++ css tutorial question

  • QT and Intellisense
    U ucc801

    Try the following steps: 1.Choose "Insert project to workspace" menu item to insert QT project file to your own project. 2.Then click "File|Save Workspace". 3.Then delete QT project from your project. Now the intellisense will works.:-D Jack --------------------------------------------------------------------------------- XD++ MFC/C++ Flow/Diagram Library -- http://www.ucancode.net

    C / C++ / MFC c++ visual-studio help

  • GetSystemMetrics(SM_CXVIRTUALSCREEN)
    U ucc801

    Don't forget to include the following codes: #ifdef _AFXDLL #define COMPILE_MULTIMON_STUBS #endif // _AFXDLL #include "multimon.h" #pragma warning (default : 4706) Jack --------------------------------------------------------------------------------- XD++ MFC/C++ Flow/Diagram Library -- http://www.ucancode.net

    C / C++ / MFC csharp visual-studio help question

  • GetSystemMetrics(SM_CXVIRTUALSCREEN)
    U ucc801

    Try the following codes: CRect rectFrame, rectView, rectChild, rcScreen; MONITORINFO mi; mi.cbSize = sizeof (MONITORINFO); if (GetMonitorInfo (MonitorFromPoint (CPoint(0,0), MONITOR_DEFAULTTONEAREST), &mi)) { rcScreen = mi.rcMonitor; } else { ::SystemParametersInfo (SPI_GETWORKAREA, 0, &rcScreen, 0); } ...... Jack --------------------------------------------------------------------------------- XD++ MFC/C++ Flow/Diagram Library -- http://www.ucancode.net

    C / C++ / MFC csharp visual-studio help question

  • Please help me
    U ucc801

    If you only need some simple drawing feature,the drawcli sample is a good start,you can find this sample with: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample/html/_sample_mfc_DRAWCLI.asp[^] But if you want a Visio like drag-drop,drawing,alignment features etc,I think you should try some third-party library,such as XD++ MFC Library,it shipps with full MFC Source Codes,and can be found with: http://www.ucancode.net Jack

    C / C++ / MFC graphics help question

  • GetTextExtentExPoint
    U ucc801

    Use the following instead of: BOOL GetTextExtentExPoint( HDC hdc, // handle to DC LPCTSTR lpszStr, // character string int cchString, // number of characters int nMaxExtent, // maximum width of formatted string LPINT lpnFit, // maximum number of characters LPINT alpDx, // array of partial string widths LPSIZE lpSize // string dimensions ); Jack --------------------------------------------------------------------------------- XD++ MFC/C++ Flow/Diagram Library -- http://www.ucancode.net

    C / C++ / MFC csharp c++ visual-studio help

  • print screen
    U ucc801

    Maybe this sample can help you: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample/html/vcsamDllScreenCapSample.asp[^] Jack --------------------------------------------------------------------------------- XD++ MFC/C++ Flow/Diagram Library -- http://www.ucancode.net

    C / C++ / MFC c++

  • Creating a dialog based application...
    U ucc801

    I think you only need some basic MFC Programming book. Jack --------------------------------------------------------------------------------- XD++ MFC/C++ Flow/Diagram Library -- http://www.ucancode.net

    C / C++ / MFC

  • Help me please,Urgent!!
    U ucc801

    From article: http://www.codeproject.com/dll/plug-in.asp#xx88311xx Serialize problem only appear with VC7.0,it works fine with vc6.0. I have been somewhat successful in trying to implement serialization for my test app. I am using a CList template to store objects. Here are a few details... Serialization works just fine for documents saved and reloaded during a given session. This includes data stored in dialog resources. This is as long as I serialize the list then walk through the list, serializing each list object. However, Serialization fails after closing the session and then reopening. In general, I am given only the {DllProxy} class (where I should be getting my dll's runtime class instead) and all other vars are mud. I AM able to successfully serialize save/load a list of the DLLProxy "pointers" themselves with great fidelity. But the Plug_Object "pointers" that they originally created are lost from session-to-session. Thanks and Best Regards

    C / C++ / MFC help com json lounge
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups