|
Pass a '0' or a NULL-String ("") i.e. two double quotes with nothing in between, to the RegSetValueEx()'s lpValueName parameter.
The hKey value should be an open key or one of the "default" root keys such as HKEY_CLASSES_ROOT, HKEY_CURRENT_USER etc.
Bikram Singh
|
|
|
|
|
here take a small example:-
you have to give the value to defualt value of Archer key presents in following path.
HKEY_CURRENT_USER\Software\Archer
Now Here is Code:-
CRegKet a;
a.open(HKEY_CURRENT_USER,"Software\\Archer");
a.SetValue("Archer","");
a.Close();
this will do it for you.
-----------------------------
"I Think It will Work"
Formerly I AM Known As "Alok The Programer"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello there!
Again I have a question for those of you out there... And this time it is all about 5 windows (modeless dialog boxes) I have being displayed at a certain point in time in my SDI MFC app. It happens that these 5 windows, which are created with a CFrameWnd as their parent (the main window), lose their focus, meaning they become inactive => therefore the thread subject).
That mustn't happen at all costs as it just hasn't got any logic -- not from the User Interface point of view anyway.
What I was expecting to create was five dialog boxes which look active whether they have the focus or not.
What I need, basically, is five windows, which look like toolboxes, that must look active independently of whether they have the focus or not.
Can someone please point me in the right direction? All comments/suggestions are more than welcome.
Thank you very much.
David
PS: By the way, these modeless dialog boxes have the "toolbox" style.
|
|
|
|
|
I'm sure there's a better solution than what I'm proposing: do custom painting of the caption bar (see this[^] article) and always execute the "is active" case.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hey! Thanks for the reply!
I was actually considering that option, but I kept on thinking that a different approach could be pursued... I guess there isn't...
Can I just ask you something? Do you know any links that teach how to paint the title bar of Windows XP controls?
Thanks Rav!
David
|
|
|
|
|
Not sure what you mean by a title bar of a control. In general, you can customize a control's appearance by overriding DrawItem() . This method is passed a pointer to a DRAWITEMSTRUCT that defines the drawing operation to be performed.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ah. Override CWnd::OnNcActivate() and return 0. This will prevent the window from appearing inactive. See this[^] MSDN link.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
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
|
|
|
|