|
Hi!
I cannot make WMI work (on XP).
I connect to server _T("ROOT\\cimv2"), then:
pSvc
IWbemLocator *pLoc = NULL;
IWbemServices *pSvc = NULL;
...
BSTR bstrPath = SysAllocString(_T("Win32_BIOS"));
IWbemClassObject *pCDClass = 0;
hr = pSvc->GetObject(bstrPath, 0, NULL, &pCDClass, 0);
//this is ok - I have an object
VARIANT v;
ZeroMemory(&v, sizeof(v));//with or without...
CIMTYPE type = CIM_STRING;
LONG fla = 0;
hr = pCDClass->Get(_T("Description"), 0, &v, &type, &fla);
This is ok too - IWbemClassObject::Get() method succeeded, but
VARIANT has VT_NULL.
How to get value of property "Description" from Win32_BIOS ?
|
|
|
|
|
I have a SMTP mailer component with 8 worker threads sending mails. The problem is that I want to fire event when mail issent and I want to fire event when all mails are sent. The problem is that one of my worker threads has to fire event by asking main thread to fire event. But this doesnt work that way it gives error in kernel32. What seems to be the problem and how can i solve it. I can only fire event when I dont have any thread working.
I am using MFC not ATL. When I handle event in VB it gives error ACCESS VIOLATION. I am just parsing the pointer of control class to worker thread to call the public function of control to fire event.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
i #include <wabapi.h> and get many errors
like am i really so stupid or crap at coding that i should take up herb farming in new mexico?
please point me in the right direction or put a bullet in my brain
---
"all's fair in love and war but in love there is no geneva convention"
|
|
|
|
|
Gosh!!!
This is a most un-lauren-like post lauren.
Nish
Has anyone seen my sig?
|
|
|
|
|
Ok, dumbass
Post a few of the errors maybe?
Personally, i'd avoid the bullet-in-brain thing, it sounds unpleasant. The herb thing sounds good though... (Mmmm, herb)
Sometimes i only remember, The days when i was young Nowadays no one remembers when they were young and stupid... ADEMA, The Way You Like It
|
|
|
|
|
Sounds like when I include winsock2.h before windows.h (maybe it's the other way around, don't remember ), then I get 200+ compile errors, but if I just swaps the 2 includes everything compiles fine.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
sorry guys ... i got totally frustrated
i built a dead plain dialog based app in app wizard and simply added wabapi.h in the stdafx.h file after all the usual #includes and i get the following errors
the header file looks a bit wierd to me too which is why i contemplated herb farming in new mexico :/
---------------------------------------------------
:\vstudio\vc98\include\wabapi.h(76) : error C2065: 'IWABObject' : undeclared identifier
c:\vstudio\vc98\include\wabapi.h(76) : error C2275: 'IUnknown' : illegal use of this type as an expression
c:\vstudio\vc98\include\unknwn.h(106) : see declaration of 'IUnknown'
c:\vstudio\vc98\include\wabapi.h(77) : error C2448: '<unknown>' : function-style initializer appears to be a function definition
c:\vstudio\vc98\include\wabapi.h(83) : error C2065: 'LPWABOBJECT' : undeclared identifier
c:\vstudio\vc98\include\wabapi.h(83) : error C2501: 'DECLARE_MAPI_INTERFACE_PTR' : missing storage-class or type specifiers
c:\vstudio\vc98\include\wabapi.h(83) : error C2078: too many initializers
c:\vstudio\vc98\include\wabapi.h(97) : error C2065: 'IMPL' : undeclared identifier
c:\vstudio\vc98\include\wabapi.h(98) : error C2501: 'MAPI_IUNKNOWN_METHODS' : missing storage-class or type specifiers
c:\vstudio\vc98\include\wabapi.h(98) : error C2146: syntax error : missing ';' before identifier 'MAPIMETHOD'
c:\vstudio\vc98\include\wabapi.h(98) : error C2501: 'MAPIMETHOD' : missing storage-class or type specifiers
c:\vstudio\vc98\include\wabapi.h(98) : error C2440: 'initializing' : cannot convert from 'unsigned long (__stdcall *)(void)' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
c:\vstudio\vc98\include\wabapi.h(98) : error C2143: syntax error : missing ';' before '('
c:\vstudio\vc98\include\wabapi.h(98) : error C2226: syntax error : unexpected type 'HRESULT'
c:\vstudio\vc98\include\wabapi.h(98) : error C2059: syntax error : ')'
c:\vstudio\vc98\include\wabapi.h(98) : error C2065: 'AllocateBuffer' : undeclared identifier
c:\vstudio\vc98\include\wabapi.h(98) : error C2501: 'MAPIMETHOD' : missing storage-class or type specifiers
c:\vstudio\vc98\include\wabapi.h(98) : error C2374: 'MAPIMETHOD' : redefinition; multiple initialization
c:\vstudio\vc98\include\wabapi.h(98) : see declaration of 'MAPIMETHOD'
c:\vstudio\vc98\include\wabapi.h(98) : error C2143: syntax error : missing ';' before '('
c:\vstudio\vc98\include\wabapi.h(98) : error C2226: syntax error : unexpected type 'ULONG'
c:\vstudio\vc98\include\wabapi.h(98) : error C2059: syntax error : ')'
c:\vstudio\vc98\include\wabapi.h(98) : error C2065: 'AllocateMore' : undeclared identifier
c:\vstudio\vc98\include\wabapi.h(98) : error C2501: 'MAPIMETHOD' : missing storage-class or type specifiers
c:\vstudio\vc98\include\wabapi.h(98) : error C2374: 'MAPIMETHOD' : redefinition; multiple initialization
c:\vstudio\vc98\include\wabapi.h(98) : see declaration of 'MAPIMETHOD'
c:\vstudio\vc98\include\wabapi.h(98) : error C2143: syntax error : missing ';' before '('
c:\vstudio\vc98\include\wabapi.h(98) : error C2226: syntax error : unexpected type 'ULONG'
c:\vstudio\vc98\include\wabapi.h(98) : error C2059: syntax error : ')'
c:\vstudio\vc98\include\wabapi.h(98) : error C2065: 'FreeBuffer' : undeclared identifier
c:\vstudio\vc98\include\wabapi.h(98) : error C2501: 'MAPIMETHOD' : missing storage-class or type specifiers
c:\vstudio\vc98\include\wabapi.h(98) : error C2374: 'MAPIMETHOD' : redefinition; multiple initialization
c:\vstudio\vc98\include\wabapi.h(98) : see declaration of 'MAPIMETHOD'
c:\vstudio\vc98\include\wabapi.h(98) : error C2143: syntax error : missing ';' before '('
c:\vstudio\vc98\include\wabapi.h(98) : error C2226: syntax error : unexpected type 'LPVOID'
c:\vstudio\vc98\include\wabapi.h(98) : error C2059: syntax error : ')'
c:\vstudio\vc98\include\wabapi.h(98) : error C2065: 'Backup' : undeclared identifier
c:\vstudio\vc98\include\wabapi.h(98) : error C2501: 'MAPIMETHOD' : missing storage-class or type specifiers
c:\vstudio\vc98\include\wabapi.h(98) : error C2374: 'MAPIMETHOD' : redefinition; multiple initialization
c:\vstudio\vc98\include\wabapi.h(98) : see declaration of 'MAPIMETHOD'
c:\vstudio\vc98\include\wabapi.h(98) : error C2143: syntax error : missing ';' before '('
c:\vstudio\vc98\include\wabapi.h(98) : error C2226: syntax error : unexpected type 'LPTSTR'
c:\vstudio\vc98\include\wabapi.h(98) : error C2059: syntax error : ')'
c:\vstudio\vc98\include\wabapi.h(98) : error C2065: 'Import' : undeclared identifier
c:\vstudio\vc98\include\wabapi.h(98) : error C2501: 'MAPIMETHOD' : missing storage-class or type specifiers
c:\vstudio\vc98\include\wabapi.h(98) : error C2374: 'MAPIMETHOD' : redefinition; multiple initialization
c:\vstudio\vc98\include\wabapi.h(98) : see declaration of 'MAPIMETHOD'
c:\vstudio\vc98\include\wabapi.h(98) : error C2143: syntax error : missing ';' before '('
c:\vstudio\vc98\include\wabapi.h(98) : error C2226: syntax error : unexpected type 'LPTSTR'
c:\vstudio\vc98\include\wabapi.h(98) : error C2059: syntax error : ')'
c:\vstudio\vc98\include\wabapi.h(98) : error C2065: 'Find' : undeclared identifier
c:\vstudio\vc98\include\wabapi.h(98) : error C2501: 'MAPIMETHOD' : missing storage-class or type specifiers
c:\vstudio\vc98\include\wabapi.h(98) : error C2374: 'MAPIMETHOD' : redefinition; multiple initialization
c:\vstudio\vc98\include\wabapi.h(98) : see declaration of 'MAPIMETHOD'
c:\vstudio\vc98\include\wabapi.h(98) : error C2143: syntax error : missing ';' before '('
c:\vstudio\vc98\include\wabapi.h(98) : error C2146: syntax error : missing ')' before identifier 'lpIAB'
c:\vstudio\vc98\include\wabapi.h(98) : error C2146: syntax error : missing ';' before identifier 'lpIAB'
c:\vstudio\vc98\include\wabapi.h(98) : error C2501: 'LPADRBOOK' : missing storage-class or type specifiers
c:\vstudio\vc98\include\wabapi.h(98) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
----------------------------------------------------------------
sorry for the long post ... help greatly appreciated
---
"all's fair in love and war but in love there is no geneva convention"
|
|
|
|
|
I hate to state the obvious but it has to be a dependency problem. Either the order of #include files or one (or more) missing include files. Looks like it needs an include with MAPI stuff for a start. Sorry I can't be of more help, but I haven't used wabapi.h Please no bullets...
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
I have to manage a dynamic list of strings (without MFC). Is there a way to do it easily (like CStringList::AddTail and AddHead with MFC) ?
I want to have access to a list of windows class name given by GetWindowClassName.
Thanks
|
|
|
|
|
You can use STL? If so, read Christian's articles on vector
Nish
Has anyone seen my sig?
|
|
|
|
|
Thanks, but I'm not familiar with STL...
It's not possible to do it in Win32 ???
For example, I could have a var like char sStrings[1024], add all string to this var, sperated by ";" and parse it... would it be a good solution ?
Thanks for your help
|
|
|
|
|
Anonymous wrote:
For example, I could have a var like char sStrings[1024], add all string to this var, sperated by ";" and parse it... would it be a good solution ?
Actually if the number of strings is gonna be low, then you might as well use an array of strings as in :-
char stringarray[64][256];
This gives you 64 strings each 256 chars long.
Nish
Has anyone seen my sig?
|
|
|
|
|
Nish [BusterBoy] wrote:
Has anyone seen my sig?
Yes,Nish.Me
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Well I've created my own CStringList and CString classes and they're in 'pure Windows'--no MFC. I posted an article called "Multi-threaded file finder class" and they're included in the source for it. You might want to download it and check it out.
By the way, the classes use Unicode, but you could easily convert them to ANSI or TCHAR if you need to.
Hope it helps.
|
|
|
|
|
Thank you all for your help !
|
|
|
|
|
My application is designed to run with at least two monitors. The main application is full screen on the primary display and creates full screen popup windows (without captions/borders) on all secondary displays. I would like to make it so any popup windows on the secondary displays are always on top of my full screen window. That is, any other popup window (from my app or another) is always on top of it. Windows supports "topmost" windows, but it doesn't have a "bottom most" concept. I have tried to subclass the desktop window, but it doesn't work. Right now I am making all of the popup windows my application creates topmost to workaround this, but that doesn't solve the problem with popup windows from other applications.
Chris Hafey
|
|
|
|
|
Is this one of those apps that is designed to realy p@ss people off big time?
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
No, it is software for viewing medical images. The application actually uses all the monitors to display the images! The problem is when the user wants to run other applications at the same time such as Internet Explorer or Word.
Chris Hafey
|
|
|
|
|
How do I update the status text on the StatusBar?
Will the process be different, if I have to do it from a worker thread?
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
No, process is your application which can have many threads, so same process but other thread. I'd suggest to use messages, sending a message to main window (AfxGetMainWnd() ) from any location and catch it and change the text in Status bar by using SetMessageText(LPCTSTR) of your frame window.
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need ASP hosting? Check out 123HostNow.com
|
|
|
|
|
SendMessage from a worker thread is usually a very bad idea as it can lead to deadlocks. Use PostMessage instead.
The Status Bar is usually updated by CMainFrame::OnUpdateStatusBar() so you shouldn't need to do anything much from your worker thread except set the value of whatever it is you want displayed.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Uhmm, who said to use SendMessage ? Yes, right, only PostMessage , though I wasn't clear by writing "send a message"
But this is not a point. I didn't know about any OnUpdateStatusBar , where it is declared? I know some handlers in CHtmlView for status bar though
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
Philip Patrick wrote:
Uhmm, who said to use SendMessage?
Sorry, you didn't actually say this. But as soon as I saw "send a message" my brain automatically converted this into SendMessage().
I made a small mistake with OnUpdateStatusBar(). It isn't an MFC function. This is what I do:
BEGIN_MESSAGE_MAP(CMainFrame, CEDMDIFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
....
ON_UPDATE_COMMAND_UI_RANGE( ID_INS_OVR_PANE, ID_SB_LAST_PANE, OnUpdateStatusBar )
....
And in the CEDMDIFrameWnd class:
afx_msg void OnUpdateStatusBar( CCmdUI *pCmdUI );
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Ah well, you are right at the end, I wrote "send a message" meaning exactly what I wrote without thinking about SendMessage and PostMessage, but yeah, right actually I was getting it as SendMessage too if I were reading my post
Hmm, that's nice, better then catching some custom message like WM_MY_VERY_UGLY_MESSAGE_FOR_STATUS_BAR and processing it I'll write it down to use when I need it.... Small tips makes big products, lol
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
I am trying to create an OLE module for PCAnywhere 10.0 that will do what the scripting used to do. I have included all the files required according to their documentation. When I compile, I get C2065 messages on all the functions that should be included in the project from the PCAnywhere modules. I have checked and rechecked and it appears all declarations are correct. Has anyone run into this and how did you fix it? Any help would be appreciated. I am using Visual C++ rel 6.0 and PCAnywhere rel 10.0.
|
|
|
|