|
You only need to show some parameters value in a string for example ? Then it is much easier to go for a simple MessageBox.
Here is how you can do that (let's say that you want to show the values of Param1 and Param2 wich are both integers):
char szString[255];
sprintf(szString,"Value of Param1: %i, Value of Param2: %i",Param1,Param2);
MessageBox(szString);
(I suppose you put this code in a class derived from CWnd).
Take a look at the doc of sprintf[^] for more details.
|
|
|
|
|
mmm
then you need this:
<br />
CString String;<br />
int N=5;<br />
String.Format("parameter1 is: %d", N);<br />
AfxMessageBox(String);<br />
|
|
|
|
|
wouldn't that print out : parameter 1 is=5 ?
i need the real value of param 1
|
|
|
|
|
|
Do we have any SDK to get the charset for the current language OS?
I have an application which will dyanmically generate the html file and display. I have a requirement where if I am displaying the html in the Japanese OS, I should mention japanese charset in the content info of HTML file.
Thanks in advance.
Sandeep
|
|
|
|
|
My application is reading data from serial port. But the data may arrive at any random time. So i want to interrupt the application when data arrives on the serial port. Can anybody suggest me some solution to this problem.
aasstt
|
|
|
|
|
You won't be able to use hardware interruptions in your program (and it's bad design also ). A better solution is in general to spawn a thread that will poll the serial port for data. A good design for doing that is starting this thread in a separate class that will send a message to your application when data is available (custom message). This may sound 'complicated' but if you don't want to freeze your GUI, it is the best way of doing that.
|
|
|
|
|
Cedric Moonen wrote: to spawn a thread that will poll the serial port for data.
From my experience in the past, polling eats processor resource even though we have added something in the loop in the thread like Sleep(1) .
Personally I prefer to feed an event to the serial port API, and use WaitForMultipleObjects or WaitForSingleObject ...
Cedric Moonen wrote: This may sound 'complicated' but if you don't want to freeze your GUI, it is the best way of doing that.
Yes this is so true! Basically all those communication related applications have to be designed in multi-threading to prevent from GUI frozen.
Maxwell Chen
|
|
|
|
|
Use Overlapped I/O and WaitForSingleObject
|
|
|
|
|
http://www.codeproject.com/system/simpleserialcomm.asp
http://www.codeproject.com/system/cserialport.asp
"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
|
|
|
|
|
Is pTmpl initialized? In your example there isn't any init.
if yes what about pTmpl->UpdateAllViews(NULL); ?;)
|
|
|
|
|
Now again question is hide
|
|
|
|
|
I hope that the author isn't desappeared like the message (and that my resp solved his problem;))
|
|
|
|
|
me too
|
|
|
|
|
How can i understand the child window which i got is of child dialog?
i did this to get the child.
CWnd* pWnd = GetWindow( GW_CHILD );
i want to know if pWnd is of child dialog?
ajeesh c v
|
|
|
|
|
I'm not sure that I understand your question, but I think that if you want to know what kind of object is pointing pWnd you could use
if(! pWnd ->IsKindOf(RUNTIME_CLASS(CChildClassName))){;)
//Error
}else{
...
}
|
|
|
|
|
Hope I understood your question
see IsChild[^]
and CWnd::IsChild
|
|
|
|
|
i got the child window using CWnd* pWnd = GetWindow( GW_CHILD );
but the pWnd i got is of the edit control of the parent dialog.
i need to get only the pWnd of child dialog and not of child controls.
ajeesh
|
|
|
|
|
Use pWnd=pWnd->GetNextWindow() in a while loop and exit when the pWnd points the right object.
|
|
|
|
|
Ajeesh c v wrote: i want to know if pWnd is of child dialog?
Do you wish to check pWnd is a Child dialog or pWnd is a child of a dialog.
Use GetParent to find out the parent and then use GetClassName to find out the class.
You can also refer GetParentOwner .
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
What he need is to check whether a window ( got from hWnd ) is a dialog window or a child control ( means edit, static, etc. )
- NS -
|
|
|
|
|
Ajeesh c v wrote: CWnd* pWnd = GetWindow( GW_CHILD );i want to know if pWnd is of child dialog?
what about GetParent(..) api!
"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
|
|
|
|
|
((CEchoServerDlg*)m_pDlg)->OnAccept()
Nilesh Korpe
|
|
|
|
|
Nilesh Korpe wrote: ((CEchoServerDlg*)m_pDlg
This is simply a casting: the m_pDlg variable (stored probably as a CDlg* pointer) is casted to the type CEchoServerDlg so you can access functions defined in that class.
Then, with this casted pointer, you call the OnAccept function of the class.
|
|
|
|
|
Where can I find good info on casting I think I am always confused with it.
Sara
-- modified at 4:27 Thursday 11th May, 2006
|
|
|
|