|
On a side note, MFC exceptions should be deleted when caught with catch (e->Delete() ).
Steve
|
|
|
|
|
Please let me know how do I create a timestamp. In the following format..
2007.11.21 16:36:46.094+00:00
Thanks
|
|
|
|
|
Get the system time by calling GetSystemTime() . The SYSTEMTIME struct contains everything you need to generate this timestamp.
Use CString::Format() to format to your required format.
pl_kode wrote: 2007.11.21 16:36:46.094+00:00
BTW this time is in UMT? For converting your local time to UMT, Get the current timezone by calling GetTimeZoneInformation() then convert it to UMT by calling TzSpecificLocalTimeToSystemTime()
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi All,
How can I save multiple registry keys into a single file? The RegSaveKeyEx() fails if a file already exists.
Thank you,
AJ
|
|
|
|
|
Ajay L D wrote: The RegSaveKeyEx() fails if a file already exists.
Can't you rename the existing file and delete it later if RegSaveKeyEx() succeeds?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thanks! I could do it, but I need to store all the values into a single file, by appending the values. I would have multiple calls to RegSaveKeyEx() but the file name needs to be the same.
Thank you,
AJ
|
|
|
|
|
I think the OP wasn't asking about that (my CPMRU battery pack is fully charged): maybe he was asking how to write multiple keys (possibly unrelated) in the same file.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
You hit the bull's eye!!
Any answers?
Thank you,
AJ
|
|
|
|
|
Nope, unfortunately.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: Nope, unfortunately. [Cry]
Running low on drugs?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Yes.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Call RegSaveKeyEx() as many times as necessary, then merge all of the files into one.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Thanks everyone for the replies!
|
|
|
|
|
If you think my answer wasn helpful you can give me vote.
|
|
|
|
|
Hi Friends,
I am creating the dialog in my application.
in that using CreateSolidBrush() to paint the dialog.
But CreateDialog() is throwing an exception(wingdi.cpp).If i comment CreateSolidBrush()it works fine.
what could be the problem?
Reagards
Shiva
|
|
|
|
|
Can you paste your code here??
|
|
|
|
|
m_DlgClr.CreateSolidBrush(RGB(97,129,175));
I am creating it in OnInitDialog().
and in OnCtlColor(,,)
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(nCtlColor == CTLCOLOR_DLG)
return m_DlgClr;
return hbr;
Reagards
Shiva
|
|
|
|
|
m_DlgClr is a CBrush?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
|
Try create brush in constructor instead of OnInitDialog.
|
|
|
|
|
I tried it.It wont paint the dialog.
Reagards
Shiva
|
|
|
|
|
Where is it crashing ??
In OnCtlColor() dont call base class version always call only in else part.
|
|
|
|
|
I traced it.Its crashing in following code.
BOOL CWnd::CreateDlgIndirect(LPCDLGTEMPLATE lpDialogTemplate,
CWnd* pParentWnd, HINSTANCE hInst)
{
ASSERT(lpDialogTemplate != NULL);
if (pParentWnd != NULL)
ASSERT_VALID(pParentWnd);
.
.
.
.
.
hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate,
(CRASH)-----> pParentWnd->GetSafeHwnd(), AfxDlgProc);
Reagards
Shiva
|
|
|
|
|
Shivarudrayya H wrote: I am creating it in OnInitDialog().
What does this method look like?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|