|
I have but seeing as it's a 2 y/o article noone has replied. Or maybe it's because I smell too badly and they don't want to reply for fear of catching something?
When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
|
|
|
|
|
Hi,
I am using WMI to get hardware details. WMI defines INT8. At the same time I am using one library that defines INT8, and because of this I am getting redefinition error for INT8. I can not change the code either in WMI or in other library. There could be one way by creating a Dll for all wmi code. But is there any other workaround for the same?
That would be great, if one can help me in getting following details without using WMI:
1. All drives (Fixed as well as removable) and their partitions with size, utilization and driver (description, date, version) details.
2. CPU details : No of CPUs and for each CPU ---> CPU type, CPU alias, Original clock, Real Clock, Effective clock, CPUID manufacturer, CPUID revision.
3. Motherboard details: Motherboard ID, Motherboard Name, BUS type, BUS Width, BIOS type, System BIOS Date, No of memory modules and RAM within them.
Regards!
Paddy
|
|
|
|
|
You dont need to repeate your question
|
|
|
|
|
Sorry for the same.
Regards!
Paddy
|
|
|
|
|
Padmanabh Sharma wrote: WMI defines INT8. At the same time I am using one library that defines INT8, and because of this I am getting redefinition error for INT8. I can not change the code either in WMI or in other library. But is there any other workaround for the same?
Hmmm.
You could write a (thin) wrapper-class for (parts of) WMI (or the other lib), hiding it from the outside.
In that class's .cpp, before including the WMI-stuff, you undef INT8 (it is not typedef 'd I hope) and let WMI define it.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Hi,
I am using WMI to get hardware details. WMI defines INT8. At the same time I am using one library that defines INT8, and because of this I am getting redefinition error for INT8. I can not change the code either in WMI or in other library. There could be one way by creating a Dll for all wmi code. But is there any other workaround for the same?
That would be great, if one can help me in getting following details without using WMI:
1. All drives (Fixed as well as removable) and their partitions with size, utilization and driver (description, date, version) details.
2. CPU details : No of CPUs and for each CPU ---> CPU type, CPU alias, Original clock, Real Clock, Effective clock, CPUID manufacturer, CPUID revision.
3. Motherboard details: Motherboard ID, Motherboard Name, BUS type, BUS Width, BIOS type, System BIOS Date, No of memory modules and RAM within them.
Regards!
Paddy
Padmanabh Sharma
|
|
|
|
|
|
Hi,
Yes this gives me most of the details but even i m not able to get following details:
1. Motherboard ID.
2. Driver details for all partitions and removable drives.
3. Bus type and Bus width
4. CPU alias
5. Real and Effective clock
Regards!
Paddy
|
|
|
|
|
Hi,
I missed to add few of details in the list. The updated list is:
1. Motherboard ID.
2. Driver details for all partitions and removable drives.
3. Bus type and Bus width
4. CPU alias
5. Real and Effective clock
6. BIOS type and BIOS system date
7. Memory modules and RAM in each memory module.
Regards!
Paddy
|
|
|
|
|
Did your problem solve?
|
|
|
|
|
I think for these objects you need to WMI
|
|
|
|
|
Hai All,
I am doing a project in which , I have to catch HtmlForm events from an html document that I have displayed in my CHtmlView .
I am getting the htmlDocumet Like this
void CHtmlViewerView::OnDocumentComplete(LPCTSTR lpszURL)
{
IDispatch * pDocDisp = NULL;
pDocDisp = this->GetHtmlDocument();
IHTMLDocument2* pDoc;
pDocDisp->QueryInterface( IID_IHTMLDocument2, (void**)&pDoc );
IHTMLElementCollection* pElemColl = NULL;
HRESULT hr = pDoc->get_all( &pElemColl );
Dispatch* pElemDisp = NULL;
_variant_t varIdx( 0L, VT_I4 );
HRESULT hr = pElemColl->item( varIdx, varIdx, &pElemDisp );
IHTMLElement* pElem = NULL;
hr = pElemDisp->QueryInterface( IID_IHTMLElement, (void**)&pElem );
HRESULT hr;
IConnectionPointContainer* pCPC = NULL;
IConnectionPoint* pCP = NULL;
DWORD dwCookie;
hr = pElem->QueryInterface( IID_IConnectionPointContainer, (void**)&pCPC );
hr = pCPC->FindConnectionPoint( DIID_HTMLElementEvents, &pCP );
hr = pCP->Advise((IUnknown*)this, &dwCookie ); //This advise
//always fails
}
How can I rectify it.
I am refering the following ariticle
http://lists.w3.org/Archives/Public/w3c-wai-ua/2000JanMar/att-0287/htmlevent.htm
}
|
|
|
|
|
I would like to change code below in order to convert a double into a string containing thousand separator.
How to do it, in a simple way ?
<br />
CString str;<br />
double d;<br />
d = val * 2000.248;<br />
str.Format("%.3f", d);<br />
m_result = str;<br />
apffal
|
|
|
|
|
|
That works !
But how to do it with double or float ?
apffal
|
|
|
|
|
Hi All,
I was hoping someone could help me with this problem.
WaitForSingleObject(hFile, INFINITE);
How to signal the handle or end the wait?
Any info would help.
Thanks in Advance.
P1p3r
|
|
|
|
|
|
I'm Sorry,
That is a HANDLE,
which is a waitable object.
At anyrate, it's the handle returned by 'FindFirstChangeNotification'
P1p3r
|
|
|
|
|
You can poll...
bool fCancel = false;
while (!fCancel)
{
if (WAIT_TIMEOUT != WaitForSingleObject( hFile, 100 )
{
(event was signaled - do some stuff)
}
}
|
|
|
|
|
Even better than polling (polling takes CPU cycles)...
HANDLE hCancel = ::CreateEvent(NULL, false, false, NULL);
...
#define EVENT_FILE 0
#define EVENT_CANCEL 1
HANDLE Events[] =
{
hFile,
hCancel,
};
DWORD dwEventIndex = ::WaitForMultipleObjects(sizeof(Events) / sizeof(HANDLE),
Events, FALSE, INFINITE);
if (dwEventIndex == WAIT_FAILED)
{
some error occurred
}
dwEventIndex -= WAIT_OBJECT_0;
if (dwEventIndex == EVENT_FILE)
{
file event was signaled - do some stuff
}
else
{
cancelled
}
use ::SetEvent(hCancel) to cancel the wait
|
|
|
|
|
Thanks for for info,
I'm going to try it out
P1p3r
|
|
|
|
|
use setEvent(hFile) function to single handle...
you can't end the wait because of infinte time interval given in WaitForSingleObject.
|
|
|
|
|
Thanks.
This is actually what I was looking for.
The previous post also worked quite well
P1p3r
|
|
|
|
|
I'm trying to mess around with Microsoft's XNA the 360 game programmer if anyone could help please. And even if you can't can I have a tutorial or two to learn how to use visual C++. Or maybe how to create pictures from a coding system?
I'm a true failure.
|
|
|
|
|
Hi,
I'm starting to use Visual Studio 2005 and I'm having some major issues. For instance I create a new C++ -> MFC Application and when I declare some CStrings in a member function they don't initialize correctly.
For instance:
CString a,b,c,d,e,f; <- Right after declaration they will have values of "" except at least one will have a value <bad ptr>
I can also try:
CString a = L"";
CString b = L"";
etc
But I'll end up with the same problem.
Also, I notice when I debug I can't see any ints that I've declared - they are in scope, but I can't see the values.
*** When I make my variables static - everything works fine....
Is this some sort of managed C++ thing? I'm just writing simple code that worked in Visual Studio 6, 2003, etc...
Help!!
Mike
|
|
|
|
|