Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9064667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:18:44+00:00 2026-06-16T16:18:44+00:00

I have a MFC Application with Dialog Based. I created a GDI+ Object from

  • 0

I have a MFC Application with Dialog Based. I created a GDI+ Object from resource by using this.

MyDlg.cpp:

BOOL CSetupDlg::OnInitDialog()
{
    Gdiplus::GdiplusStartupInput gdiplusStartupInput;
    Gdiplus::GdiplusStartup(&m_gdiplusToken, &gdiplusStartupInput, NULL);
        ...
}

void MyFunction():

CGdiPlusBitmapResource* pBitmap = new CGdiPlusBitmapResource;
if (pBitmap->Load(ID_SPL_LG))
{
    CPaintDC dc(this);
    Gdiplus::Graphics graphics(dc);
    graphics.DrawImage(*pBitmap, 0, 0);
    //It is loaded . I checked with messagebox and its in here.
}
Invalidate(); //Not sure if necessary.

Now, Form/Dialog shows nothing. No image inserted nor attached.

Now, i tried few things to add this image to the dialog but i am unable to do it.

What i tried is GDIObject.Create(), CStatic.Create() and PictureControl.Create()

All i want to do is insert this image to the dialog.

Any idea or showing path is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:18:45+00:00Added an answer on June 16, 2026 at 4:18 pm

    You will need to override the OnPaint method that responds to the WM_PAINT message in your dialog. Normally you don’t need to do this because the dialog doesn’t need to paint anything, it just lets the controls that are contained on it paint themselves.

    Move the code you show into the OnPaint handler.

    Do not call the default OnPaint from your own handler.

    Do not call Invalidate from within the OnPaint handler or you will get an infinite loop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created Dialog Based application in MFC (VS 2008).When I do #include in
In my MFC dialog based application I have main menu created with Visual Studio
I have an MFC-driven dialog-based application created with MSVS2005. Here is my problem step
How can I print a document using MFC Dialog Based Application? I have made
I have a MFC dialog based application. The main dialog contain a child dialog
I have a MFC dialog based application in which I use ::system() function to
I have written an MFC dialog based application which is launched by some another
I have created a MFC SDI application, and the view is derived from CFormView,
Now I have the following MFC SDI application code,this code comes from my view
I have a dialog based MFC application through which I have to call a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.