|
David Wulff wrote:
The problem with that is that it doesn't work for any more than the windows children (i.e. no grandchildren, etc).
Huh... I was going by MSDN, which says:Indicates whether the window specified by pWnd is a child window or other direct descendant of CWnd. A child window is the direct descendant of CWnd if the CWnd object is in the chain of parent windows that leads from the original pop-up window to the child window.
[edit]
Oh wait, I think I mixed up owner windows with child windows. NM
--Mike--
http://home.inreach.com/mdunn/
Help! Help! I'm being repressed!!
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
In my head that was approaching it from the wrong angle - of course, my head isn't always right.
I read the documentation as meaning that I needed to supply the child window, but thinking about what you wrote again, of course it should work because GetFocus() would be a child (if not another window).
I believe the phrase goes something like "D'oh"...
________________
David Wulff
http://www.davidwulff.co.uk
"I loathe people who keep dogs. They are cowards who haven't got the guts to bite people themselves" - August Strindberg
|
|
|
|
|
If you want to start from the child window, why not handle the WM_SETFOCUS message in the child. When the child get's the focus, it notifies it's parent window, which would relay the message up to the top window.
I'm still guessing
---
It may be that your sole purpose in life is simply to serve as a warning to others.
|
|
|
|
|
Ah ha, I found what the problem was. Originally, one of the things I tried was:
IsChild(GetFocus())
but it didn't appear to be working correctly. However, it would seem that it was, but because for some strange reason one of the child window types is using the CBaseWnd's parent as it's parent (necessarily done), thus it was not a child of CBaseWnd, thus IsChild() returned false.
I fixed this by using:
GetParent()->IsChild(GetFocus())
instead.
Cheers. I can put the coke cans back now as I wont be needing them tonight.
________________
David Wulff
http://www.davidwulff.co.uk
"I loathe people who keep dogs. They are cowards who haven't got the guts to bite people themselves" - August Strindberg
|
|
|
|
|
I have very simple template. When I put declaration of
this template in header file and realization in cpp file then
I have got problem on link stage. Linker said that it can not
find constructor and destructor of my template.
When I placed both declaration and implementation in header
file then evrything started work.
What is the reasin of such situation?
Thanks in advice for help.
|
|
|
|
|
Maxym wrote:
What is the reasin of such situation?
That's a limitation of VC. All template code must be visible to every translation unit (CPP file), so the code has to go in a header file.
--Mike--
http://home.inreach.com/mdunn/
Help! Help! I'm being repressed!!
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Thanks for help!
|
|
|
|
|
A limitation of VC? I don't think so. That's how all compilers work with templates. Since the compiler doesn't generate any code until you explicitly create a type from the template, the code for the template must be readily available to the compiler. If the code is inside some CPP, the compiler can't access it and thus cannot generate the appropriate code for the new type.
That's my understanding of why template code has to be inside header files. It's always been this way for UNIX compilers as well.
Regards,
Alvaro
|
|
|
|
|
I have a Menu (IDD_MENU1) and 2 Dialogs (IDD_DIALOG and IDD_DIALOG1). The menu has an item that will go to IDD_DIALOG1 from IDD_DIALOG when clicked. How can I make this possible?
Menu1:
-----------------------
File___________Launch
--About_______--Dialog1
--Exit
-----------------------
And I am VERY new to this
------------------------------
I love Yuzu-Chan! =P
Have u eaten ur chicken 2day?
|
|
|
|
|
Hi. I want to enable users to search my web site (Win2k IIS). My database is MS Access 2000. I can connect to it using ASP and query/update/delete. My problem is that I don't know how I could configure my database to search through my site. My solution so far was to copy the content of each page and put it into a seperate table in my database, and then have the ASP page do a SELECT * in the SQL language. The problem is that MS Access only allows 250 characters in each text table so you can see that this won't work. I would like it if some Guru could point me in the right direction with their brilliant ideas. If you provide me with any help I will hold you in the highest regard and kiss the ground three times in your honor. Thank you in advance
|
|
|
|
|
If you use the Memo type instead of Text, you can store up to 65,535 characters.
Jon Sagara
"Ninety percent of baseball is mental, the other half is physical." -- Yogi Bera
|
|
|
|
|
I did some digging around in the registry. It looks this data is stored in HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics\MessageFont as a LOGFONT (with something extra?). I only have access to NT4 and WinME so I cannot confirm if this is consistent across all platforms. Without yelling, "But that is undocumented!" all at once could a few people check their registry to see if this is true and if it is do you think I should use it?
|
|
|
|
|
I've got Win2K and this key does exist on my machine.
"das leid schlaft in der maschine" -Einstürzende Neubauten
|
|
|
|
|
|
I'm using the RichEdit v3 control in my MFC SDI app. But I'm bypassing the the normal CRichEditCtrl's undo functions and using EM_UNDO/EM_REDO to provide multi-level undo. However, when I save my document, the undo buffer disappears. Does anyone have any idea what might be causing this and/or a possible way around it? Thanks in advance
--
Peace,
Amit Jain
|
|
|
|
|
Hi,
In MDI application, if you have a button in toolbar with ID
"ID_WINDOW_TITLE_VERT" or "ID_WINDOW_TITLE_HORZ", you can re-order
child windows by click this button. you don't need do anything just
assign the ID to to your button. does anyone know what are messages
asscoicate those two IDs? because I want to create a MDI application,
allow user open multi-windows at one time and all child windows
automatically ordered horizantally or vertically.
Thank you in advance.
|
|
|
|
|
|
Where can I find an article (maybe some source code?) about file compression?
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
|
How can I create a dialog/window without taskbar icon (or how to hide it)?
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
|
|
This is regarding a class called CArchive provided with MFC.
There are some overloaded operators "<<" and ">>" for inseration and
extraction in class CArchive.
One of them is:
friend CArchive& operator <<( CArchive& ar, const CObject* pOb );
The question is why the above operator is friend function???
The inseration and extration operators for the CObject class have been
defined as global friend functions whereas the same extraction and inseration
operators for basic data types such as int, float etc have been defined in
the CArchive class itself.
Why such a design? The CArchive class does not access any private or
protected memeber variables of the CObject class. Hence the query.
The source code is written as:
friend CArchive& operator<<(CArchive& ar, const CObject* pObj)
{
ar.WriteObject(pOb);
return ar;
}
and
CArchive::WriteObject()
{
/// .....lots of code but no private variable of CObject accessed
((CObject*)pOb)->Serialize(*this);
}
The is no accessing of private variables of CObject in any place.
Then why the << operator is a friend function??
I will be greatly obliged anyone could answer my query.
Prateek Kaul
Centre for Development of Advanced Computing (C-DAC),
Pune,India
|
|
|
|
|
Hi.
I was wondering if there any any sources and information etc for people programming for industrial systems. By this, I mean accessing IO (Digital/Analog) and connecting to PLCs ...
I know there are many manufacturers sites but I have found nothing that really does justice to programming in industrial based environments (like Labview etc)
|
|
|
|
|
Hi. I have a backround thread function that I need to call many times to do calculations. I was wondering if it is OK for me to call AfxBEginThread time after time without knowing if the first call to it has finished? The calculations may take a while and I could need another thread to do another calculation using the sanme function. I made a test program and it does not seem to work.
If the above does not work, can someone suggest something that does work so that I could definitely have more than one thread going using the same thread function.
Thanks
|
|
|
|