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. Dialog based application with background

Dialog based application with background

Scheduled Pinned Locked Moved C / C++ / MFC
questioncsharpvisual-studiolearning
5 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.
  • R Offline
    R Offline
    Rostfrei
    wrote on last edited by
    #1

    Hello! I make simple dialog based programs. I make them with resource editor VS.NET 2003. When I create dialog it is grey. After I put some other controls on it. What is the easiest way to make Dialog based application with some background of some predefined background (picture)? Instead of grey there would be some picture. Best regards, Rostfrei

    H 2 Replies Last reply
    0
    • R Rostfrei

      Hello! I make simple dialog based programs. I make them with resource editor VS.NET 2003. When I create dialog it is grey. After I put some other controls on it. What is the easiest way to make Dialog based application with some background of some predefined background (picture)? Instead of grey there would be some picture. Best regards, Rostfrei

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      Hi Rostfrei , if you need to paint dialog use WM_CTLCOLOR and if you want to draw picture I suggestion that use picture's in the WM_PAINT and the use handle dc

      1 Reply Last reply
      0
      • R Rostfrei

        Hello! I make simple dialog based programs. I make them with resource editor VS.NET 2003. When I create dialog it is grey. After I put some other controls on it. What is the easiest way to make Dialog based application with some background of some predefined background (picture)? Instead of grey there would be some picture. Best regards, Rostfrei

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        include ->atlImage.h //in h file CImage m_Image;//in h file m_Image.Load("c:\\picture.bmp");//[in the OnInitDialog(example)] in function Onpaint CPaintDC dc(this); // device context for painting m_Image.BitBlt(dc.m_hDC,CRect(0,0,800,600),CPoint(0,0));

        R 2 Replies Last reply
        0
        • H Hamid Taebi

          include ->atlImage.h //in h file CImage m_Image;//in h file m_Image.Load("c:\\picture.bmp");//[in the OnInitDialog(example)] in function Onpaint CPaintDC dc(this); // device context for painting m_Image.BitBlt(dc.m_hDC,CRect(0,0,800,600),CPoint(0,0));

          R Offline
          R Offline
          Rostfrei
          wrote on last edited by
          #4

          When I include atlImage.h I get many errors like: LIBCMTD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(dbgheap.obj) : error LNK2005: _free already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __cexit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __c_exit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj) and so on... What shoild I do? Rostfrei

          1 Reply Last reply
          0
          • H Hamid Taebi

            include ->atlImage.h //in h file CImage m_Image;//in h file m_Image.Load("c:\\picture.bmp");//[in the OnInitDialog(example)] in function Onpaint CPaintDC dc(this); // device context for painting m_Image.BitBlt(dc.m_hDC,CRect(0,0,800,600),CPoint(0,0));

            R Offline
            R Offline
            Rostfrei
            wrote on last edited by
            #5

            It works!!! I can't thank you enough!!! To resolve linkage problem I had to Ignore specific library: libcmtd.lib The problem is described on http://discuss.microsoft.com/SCRIPTS/WA-MSD.EXE?A2=ind9710a&L=atl&P=5867[^] in project settings. Now it works just as I wanted. Ah yes, for anyone else reading this you have to include #include before #include like: #include "afxstr.h" #include "atlimage.h" Thank you! Regards, Rostfrei

            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