GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 17-Oct-2009, 11:40
timbk timbk is offline
New Member
 
Join Date: Oct 2009
Posts: 1
timbk is on a distinguished road

How to draw in a dialog's client area, but from an event occurred in another dialog?


Hello, I hope that somebody can help me, the thing is this:
the context: my application has one main dialog and one non-main dialog.
the question: When I press a specific button in the non-main dialog, a line has to be drawn in the client area of the main dialog. how can I do this?

Actually I have a method declared as public and defined in the main dialog class (an instance from Cdialog let's say) to draw my lines, this is the method:

CPP / C++ / C Code:
void CCalibracionDlg::BorrarRecta(int Rx,unsigned char D_Ry, unsigned char Vref)
{

CClientDC pDC(this) ;
float tgAng=0,Ry=0;			// float porque estas variables tienen cocientes		
int  x = 0 , y = 0 ,y_=0;	// int porque pueden ser mayor q 255
char multiplo=0;
unsigned char indice_recta=0, y_RectaVieja[300]; // con char alcanza
unsigned int pixel=0, PixelRectaVieja[300];		// int porque son de 32bit
pDC.SetWindowOrg(-168,-165);				// seteo el origen de coordenadas a ese punto, q es el centro de la grilla
.
.a lot of code that it isn't important for this issue
.
}
Of course when i use this code within the main dialog it works fine, the lines are drawn in the client area of the main dialog, but how can i do to use this code to draw in the client area of the main dialog when i press a button in the non-man dialog? .
Thanks in advance, let me know if you need more information.
Last edited by LuciWiz : 17-Oct-2009 at 13:42. Reason: Please insert your C++ code between [cpp] & [/cpp] tags
 
 

Recent GIDBlogAccepted for Ph.D. program by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
wxWidgetsSample Allan C++ Forum 2 20-Mar-2009 20:17
I have a program that I wrote in Java and need it converted to C++. It is a Go Back N dinyar C++ Forum 2 05-Apr-2008 10:44
Cannot draw things in the draw area shitao1201 FLTK Forum 2 13-Nov-2007 06:14
Help! Some basal questions about MFC xutingnjupt MS Visual C++ / MFC Forum 1 05-Dec-2004 04:38

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 17:11.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.