|
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
|
|
|
|
|
Can you post an example function showing the variables and how they are defined?
If you declare them but don't use them then the compiler may optimize them out so you can't view
them in the debugger (because they aren't there).
Mark
|
|
|
|
|
I tried creating a new project. Defining CStrings and setting their values to "" and using ints. They all show up normally in the debugger.. I'm pulling my hair out here. I am testing on two different computers. If I create a new project from scratch, I can't reproduce the bug. In my current project, I clean, rebuild, etc, and it won't go away. I'm beginning to think something is corrupted in my project!
In my code, I have a class that declares these locally in a function. The variable names exist no where else. The weird part is as these get defined I watch the <bad ptr> change to "". *Except* for sday, it will always be bad ptr, I can rename the variable, change the order that it is defined - it will *always* be a <bad ptr> how is that possible??
Furthermore - when the variables initialize they all turn to "" except sday. Here's the best part - when the variables get set to "test" I watch CString a,b,c,d etc randomly get those values not the variables I'm setting to test....
The code *seems* to be executing correctly, but debug is just a complete mess! This is on two different systems, one being a clean build.
Once again defining these as static makes everything appear correct in the debugger.
If my project is corrupted somehow - is there a way to super clean it? Or am I stick redoing it?
Thanks!
I've stripped my code down to this:
bool CPCInfo::goodVscanDef(CString local, CString server)
{
CString a,b,c,d,e,f,g,h; //this is just for some additional debug tests
CString lmonth;
CString lday;
CString lyear;
CString lrev;
CString smonth;
CString sday;
CString syear;
CString srev;
lmonth = L"test";
lday = L"test";
lyear = L"test";
lrev = L"test";
smonth = L"test";
sday = L"test";
syear = L"test";
srev = L"test";
return false;
}
|
|
|
|
|
>>I'm beginning to think something is corrupted in my project!
Sounds like it!
May not help, but you could try closing VS2005, rename the solutionname.NCB file to
solutionname.NCB.bak open the solution (solutionname.NCB gets rebuilt), clean\rebuild and see
what happens.
Mark
|
|
|
|
|
Thanks! I forgot about the .nbc - I used to have to delete it to fix intellisense issues with other versions
That fixed it. I was beginning to think somehow I was doing something wrong...
|
|
|
|
|