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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. MFC dialogs without a resource.

MFC dialogs without a resource.

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++learning
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Janovetz
    wrote on last edited by
    #1

    Hello- I would like to build an interface with dockable pieces to it. These pieces probably most closely resemble a dialog box. That is, they have several controls as components. I would like to construct the pieces by code -- without the dialog editor. I'm quite new to all of this, so I may be attacking this the wrong way, but I am looking at the CDialogBar class which is at least a start for dockable dialogs, but doesn't allow creation without a resource ID. Is there a better approach? How can I create a CDialogBar without a resource ID?

    J 1 Reply Last reply
    0
    • J Janovetz

      Hello- I would like to build an interface with dockable pieces to it. These pieces probably most closely resemble a dialog box. That is, they have several controls as components. I would like to construct the pieces by code -- without the dialog editor. I'm quite new to all of this, so I may be attacking this the wrong way, but I am looking at the CDialogBar class which is at least a start for dockable dialogs, but doesn't allow creation without a resource ID. Is there a better approach? How can I create a CDialogBar without a resource ID?

      J Offline
      J Offline
      John Silvester
      wrote on last edited by
      #2

      hi, Its good that i experienced the same problem. And found the solution for myself. This really works: Here is the header file : class cSmithChart:public CDialog { public: int m_iChartSize;int m_iLineColor; cSmithChart(); ~cSmithChart(); void drawSmithChart(); afx_msg void OnPaint(); DECLARE_MESSAGE_MAP() }; The implementation file : cSmithChart::cSmithChart():CDialog() { DLGTEMPLATE *tmplate = new DLGTEMPLATE[4]; DLGTEMPLATE tmpl; tmpl.cdit=0; tmpl.style=DS_NOFAILCREATE |WS_CAPTION | WS_SYSMENU; tmpl.x=0; tmpl.y = 0; tmpl.cx = 500; tmpl.cy = 500; tmpl.dwExtendedStyle=0; tmplate[0] = tmpl; tmplate[1].style=0; tmplate[1].dwExtendedStyle=0; int nresult = InitModalIndirect(tmplate,NULL);; if( nresult == 0) { int error = GetLastError(); AfxMessageBox("Dialog Creation Failed"); } }; cSmithChart::~cSmithChart() { }; BEGIN_MESSAGE_MAP(cSmithChart, CDialog) ON_WM_PAINT() END_MESSAGE_MAP() void cSmithChart::OnPaint() { CDialog::OnPaint(); drawSmithChart(); } void cSmithChart::drawSmithChart() { //Draw the smithchart } AS you could see i solved this for drawing a smithchart, which was a distributed .Lib file.. This is a production code. See if it works for you. Good Luck. John Silvester A Asst. Manager -Projects, SRA Systems Ltd., Chennai India

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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