|
|
HI,
I HAV created a dialog box in which i have placed a static text control.
I have created one more dialog box say dialog2 in which i have a button control.
i want to bring dialog2 in to the static text control of first dialog and need to how to access the button control in dialog2 inside the static text control of dialog1.
plz let me know immediately,
thnx
zari
|
|
|
|
|
Send a message with SendMessage to the other dialog, process that message in the other dialog.
If you want to do it cleaner, you can use a registered message.
Hope this helps.
|
|
|
|
|
if we suppose CMain is dialog1 and Local is dialog2 you can use CMain *m_Main=(CMain*)GetParent(); m_Main->m_StaticControl
|
|
|
|
|
Having a dialog interact with controls it does not own is a bad design. Post a message to the second dialog instead.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
zareee wrote: want to bring dialog2 in to the static text control of first dialog and need to how to access the button control in dialog2 inside the static text control of dialog1.
plz let me know immediately,
Interprocess communication would be good. try http://www.codeproject.com/threads/#Inter%2DProcess+Communication[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I've built an SDI application without problems, adding classes. When I've linked a thirdy party library i've had to change compiler switch from Multithreaded (/MT) to Multithreaded DLL (/MD) and adding the _AFXDLL symbol to properly compile the entire project. The project is linked with the shard version of MFC.
When the application exits, i've noticed a lot of memory leaks and that classes destructors are not invoked (CView derived class and CMainFrame destructors are invoked, but CDocument destructor and other
classes destructors are not invoked).
I can't understand the causes of this problem and if the /MD compiler option is one of them.
Any idea ?
|
|
|
|
|
Take a look at where and how you create an instance of the class. The probable cause is that you have created an instance somewhere with the keyword new, and you are failing to call delete. If that class has other classes as members, their destructors will in turn fail to be called.
|
|
|
|
|
Dear all
I Write one class in Visual C++ which is responsible for logging of stream data.
This Class is used in a dll which is used to contact to hardware.
I want to enable the logging capability in some special times.
But Because this class is used in a dll file, I can not access it via keyboard or mouse. (I dont access the program that uses my dll.)
thus I need an interface to inform my class to enable or disable logging process.
for an example I can create a file in a special place, and my class check the existence of that specific file as a sign of logging permission.
But this solution is not professional.
Thus please send me your idea about this problem.
Thanx in advance
Mahdi
|
|
|
|
|
Depends a lot of how you 'use' your dll. Is this class exported by your dll ? If yes, simply treat exactly the same way as if it was part of your application (so, add a function in the class to enable or disable the logging). If it is not exported, you can still export a function in your dll that will allow to enable or disable the logging.
|
|
|
|
|
m_monhi wrote: But Because this class is used in a dll file, I can not access it via keyboard or mouse. (I dont access the program that uses my dll.)
Can you explain this? To able to use your class that logs. There should be some application that uses it?
|
|
|
|
|
m_monhi wrote: This Class is used in a dll which is used to contact to hardware.
Can you modify the EXE that uses your DLL?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi,
i have a static text control in a dialog box ,how to find the dimensions of the static text.
thanx in advance,
zari
|
|
|
|
|
CRect rc;
GetDlgItem(IDC_STATIC_TEXT)->GetWindowRect(&rc);
Jesus loves you. But I'm his favorite.
|
|
|
|
|
i am getting an error by placingbthe given lines o9f code in ONINIT of my dialog.
can ne 1 help me???
zari
|
|
|
|
|
have you given the static control an ID the defailt is IDC_STATIC change that to something else and use that instead of IDC_STATIC_TEXT
Jesus loves you. But I'm his favorite.
|
|
|
|
|
YES i hav used the same ID in that place but it doesnt work out.wen i use control tab the PARAMETER idc_static IS NOT PRESENT IN THE LIST.
zari
|
|
|
|
|
zareee wrote: ...idc_static IS NOT PRESENT IN THE LIST.
It's not supposed to be. That's why it's a special ID.
Why can't you just give your static control a different ID?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
if you have a variable for static control use CRect rect;m_Static.GetWindowRect(&rect);
|
|
|
|
|
WhiteSky wrote: you have a variable for static control use CRect rect;m_Static.GetWindowRect(&rect);
for adding Variable to static control you have to Change It's Special ID IDC_STATIC to something else
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I know what problems?
|
|
|
|
|
WhiteSky wrote: I know what problems?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
zareee wrote: i have a static text control in a dialog box ,how to find the dimensions of the static text.
for adding Variable to static control you have to Change It's Special ID IDC_STATIC to something else, after changing id of static control from properties window.. follow advice from White Sky
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
I am working on one CAD application. Application is developed in MFC with document view architeture. In my application there are different views of same geometry object. Views are like FRONT, BACK, TOP etc. Now I want to print all view on same page. In this case TOP view should be in center and all other views should be on different side of TOP view. Is this possible in MFC and if yes then how?
Thanks & Regards,
Kalpesh
|
|
|
|
|
Hi everybody,
in a CFormView i like to catch the CTRL and Down-Key if i'm at the Grid...
Exists a special key-code for this combination? So that i can catch it over the KeyDown-Event ?
Or only over Accelerators ( But Accelerators working with the MainFrame )
Thanks
|
|
|
|