|
I was trying that Ravi... but I don't know why it doesn't seem to work with my dialog boxes. Could that have anything to do with the fact that the events aren't being fired?
|
|
|
|
|
Besides writing the handler, you need to have a message map entry that will cause your handler to be invoked. Is that what you meant?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
No, I mean, the event handler is invoked and executed -- no problem with that whatsoever.
The problem is that because the dialog box is being kept active, the main frame window and the other dialog boxes don't receive any message notifications...
I wonder why?
David
PS: Could this be a dialog box-only issue?
|
|
|
|
|
Ah (again). I think a better way would be to just override WM_NCPAINT and always render the caption bar as active. This will allow the modeless dialog to become inactive when necessary, but it will appear active to the user.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
I think a better way would be to just override WM_NCPAINT and always render the caption bar as active.
And how do I do about rendering the caption bar (independently of the Windows OS version installed) ? I mean, is there a way of calling a API method to do that?
David
|
|
|
|
|
David, check out these 2 articles:/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Quote
(...) because only one window can be active at any one time in Windows. However, it has become normal practise for tool windows and main windows to appear active at the same time. I think it looks more natural this way, (...)
This is precisely how I feel and that is why I was looking (in vain) for a way to accomplish it.
Ravi, thanks a lot for those two brilliant links! You have indeed solved my problem.
Again, thanks for the time you've wasted on me.
David
|
|
|
|
|
|
Greetings,
I am currently using Microsoft Visual C++ to develop a GUI/UI for an I2C Read/Write program. Right now, I have a dialogue box implemented (a Resource file [.rc] that I included in the project). I believe I have the edit boxes working fine, where the user can enter certain parameters into blank boxes (i.e. start address, how many bytes), but the thing is, I have no way to check internal variables in my program, because there doesn't seem to be a way to "printf" values to the screen with a dialogue box.
Therefore, my essential question is: how do I output certain internal variables to the screen if I'm using a dialogue box interface? I essentially am looking for a "window" into my internal variables, maybe some type of text/edit box that continually "updates" with a new value of my internal variable - just something equivalent to a "printf" statement, but for a dialogue GUI box. Does anyone know how to do this? Any insight into this problem would be greatly appreciated.
Best Regards,
Tim Hsieh
Trex Enterprises
|
|
|
|
|
Try TRACE or search for TraceWnd.
__________________________________________
a two cent stamp short of going postal.
|
|
|
|
|
pADOLogin is never defined, which is passed into GETRS. any ideas how the compiler or the runtime know what to do with pADOLogin a.k.a. db?
CString strSQL = "SELECT * FROM Login WHERE User_Name='" + m_strUserName + "'";
BOOL bLogin = VALIDATE_USER;
GETRS(pADOLogin, strSQL, m_strUserName, this);
#define GETRS(db, sql, user, pcs) \
CDBTier db;\
OPENRS(db, sql, user, pcs)
#define OPENRS(db, sql, user, pcs) \
TRY{\
WriteToLog(sql, user, __FILE__, __LINE__);\
db.CreateDispatch("WorkFlowDBTier.DBTier.1");\
if (db.m_lpDispatch != NULL)\
{ db.Open(0, m_strDataSource, user);\
if (m_bContentStarted)\
pcs->WriteResponseDebug(sql + CString(" "));\
db.OpenRecordset((COleVariant)sql);\
}\
else\
{ WriteToLog("\r\nUnable to Create DBTier Dispatch", user, __FILE__, __LINE__);return FALSE;}\
}CATCH_ALL(e)\
{\
WriteToLog("SQL Error:" + CString(sql), user, __FILE__, __LINE__, e);return FALSE;\
}END_CATCH_ALL
<signature>
It's good to live,
Josef Wainz
Software Developer
|
|
|
|
|
Have you tried placing the cursor on pADOLogin and pressing the F12 key? This should take you to the definition.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
From the code GETRS(db, sql, user, pcs)
becomes
CDBTier db;
OPENRS(db, sql, user, pcs) // Note I have not expanded the OPENRS bit
Therefore pADOLogin is defined as a CDBTier object.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Thanks for your response. Normally functions and there prototypes require the datatype to be included in the function statement. I expected:
OPENRS(CDBTier db, CString sql, CString user, CString pcs); instead of OPENRS(db, sql, user, pcs)
Can you explain why this type of declaration isn't necessary?
<signature>
It's good to live,
Josef Wainz
Software Developer
|
|
|
|
|
In your example there isn't a function declaration it is a defined MACRO. When you use MACROs they are replaced with their associated code before compilation.
In your example I am not sure why MACROs have been declared as such. IMO they are un-necessary here. You could change the code to remove the macros and have appropriate functions to do the work for you.
I feel that it would be easier to maintain and understand if you made such changes. Not just for yourself, but for others that may need to maintain the code in future.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Is there an Windows API that I can use to extract the server's comment? For example, given server name //server1, I need its comment, such as Dave's fastest PC.
Thanks.
|
|
|
|
|
Sure, just use NetServerGetInfo(_T("\\\\server1"), 101, ...) .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Does anyone know a good way to determine if a CWnd* represents a group box?
Joel Holdsworth
|
|
|
|
|
Group boxes are button controls with the BS_GROUPBOX style flag set.
So, the easy way would be to use the CWnd pointer to get the style flags (CWnd::GetStyle ) and see if the DWORD contains BS_GROUPBOX. If it does, then it's a group box.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Yes but I seem to get "false positives" on things like static controls which also have the same flag set, but with different context... any ideas?
Joel Holdsworth
|
|
|
|
|
GetClassName should help you out. IIRC, you're looking for the class "BUTTON".
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
How are you checking for the BS_GROUPBOX style?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
yes, but I seem to get some control's (like statics) which have that style set even though they are of course not groupboxes!
Joel Holdsworth
|
|
|
|
|
But are you checking for that style using the equality operator or the bitwise AND operator? It makes a big difference.
Otherwise, you'll also need to compare the class name as has already been suggested.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
AFAIK I'm using the & operator.. although I don't have code in front of me to check it.
Joel Holdsworth
|
|
|
|