|
From the registry:
HKEY_LOCAL_MACHINE > HARDWARE > DESCRIPTION > CentralProcessor > 0 > ~MHz
If you just want to know, use regedit.exe. If you need an application to read it, use the windows registry access functions.
|
|
|
|
|
Sorry, I forgot that my previous answer is only good on NT/2K/XP.
Check out the CPUTest article here on CodeProject:
http://www.codeproject.com/system/cputest.asp
I believe this should work on 95/98/Me, but only with CPUs that have the RDTSC instruction. Also, the code in this article does actually measure the speed, but it allows the measurement to be done rather quickly.
Win95/98/Me probably also stores the CPU information in the registry. I just don't happen to know where. I suggest doing a search here on CodeProject, on Google, or on CodeGuru.
- Kevin
|
|
|
|
|
|
How do I get the hwnd of the edit control portion of a combobox?
In a dialog I need to know if a certain control has focus.
CComboBox m_cLookup;
if(GetFocus()->GetSafeHwnd() == m_cLookup.GetSafeHwnd()){<br />
}
Doesn't work for a combobox, but works fine for a CEdit, so I'm assuming the hwnd of the edit control portion of the combobox is different from the hwnd of the combobox itself.
Ed
|
|
|
|
|
Need to find the edit window on the control.... see below...
HWND EditWnd = NULL;
::EnumChildWindows(cLookup.m_hWnd, EditFindProc, (LPARAM)&EditWnd);
BOOL CALLBACK CFindBar::EditFindProc(HWND hWnd, LPARAM lParam)
{
char szBuffer[255];
::GetClassName(hWnd, szBuffer, sizeof(szBuffer));
if (!::lstrcmp(szBuffer, "Edit"))
{
*((HWND*)lParam) = hWnd;
return FALSE;
}
return TRUE;
}
|
|
|
|
|
Hi,
I just recently used Marcio Ritter's tutorial on game programming to make a directX app. Sadly, it's not working (the OnIdle() function is causing problems). I asked Marcio about it, but I believe he is pretty busy, and was hoping that maybe some could glance at the code. It's very basic, and I'm sure it's something very simple that's causing it to crash. Oh well, if you would like to look at it, my e-mail is nreveles@austin.rr.com
Thanks for your time,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
If you think OnIdle() crashes just post some source code.
Gero
|
|
|
|
|
I didn't think it would be much help by itself, but here it is anyway
<code>
HRESULT hRet;
g_Brick.Draw(g_pDDSBack, 10, 10, 2, 2, 10, 10);
while( 1 )
{
hRet = g_pDDSFront->Flip(NULL, 0 );
if( hRet == DD_OK )
{
break;
}
if( hRet == DDERR_SURFACELOST )
{
g_pDDSFront->Restore();
}
if( hRet != DDERR_WASSTILLDRAWING )
{
break;
}
}
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
Have you stepped through it with a debugger?
Where does it crash? Does it crash the first time through the loop? At the very least I would add some trace statements so that you can tell what happens each time through the loop.
With out any more information I dont really know how to help you.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Ok, sorry. I have not actually ran the debug because my app runs full screen and that seems to be causing debug problems. I also do not understand how to use trace properly
I have, however, determined that the following statement is causing it to crash:
g_Brick.Draw(g_pDDSBack, 10, 10, 2, 2, 10, 10);
</code>
Perhaps you could quickly explane how to use trace?
Sorry about the inadaquate information,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
Let me know where I can look at your code and I will take a stab at it.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hello, please excuse my bad english....
I want to create a resizeable rect. (I know I can do this with WS_THICKFRAME, but the Border is to thick...)
So I override the WM_NCCALCSIZE function and deflate my window about 5 pixel. So I had a new Non-Client area. When I receive for example a WM_NCMOUSEMOVE message the nHitTest-Paramter is HT_BORDER and not for example HT_LEFT (when I move from the left side). Why send the OnHitTest method not HT_LEFT? Is there a chance to calc the correct Message automaticly (as WS_THICKFRAME)
|
|
|
|
|
I did this in the InitInstance
m_pMainWnd = new CMainFrame;
m_pMainWnd->LoadFrame(IDR_MAINFRAME);
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
The problem is that my toolbar insists on being in the child area. ie, it is inside the client edge of the framewindow.
What is wrong?
CMainFrame::OnCreate looks like this.
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_toolbar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_toolbar.LoadToolBar(IDR_MAINFRAME))
{
return -1;
}
m_toolbar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_toolbar);
return 0;
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
|
Does anybody have an example that reads Unicode text file?
Thanks in advance!
Best regards,
Vladimir
|
|
|
|
|
I very badly need to get an old copy of Borland C++ 4.5 or 5.0 with OWL for an old project....my old hard drive died, and i need to rebuild something!
Please email me if anyone can find the old CD.....
|
|
|
|
|
My school provides a link to an old copy (yes, I'm sad to say that my school actually uses Borland)...
Try this
Hope it's what your looking for,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
I created a dialog box and added a button to close the dialog box when I was finished. I added CDlg::EndDialog(nResults); and it didnt work when I moved the source code onto the PDA?
RebelCause
|
|
|
|
|
I created a long dialog box. I added a scrollbar in the properties of the dialog box. When I load the dialog box on the PDA I dont get a scroll bar?
Need Help
RebelCause
|
|
|
|
|
I can make my dialog to become a full screen dialog by using following putting code inside the OnInitDialog()
SetWindowPos(&wndTopMost,0,0::GetSystemMetrics(SMCXSCREEN),::GetSystemMetrics(SM_CYSCREEN),SWP_SHOWWINDOW);<br />
Only dialog get full screen but all the items, listctrl, combo box,etc.. on the dialog still the same size.. how can i make a full screen dialog and resizing all the item on that dialog as dialog get larger.
Thanks
|
|
|
|
|
|
I have a modeless dialog that pops up a MODAL dialog. What I want to do is position that MODAL child relative to the "parent" modeless dialog - offset upper-left corner by +50.
What I can't do is get a pointer to the modeless (parent) dialog. My code just references the governing MainFrame window. Here is what I'm trying:
BOOL CPopUpDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CRect pRect;
CWnd *pParentWnd;
pParentWnd = GetParent(); // tried GetParentOwner() too
pParentWnd->GetWindowRect(&pRect);
MoveWindow(pRect.left + 50, pRect.top + 50, 400, 400, NULL);
return (TRUE);
}
Can you help/explain how I reference the correct modeless parent I want?
Thanks.
John
|
|
|
|
|
GetParent() should return a pointer to the modeless dialog, if that is in fact who created CPopUpDlg .
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ok, here is what I have:
A modeless CPropertySheet derived dialog with a CButton that pops up a modal dialog. The modal dialog I use to collect a couple fields of data SPECIFIC to the parent modeless Sheet.
What happens now is when I pop up the modal dialog, the positioning is relative to the Main Frame.
I want the modal dialog to be placed right over the modeless Sheet (dialog).
Also, I can see that my method of placing the modal dialog is relative to the Main Frame because when I move the Main Frame around, the modal dialog is offset +50 from the Main Frame.
Thanks for help (in advance)
|
|
|
|
|
Try using SetWindowPos() if MoveWindow() doesn't work. (Cheesy answer, I know).
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|