|
I do not understand your "answer". I can convert the SYSTEMTIME structure of 8 WORDs into 4 DWORDS perhaps, then I only have 4 keys to store, yes? How would I get 2 separate WORDs from a DWORDs? One as a low value and the other as high value?
|
|
|
|
|
Yes, that would work. There are two macros, LOWORD and HIWORD .
Or do it like Toni78 suggests, storing everything as a string.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Concatenate all of the data in one string and store it in the registry. That is if you don't want to save each member.
i.e.
CString strTime;
strTime.Format("%X-%X-%X", sysTime.wYear, sysTime.Month, sysTime.DayOfWeek );
This is just an idea and I have not tested it if it works. But I don't see a reason why it shouldn't.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Save it as a binary value
CRegKey Key;
if (ERROR_SUCCESS == Key.Create(HKEY_CURRENT_USER, _T("Software\\My Company\\My App\\Settings"));
{
::RegSetValueEx(Key.m_hKey, _T("Time"), NULL, REG_BINARY, (LPBYTE)&MyTimeObject, sizeof(SYSTEMTIME));
} To read it back again use the ::RegQueryValueEx() function
CRegKey Key;
if (ERROR_SUCCESS == Key.Open(HKEY_CURRENT_USER, _T("Software\\My Company\\My App\\Settings"));
{
DWORD dw = sizeof(SYSTEMTIME);
::RegQueryValueEx(Key.m_hKey, _T("Time"), NULL, NULL, (LPBYTE)&MyTimeObject, &dw);
}
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Awesome! Thanks m8
|
|
|
|
|
WOW!!! I could never find a reason to use REG_BINARY.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
How do I add one of those cool list boxes that allow you to pick a color in the dialog box. I know how to add a list box to a dialog, but not how to add the color part to it.
PS -- I'm not talking about CColorDialog, I want to know how to be able to pick a color inside the dialog list box.
|
|
|
|
|
|
I am drawing directly on to a dialog and for some reason in the OnPaint() handler, if I use TextOut, text draws okay. If I replace the statement with DrawText() nothing appears. This is with DT_NOCLIP|DT_CALCRECT|DT_SINGLELINE as options. It is me or is there something deeper afoot? I am using W2K SP3 and VC6.
thanks
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
"I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.
|
|
|
|
|
From MSDN:
DT_CALCRECT
Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the lpRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
So it was me after all... my inability to read!! Sheesh.
Thanks!!
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
"I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.
|
|
|
|
|
Heh, don't feel bad. It bites me every time I use that feature.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
There are 3-buttons or 'things-to-click' in the upper right corner
of a CFormView application. There is Minimize/Maximize, Restore and
Close. I have never touched any code related to those buttons for
years, but for some reason, they just don't work correctly now.
Is there an easy way to make those buttons work? Please let me know.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
How do they no work correctly?
Kuphryn
|
|
|
|
|
If I click the minimize button, it doesn't do anything.
If I click the Maximize/Restore button, I see a smaller button
indent and the program minimizes.
If I click the Exit/Close button, it closes.
|
|
|
|
|
You may have a handler for WM_SYSCOMMAND or WM_WINDOWPOSCHANGING which either doesn't pass down to DefWindowProc, or if it does, isn't doing it correctly.
When you hit minimize, you first get a WM_SYSCOMMAND with the SC_MINIMIZE code, then a WM_WINDOWPOSCHANGING which you can use to change some of the information before the change occurs.
You might also have overridden WM_NCHITTEST , which tells Windows what the user has hit when a mouse message occurs.
You should see whether the system menu still works properly - if it does, it's probably a problem with WM_NCHITTEST ; if not, probably either WM_SYSCOMMAND or WM_WINDOWPOSCHANGING
As always, the simplest way to see what's going on is to use Spy++, which should be in your start menu.
|
|
|
|
|
Well,
I am using CPropertySheet and adding CPropertyPage pages.
I have select the Tahoma font for all of the my pages including the parent CPropertySheet.
Now the problem is after setting the Font, I am still unable to view the dialogs with Tahoma font.
Can any body help me in this regard
The Phantom.
|
|
|
|
|
Post the code that sets the font for the property sheet and pages.
Kuphryn
|
|
|
|
|
I have set the Tahoma font with size 8 for every dialog in resource editor, rather then programatically.
This was the code:
CPropertySheet m_SettingPsh ; // dailog template in .rc
CPropertyPage m_PreferencesPpg ; // dialog template in .rc
m_SettingPsh.AddPage(&m_PreferencesPpg) ;
m_SettingPsh.AddPage(&m_PersonalPpg) ;
m_SettingPsh.AddPage(&m_ResponderPpg) ;
m_SettingPsh.AddPage(&m_ConnectionPpg) ;
But it still displays in the default font
The Phantom
|
|
|
|
|
One solution is SetFont(). Override OnInitDialog() and set the font for each dialog window.
Kuphryn
|
|
|
|
|
I got this BASIC code from an old book, I am converting this to c, could somebody tell me what is "On NTY GoTo 610, 620, 680, 690" function is? I know that is to go to line 610,620,680,690. but what are the conditions for that? how can I convert it.
what about " !" in here?, In c if it is "!=" that is not equal to, but what about here? It canot be factorial number.
NTY = ITYPE(I): KP = 4 * (I - 1) + 1
600 On NTY GoTo 610, 620, 680, 690
610 R = ELEM(KP): GoTo 660
620 REY = ELEM(KP + 1) * Abs(Q(I)): If REY < 1! Then REY = 1!
630 If REY < 2000 ! Then GoTo 640 Else GoTo 650
640 R = ELEM(KP) * 64 ! / REY: GoTo 660
650 R = ELEM(KP) * 1.325 / (Log(ELEM(KP + 2) + 5.74 / REY ^ 0.9)) ^ 2
660 DH = DH + S(J) * R * Q(I) * Abs(Q(I)) ^ EN
670 HDQ=HDQ+EX*R*ABS(Q(I))^EN GOTO 710
680 DH = DH + S(J) * ELEM(KP): GoTo 710
690 DH = DH - S(J) * E(LEM(KP) + Q(I) * (ELEM(KP + 1) + Q(I) * (ELEM(KP + 2) + Q(I) * ELEM(KP + 3))))
thanks in advance
shanila
|
|
|
|
|
shanila wrote:
600 On NTY GoTo 610, 620, 680, 690
if NTY is 1, then goto 610
if NTY is 2, then goto 620
if NTY is 3, then goto 680
if NTY is 4, then goto 690
shanila wrote:
630 If REY < 2000 ! Then GoTo 640 Else GoTo 650
Treats the previous number as a single-precision number, equivalent to a C float
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello, how can I set the cursor behind the last character in a CRichEditCtrl. I tried to use SetCursor like in CEdit but doesn't work....
Thanx to all...
|
|
|
|
|
If you want to set the cursor after the last character then use CRichEditCtrl::SetSel(-1,-1);
If you want to set the cursor just before the last character in the control then use the following code;
CHARRANGE cr;<br />
m_wndRE.SetSel(-1,-1);<br />
m_wndRE.GetSel(cr);<br />
cr.cpMax--;<br />
cr.cpMin--;<br />
m_wndRE.SetSel(cr);
where m_wndRE is the control variable for the rich edit control.
Hope this helps.
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
"I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.
|
|
|
|
|
Hi
Is there is any method to run a process without puting it in the process list (Ctrl+ Alt+ Del)
That mean I need to run a precess and I don't want the user to know about it!
Please Help
Thanks very much
|
|
|
|