|
i am using two class
i want to update the CEdit of dlg form different clas
xyz
{
//non MFC Class
extren CEdit *ed
SetEditText()
{
ed->SetDlgItemText(IDC_EDIt1,"Waiting for Call");
ed->UpdateData(FALSE);
}
----
---
--
};
dlg
{
//MFC class
CEdit *ed;
//m_ed is member variable IDCEDIT1 control
oninitdlg()
{
ed=*m_ed;
}
onbutton1()
{
x->setEditText() // x is an instance of xyz
}
----
---
--
};
and also i tried using
((CIVRTraficInfoSystemApp *)AfxGetApp())->m_pMainWnd->SetDlgItemText(IDC_EDIT1,"Waiting for Call");
and
in xyz class
CIVRTraficInfoSystemDlg *dlg;
dlg=(CIVRTraficInfoSystemDlg *)::GetActiveWindow();
// dlg->m_ed2.SetWindowText(IDC_EDIT2,"Waiting for Call");
//dlg->UpdateData(FALSE);
// dlg->UpdateDialogControls(((CIVRTraficInfoSystemApp *)AfxGetApp())->m_pMainWnd,TRUE)
//dlg->UpdateWindow();
and i also tried the following
from xyz class
SetDlgItemText (AfxGetApp ()->m_pMainWnd->m_hWnd, IDC_EDIT2, "some thing");
//delete [] lpBuffer;
UpdateWindow (GetDlgItem (AfxGetApp ()->m_pMainWnd->m_hWnd, IDC_EDIT2));
but i am not able to update the text in the IDC_EDIT1
pls suggest me some idea
Thanks & Regrads
kattavictor
|
|
|
|
|
You can use:
class CXyz<br />
{<br />
public:<br />
CEdit* m_pEdit;<br />
void SetTheText()<br />
{<br />
m_pEdit->SetWindowText("Hello");
}<br />
<br />
};
//here, m_Xyz is a member variable of CMyDialog, an object of CXyz.
void CMyDialog::OnButton1()<br />
{<br />
m_Xyz.m_pEdit = &m_Edit;
m_Xyz.SetTheText();<br />
<br />
}
this is this.
|
|
|
|
|
Dear Khan
Thanks u very much for ur reply
int CLSINet::WaitForCall()
{
//here i would like to set the CEdit text, ie.. non MFC Class
//because the control is not going to return back immd.
//to the MFC Class
int rc;
module = "CLSINet::WaitForCall";
LogEntry("Enter", LOG_OBJFUNCTION);
ed->SetWindowText("Waiting For incomming call");
---
---
--
}
pls given me an idea for this
Thanks & Regrads
kattavictor
|
|
|
|
|
WaitForCall() will be called form another non MFC class
not form the dlg
kattavictor
|
|
|
|
|
I am not sure what you are trying to acheive, but I think it is this:
To set the m_pEdit to the actual variable's address, you can do it when creating the control. Like:
class CMyDialog : public CDialog<br />
{<br />
public:<br />
CXyz m_Xyz;<br />
...<br />
...<br />
};<br />
<br />
CMyDialog::OnInitDialog()<br />
{<br />
m_Xyz.m_pEdit = &m_Edit;
}
Now the pointer is set, and there is no need to set it again. Now any function in CXyz can set the edit's text, like:
void CXyz::SetNewText()<br />
{<br />
m_pEdit->SetWindowText("asdf");<br />
}
Your question is not clear, so:
Are you using multi-threading? If no, then learn some multi-threading, and use threads, so the program won't freeze while it is processing.
this is this.
|
|
|
|
|
thanks for u reply
ya i understood
i am not useing multi threading
it is compiled with our errors
but CEdit box is not update with text
i dont know why ?
Thanks & Regrads
kattavictor
|
|
|
|
|
You can put breakpoints in the code and watch the code set the text in the edit. While stepping through the code, you can check if the edit's pointer is valid etc.
this is this.
|
|
|
|
|
ya i did that also
it is getting hangged
before OnButton()
if i remove CEdit form the class and inil. the pointer
everything is ok except setting the CEdit text(it is not hanged)
i dont know why
Thanks & Regrads
kattavictor
|
|
|
|
|
Hi
I need to get the current logged in USERNAME ID and also the Outlook profile user name. How can i get it
Regards
Anniyan
|
|
|
|
|
cuteanniyan wrote: I need to get the current logged in USERNAME ID
Is GetUserName() api is of any help!
"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
|
|
|
|
|
Thanks Alok...It worked out!!!!!11
|
|
|
|
|
i have test the program winmacro(http://www.codeproject.com/tools/winmacro.asp) but i find sometimes it does not work stably in windows xp platform. SomeTime is stops in playing back , but when i move my mouse manually it resumes to go.Can anyone tell the reson?
|
|
|
|
|
I have a problem using CDateTimeCtrl. When I choose a date using the DatePicker, the OnChange function associated with the CDateTimeCtrl was called twice, but if I enter a date using the keyboard it was only called once. I hope you could help me on my problem.
|
|
|
|
|
hi all..
i have used memory dc for drawing some images in VC++..
can any one tell me wat are all the major advantages of Memory DC plz..
Thanks,
vj
vj
|
|
|
|
|
By using a Memory DC you can prepare the image in memory and then in your WM_PAINT handler you can use BitBlt for a fast copy to the Screen DC. This way you avoid the anoying flicker when working with complex drawings.
|
|
|
|
|
That's not always enough to get rif of the flicker. You also need to stop erasing of the background, if the window class has a background brush set.
--
The Blog: Bits and Pieces
|
|
|
|
|
How to manage Accelerator key when a modeless dialog os activated ?
My application use the F5 key as an accelerator defined at Mainframe level to open or close the modeless dialog.
Unfortunalty when the modeless dialog is activated and has the hand, key events are no more processed, nor accelerators. So F5 key has no effect.
Thank's in advance for your help;).
NKH at jean-marc.nakache@neuf.fr
|
|
|
|
|
hi i m new to vc.net environamnet but worked in 3 projects using vc++6.
i had created the mfc application(dialog based) in .net
now i want that this application should respond to key down messge.
is there is no wizard present in .net environamnet as classwizard in
vc++6 to handle the messages or do it manually.
how to do this (add keydown message to application in .net)
ddd
|
|
|
|
|
Highlight your classname and go to properties Tool window. There you can set Events, Overrides and Messages etc.
|
|
|
|
|
Hi
I am writing a WMI application to monitor the file system events in my system.i had converted the query given in http://www.microsoft.com/technet/scriptcenter/resources/qanda/apr05/hey0404.mspx" into a WQL in c++. But i am getting an error message Query execution failed. Can anyone help me in this regard.
Is it possible to monitor the entire system for file system changes using WMI ?
|
|
|
|
|
Dear Experts,
I need some information on dynamic updation of XML file.
Our application asks the user to insert a file by giving the user browsing option.
We want our XML file (which contains the information about the residing files) to be dynamically updated as soon user specifies the path of the inserted file.
The next task is to dynamically update the XML file once the user select the file to be deleted by clicking on the Application UI.
We have to develop the code in C++.
Kindly send across your suggestion, opinion and helpful codes.
Regards,
Mayank Srivastava
|
|
|
|
|
You're basically talking about using the XML DOM, I would have thought. If you're not doing this already, how do you read/write your XML files ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Just do it like you do it with any other file - fopen(), fread(), fwrite(), fclose(). If that's vanilla C++ you want of course.
--------------------------------
Human stupidity is infinite.
|
|
|
|
|
Hello
I suggest you considder to use a SAX parser. SAX has less memory (and CPU) overhead than DOM.
If you use MSXML, there are plenty of samples at MSDN.
Kakan
|
|
|
|
|
Alex Orovetskiy wrote: If that's vanilla C++ you want of course.
Actually, no. You're telling him to do it in C. I would hope that most people using C++ would never use these functions.
Christian Graus - Microsoft MVP - C++
|
|
|
|