|
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
|
|
|
|
|
Nilesh Korpe wrote: Where can I find good info on casting
This is C style casting and you won't find a lot of information about that, simply because it is a simple principle: you just 'transform' a variable type into another. What don't you understand here ?
Anyway, if you want a good article on C++ casting, I suggest this one[^] but I think it's no really what you are looking for.
|
|
|
|
|
Cedric Moonen wrote: suggest this one[^] but I think it's no really what you are looking for.
Managed in Unmanaged Forum
"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
|
|
|
|
|
These casting operators are C++ standard
|
|
|
|
|
This basically is "saying" the following:
"Regardless of the type of the variable m_pDlg points to treat it as if it was a CEchoServerDlg ; call the OnAccept method through this pointer."
This will obviously cause problems if you cast an object into something its not.
For example:
CRect rc;
CRect *pNotAWindowAtAll = &rc;
DWORD dwStyle = ((CWnd*)pNotAWindowAtAll)->GetStyle();
This code will compile and run. At best it will crash at runtime and at worst it will not: it will not work correctly and it makes no sense whatsoever. A C-style cast like this just pretends that a CRect is a CWnd but the two classes are not related and it will end in tears. A cast like that is saying to the compiler, "just do what I say".
I often go on about this, but in my opinion (and that of most modern C++ programming books) the C-style cast has no place in modern C++ code. You should use something like this instead:
static_cast<CEchoServerDlg*>(m_pDlg)->OnAccept();
A static_cast will limit the type of cast. It will only cast between related classes, perform standard conversions and call user defined conversion operators. If used in my "bad code" example it will not compile - this is good: nonsense shouldn't compile.
Steve
|
|
|
|
|
If user create's some Button controls dynamically using create and assign them some perticular function and settings,how to reload this settings after restarting the application.Because If I restart the application all the dynamic controls will be lost.
Nilesh Korpe
|
|
|
|
|
Nilesh Korpe wrote: how to reload this settings after restarting the application
Simply save the data in a file and load the data at application startup.
|
|
|
|
|
Thank you
I think that is the only solution ,
Nilesh Korpe
-- modified at 4:19 Thursday 11th May, 2006
|
|
|
|
|
I checked many functions to do the same but i could not... i want the help to copy a folder and a file to another folder using a FTP connection... can any one help to do the same...awaiting your reply
|
|
|
|
|
|
i tried it but unable to copy a file in the specified folder.pls send me example if possible.
|
|
|
|
|
|
PLease see MSDN:
CInternetSession and
CFTpConnection
CFtpFileFind
You will get everything in MSDN with the samples....
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Hi,
Is there any way to set the backgroud as an Image to a Dialog?
|
|
|
|