Click here to Skip to main content
15,389,431 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Debug Assertion in Release wrong version of MFC Shared DLL Pin
Jochen Arndt25-Aug-17 2:41
professionalJochen Arndt25-Aug-17 2:41 
GeneralRe: Debug Assertion in Release wrong version of MFC Shared DLL Pin
ForNow25-Aug-17 2:54
MemberForNow25-Aug-17 2:54 
GeneralRe: Debug Assertion in Release wrong version of MFC Shared DLL Pin
Jochen Arndt25-Aug-17 3:08
professionalJochen Arndt25-Aug-17 3:08 
QuestionCreating Custom Controls in MFC Pin
Bram van Kampen23-Aug-17 14:01
MemberBram van Kampen23-Aug-17 14:01 
AnswerRe: Creating Custom Controls in MFC Pin
Rick York23-Aug-17 15:53
mveRick York23-Aug-17 15:53 
AnswerRe: Creating Custom Controls in MFC Pin
Richard MacCutchan23-Aug-17 21:11
mveRichard MacCutchan23-Aug-17 21:11 
AnswerRe: Creating Custom Controls in MFC Pin
Jochen Arndt23-Aug-17 21:47
professionalJochen Arndt23-Aug-17 21:47 
QuestionMFC - painting on a secondary modeless dialog with OnPaint() Pin
Bonobo818-Aug-17 3:52
MemberBonobo818-Aug-17 3:52 
Hello everybody,

I'm new to MFC and after passing several hours trying to solve a problem (that might seem simple to most of you), I decided to post my question here in order to get your help and hints.

I'm developing an MFC (C++) application using Visual Studio 2017. The application contains a main CDialog to communicate with a 2D Laser sensor using TCP/IP and to plot the points detected by the sensor on screen in real time (this is done on an IDC_PICTURE element with OnPaint() as the following:

// I create the pDC, memDC and the compatible device/bitmap
CDC* pDC = m_Picture.GetDC();  // m_picture is a member CStatic element in the main CDialog class 
CDC memDC;
CBitmap bmp;
memDC.CreateCompatibleDC(pDC);
bmp.CreateCompatibleBitmap(pDC, PicW, PicH); //  PicW, PicH are the width and height of the associated CRect member object in the class  

// After that, I get the points to plot in order to write them to my memDC

//then, I copy the memDC to the device and delete the memDC, release the pDC 
pDC->StretchBlt(0, 0, PicW, PicH, &memDC, 0, 0, PicW, PicH, SRCCOPY);
bmp.DeleteObject();
memDC.DeleteDC();
ReleaseDC(pDC);


This previously mentioned code is working very well without problems with the main dialog.

Long story short, my problem is the following:

On that same dialog, I created a button that opens a secondary modeless dialog that contains another IDC_PICTURE element. The main goal of the secondary dialog is to plot a delayed version (t-n) of the points seen by the Laser sensor. My main problem is that I am not being able to show anything on the secondary IDC_PICTURE. Is it wrong to do the same thing applied on the main dialog (on another IDC_PICTURE, with anothe pDC and memDC)?

The secondary dialog is defined in a separate class of which I have created an instance in the (first) main CDialog class.

I have been looking everywhere on solutions that could look similar to my problem, but I haven't found anything. What exactly am I missing?

PS. sorry if my problem description isn't clear enough. My code is getting too big to be copied/pasted.. I'd be very happy if you have any hints / questions that might make me find the solution..

Thanks in advance for your help!
QuestionRe: MFC - painting on a secondary modeless dialog with OnPaint() Pin
Jochen Arndt18-Aug-17 4:13
professionalJochen Arndt18-Aug-17 4:13 
AnswerRe: MFC - painting on a secondary modeless dialog with OnPaint() Pin
Bonobo818-Aug-17 4:31
MemberBonobo818-Aug-17 4:31 
GeneralRe: MFC - painting on a secondary modeless dialog with OnPaint() Pin
Jochen Arndt18-Aug-17 5:05
professionalJochen Arndt18-Aug-17 5:05 
QuestionRe: MFC - painting on a secondary modeless dialog with OnPaint() Pin
Richard MacCutchan18-Aug-17 4:35
mveRichard MacCutchan18-Aug-17 4:35 
AnswerRe: MFC - painting on a secondary modeless dialog with OnPaint() Pin
Bonobo818-Aug-17 4:41
MemberBonobo818-Aug-17 4:41 
GeneralRe: MFC - painting on a secondary modeless dialog with OnPaint() Pin
Richard MacCutchan18-Aug-17 6:07
mveRichard MacCutchan18-Aug-17 6:07 
QuestionError in CodeProject article "Calculating a Rich Edit Control Minimum Size" Pin
ForNow15-Aug-17 2:27
MemberForNow15-Aug-17 2:27 
SuggestionRe: Error in CodeProject article "Calculating a Rich Edit Control Minimum Size" Pin
Richard Deeming15-Aug-17 2:53
mveRichard Deeming15-Aug-17 2:53 
AnswerRe: Error in CodeProject article "Calculating a Rich Edit Control Minimum Size" Pin
Jochen Arndt15-Aug-17 3:05
professionalJochen Arndt15-Aug-17 3:05 
GeneralRe: Error in CodeProject article "Calculating a Rich Edit Control Minimum Size" Pin
ForNow15-Aug-17 3:14
MemberForNow15-Aug-17 3:14 
Questionfunction soft thresholding Pin
saidinsan00000000013-Aug-17 3:13
Membersaidinsan00000000013-Aug-17 3:13 
AnswerRe: function soft thresholding Pin
Victor Nijegorodov13-Aug-17 7:00
MemberVictor Nijegorodov13-Aug-17 7:00 
GeneralRe: function soft thresholding Pin
David Crow14-Aug-17 4:07
MemberDavid Crow14-Aug-17 4:07 
QuestionC function call question. Pin
samzcs11-Aug-17 3:18
Membersamzcs11-Aug-17 3:18 
AnswerRe: C function call question. Pin
Chris Losinger11-Aug-17 3:36
professionalChris Losinger11-Aug-17 3:36 
GeneralRe: C function call question. Pin
samzcs11-Aug-17 3:50
Membersamzcs11-Aug-17 3:50 
GeneralRe: C function call question. Pin
Chris Losinger11-Aug-17 3:52
professionalChris Losinger11-Aug-17 3:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.