|
DavidCrow wrote: This makes no sense. If the members of Win32_Processor are not valid, why would you then state that they should contain the data you're looking for?
Maybe I understood wrong what MSDN says. I just read: "To determine the total number of processor instances associated with a computer system object, use the Win32_ComputerSystemProcessor association class."
DavidCrow wrote: How are you verifying this?
Maybe I'm doing something wrong. I compiled the code with VC6 on my single core P4 with HT enabled (Win XP). I also run the program on a dual core Pentium D with HT enabled (also Win XP). In both cases NumberOfCores was not found and NumberOfLogicalProcessors was 0. I guess that the code works, as I can retrieve other members like, e.g., Name correctly. However, I can post the code if you like.
Regards,
Marcus.
|
|
|
|
|
|
DavidCrow wrote: These were added for Vista.
Whoops, I somehow missed that Well, this brings me right back to my initial question: Is there any chance to get the processor specs on non-Vista systems?
Regards,
Marcus.
|
|
|
|
|
khb wrote: Is there any chance to get the processor specs on non-Vista systems?
Yes, I've done it with both Win32_ComputerSystem and Win32_Processor .
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Now I'm getting confused
I just tried Win32_ComputerSystem . For example, I can get NumberOfProcessors correctly. But I can't get NumberOfLogicalProcessors , it's not in the query result. But this is alright according to MSDN which says about NumberOfLogicalProcessors :
Windows Server 2003, Windows XP, Windows 2000, Windows NT 4.0, and Windows Me/98/95: This property is not available.
Then I tried Win32_Processor . For example, I can get Name correctly. But I get neither NumberOfLogicalProcessors nor NumberOfCores , they're both not in the query result. But again this is alright, because MSDN states for both properties what I already cited above.
Or did I get something completely wrong?
Thank you for your patience, David!
Regards,
Marcus.
|
|
|
|
|
|
Hi Mike,
thanks for your answer. Currently I'm using the code from the article Counting Physical and Logical Processors here on CP. It makes also use of the functions you mentioned. I split up the code on did some tests on the following 2 PCs (I was wrong before: Pentium D has no HT):
1) Pentium 4, 3.06GHz, Single core, HT
2) Pentium D 950, 3.40GHz, Dual core, No HT I'd like to calculate the following values:
1) # CPUs: 1, #Cores: 1, #Log. CPUs per Core: 2
2) # CPUs: 1, #Cores: 2, #Log. CPUs per Core: 1 Now the problem: The functions you mentioned return the following values for both(!) CPUs:
GetSystemInfo.dwNumberOfProcessors: 2
cpuid HTT bit: Set
cpuid # logical CPUs per physical CPU: 2 This shows that it's not possible to distinguish between HT and dual core
Regards,
Marcus.
|
|
|
|
|
Hi all,
I am doing a project in VC++. In that I am loading html pages
dynamically using CHtmlView Class. And I need to catch all the events happening in the html page NOT IN the web browser control.
Is it possible or Not
Please help me.
Thanks in advance
George K Jolly
-- modified at 5:36 Monday 17th July, 2006
|
|
|
|
|
|
Hi,
I studied in my project tutorial that each OPC server is identified by a unique clsid.To get this clsid,run GUIDGen.exe and get the clsid.
I do the same...i got different type of clsid.
As iam new to coding..I dont know..
why they use clsid in the coding?
Whats the use of this clsid?
What is GUID?
Is there any tutorial to study about this?
Help me
|
|
|
|
|
A CLSID is a globally unique identifier that identifies a COM class object. If your server or container allows linking to its embedded objects, you need to register a CLSID for each supported class of objects.
See More From MSDN[^]
There are some articles for a beginner in COM at CP itself
See Micheal Dunn's article Introduction to COM[^]
He has also written some other articles regarding COM and WTL.
Search in CP
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
My Blog | Understanding State Patte
|
|
|
|
|
this looks very basic, from this you can start knowing GUID
What is GIUD?[^]
Do your Duty and Don't expect the Result
|
|
|
|
|
I'm trying to write a little test app to communicate with a smart card (using a GempPC Twin reader). program runs successfully until SCardTransmit function (SCardEstablishContext, SCardListReaders and SCardConnect functions return SCARD_S_SUCCESS and my card handle is 0xEA010000). this function returns 14 and does not execute.
this value is not in the "Smart Card Return Values" list in the msdn and therefor i do not have any idea for solve this problem. plealse helpe me.
my source code:
CString strReaderName ;
DWORD dwResult ;
DWORD dwReaderNameLen ;
DWORD dwProtocol;
LPSTR szListReaders = NULL;
LPTSTR szSCReader = NULL;
BYTE ATR[30] ;
DWORD ATRLen,dwState ;
byte command[] = { 0x80, 0xA4, 0x00, 0x00, 0x02, 0xFF, 0x02 };
BYTE pbRecvBuffer[500] ;
DWORD pcbRecvLength ;
dwResult=SCardEstablishContext(SCARD_SCOPE_SYSTEM,NULL,NULL,&m_hContext) ;
if(dwResult!=SCARD_S_SUCCESS)
{
AnalizeResult(dwResult);// selects a value from "Smart Card Return Values"
return ;
}
dwResult=SCardListReaders(m_hContext,NULL,NULL,&dwReaderNameLen);
if(dwResult != SCARD_S_SUCCESS)
{
AnalizeResult(dwResult);// selects a value from "Smart Card Return Values"
return;
}
szListReaders = (char*) malloc(dwReaderNameLen);
dwResult = SCardListReaders(m_hContext,NULL,(LPTSTR)szListReaders,&dwReaderNameLen);
if (dwResult != SCARD_S_SUCCESS)
{
AnalizeResult(dwResult);// selects a value from "Smart Card Return Values"
return;
}
szSCReader = (LPTSTR) szListReaders;
if(!szSCReader || *(szSCReader) =='\0')
{
if(szListReaders) free(szListReaders);
dwResult = SCardReleaseContext(m_hContext);
MessageBox("No readers present!");
return;
}
dwResult=SCardConnect(m_hContext,szSCReader,SCARD_SHARE_SHARED,SCARD_PROTOCOL_T0,&m_hCard,&dwProtocol) ;
if(dwResult!=SCARD_S_SUCCESS)
{
AnalizeResult(dwResult); // selects a value from "Smart Card Return Values"
return ;
}
dwResult=SCardStatus(m_hCard,(LPTSTR)szListReaders,&dwReaderNameLen,&dwState,&dwProtocol,ATR,&ATRLen) ;
if(dwResult!=SCARD_S_SUCCESS)
{
AnalizeResult(dwResult); // selects a value from "Smart Card Return Values"
return ;
}
MessageBox(szSCReader) ;
switch ( dwState )
{
case SCARD_ABSENT:
MessageBox("Card absent.");
break;
case SCARD_PRESENT:
MessageBox("Card present.");
break;
case SCARD_SWALLOWED:
MessageBox("Card swallowed.");
break;
case SCARD_POWERED:
MessageBox("Card has power.");
break;
case SCARD_NEGOTIABLE:
MessageBox("Card reset and waiting PTS negotiation.");
break;
case SCARD_SPECIFIC:
MessageBox("Card has specific communication protocols set.");
break;
default:
MessageBox("Unknown or unexpected card state.");
break;
}
dwResult=SCardTransmit(m_hCard,SCARD_PCI_T0,command,7,&pioRecvPci,pbRecvBuffer,&pcbRecvLength) ;
if(dwResult!=SCARD_S_SUCCESS)
{
AnalizeResult(dwResult); // selects a value from "Smart Card Return Values"
return ;
}
|
|
|
|
|
I use a SCARD_IO_REQUEST structure, this way has been working fine for many year ...
SCARD_IO_REQUEST pio;
if(enScProt_T0 == m_ActiveProtocol)
{ pio.dwProtocol = SCARD_PROTOCOL_T0; }
else if(enScProt_T1 == m_ActiveProtocol)
{ pio.dwProtocol = SCARD_PROTOCOL_T1; }
pio.cbPciLength = sizeof(SCARD_IO_REQUEST);
m_lErrCode = SCardTransmit(m_hScConnect, &pio, pBufTx, LenTx, &pio, pBufRx, &LenRx);
if(SCARD_S_SUCCESS != m_lErrCode) {
CString sT;
sT.Format("Error SCardTransmit (0x%08X). ", m_lErrCode);
m_pDlg->PutMsg(sT, true);
return false;
}
Maxwell Chen
|
|
|
|
|
LOGFONT lf;
memset(&lf, 0, sizeof(lf));
wcscpy(lf.lfFaceName, _T("Lucida Sans Unicode"));
error: cannot comvert parameter 1 from 'char32' to 'wchar_t*'
how can I solve it?
|
|
|
|
|
try this
_tcscpy(lf.lfFaceName, _T("Lucida Sans Unicode"));
nave
|
|
|
|
|
LOGFONT.lfFaceName is declared as TCHAR. TCHAR will work according to your application that is, i think you don't have _UNICODE defined in your application.
If so TCHAR will act as char, wcscpy will expecting WCHAR but you passing char. normal strcpy(..) or _tcscpy(..)
Try this... hope it'll work...
Do your Duty and Don't expect the Result
|
|
|
|
|
See strcpy(m_lf.lfFaceName, "Times New Roman"); for your answer
------------
and see maybe its some helpful to you
<br />
LOGFONT m_lf;<br />
NONCLIENTMETRICS nm;<br />
nm.cbSize = sizeof (NONCLIENTMETRICS);<br />
ZeroMemory ((PVOID) &m_lf,sizeof (LOGFONT));<br />
<br />
SystemParametersInfo(SPI_GETNONCLIENTMETRICS,nm.cbSize,&nm,0); <br />
m_lf = nm.lfMenuFont;<br />
whitesky
|
|
|
|
|
i use this code for creating tooltip what i dont get that
tell me what is the problem
m_tooltip.Create(this);//, TTS_ALWAYSTIP);
m_tooltip.Activate(TRUE);
m_tooltip.AddTool(GetDlgItem(IDC_EDIT1),("this is edit box"),NULL,0);
m_tooltip.SetToolRect(GetDlgItem(IDC_EDIT1),1,CRect(32,32,64,64));
Ashish Dogra
MCA
Noida
|
|
|
|
|
You dont need to a new thread we can see your thread and see my previous thread
whitesky
|
|
|
|
|
i read msdn but still i dont get tootip
Ashish Dogra
MCA
Noida
|
|
|
|
|
|
i do this msdn but still dont get tool tip
can u tellme
Ashish Dogra
MCA
Noida
|
|
|
|
|
See
<code>
m_Tool.Create(this);
m_Tool.AddTool(GetDlgItem(IDC_BUTTON1),"Is this a test");
m_Tool.Activate(true);
BOOL CAnswerDlg::PreTranslateMessage(MSG* pMsg)
{
if (m_Tool)
m_Tool.RelayEvent(pMsg);
return CDialog::PreTranslateMessage(pMsg);
}
</code>
whitesky
|
|
|
|
|
Hi,
I try to source for icons for programming window applications in
google, but the results are noisy and I just find one or two
icon suites. Anyone knows any good websites for software icons ?
Thanks
|
|
|
|
|