Click here to Skip to main content
16,005,697 members
Home / Discussions / COM
   

COM

 
GeneralRe: Reinstance COM Object in C++ Pin
MarcoNedwig12-Apr-06 0:41
MarcoNedwig12-Apr-06 0:41 
GeneralRe: Reinstance COM Object in C++ Pin
Stephen Hewitt12-Apr-06 14:57
Stephen Hewitt12-Apr-06 14:57 
GeneralRe: Reinstance COM Object in C++ Pin
User 21559712-Apr-06 20:19
User 21559712-Apr-06 20:19 
QuestionAdding Controls Pin
rahultaing11-Apr-06 15:04
rahultaing11-Apr-06 15:04 
AnswerRe: Adding Controls Pin
Robilltuan12-Apr-06 16:43
Robilltuan12-Apr-06 16:43 
QuestionControls Pin
rahultaing11-Apr-06 14:34
rahultaing11-Apr-06 14:34 
QuestionOffice COM Addin -- SOS need help!!!! Pin
Alex Hoffenreich11-Apr-06 4:58
Alex Hoffenreich11-Apr-06 4:58 
Questionproblem with Derived class in WMI Pin
abhiramsss10-Apr-06 18:51
abhiramsss10-Apr-06 18:51 
Hi

iam trying to create a derived class of Win32_Process class using the following code .

but when iam trying to access that derived class in my query iam gettting error . can u please help me regarding this and tell me where iam doing wrong

IWbemClassObject *pNewDerivedClass = 0;
IWbemClassObject *pExampleClass = 0;
IWbemContext *pCtx = 0;
IWbemCallResult *pResult = 0;

BSTR PathToClass = SysAllocString(L"Win32_Process");

//The pSv variable is of type IWbemServices *


HRESULT hRes = pSvc->GetObject(PathToClass, 0, pCtx,
&pExampleClass, &pResult);
SysFreeString(PathToClass);

if (hRes != 0)
return;

pExampleClass->SpawnDerivedClass(0, &pNewDerivedClass);
pExampleClass->Release();

VARIANT v;
VariantInit(&v);

V_VT(&v) = VT_BSTR;
V_BSTR(&v) = SysAllocString(L"Win32_DerivedProcess");
BSTR Class = SysAllocString(L"__CLASS");
pNewDerivedClass->Put(Class, 0, &v, 0);
SysFreeString(Class);
VariantClear(&v);

BSTR OtherProp = SysAllocString(L"OtherInfo2");
pNewDerivedClass->Put(OtherProp, 0, NULL, CIM_STRING);
SysFreeString(OtherProp);

hRes = pSvc->PutClass(pNewDerivedClass, 0, pCtx, &pResult);
pNewDerivedClass->Release();

Query to access Derived class


IEnumWbemClassObject* pEnumerator = NULL;
hres = pSvc->ExecQuery(
bstr_t("WQL"),
bstr_t("SELECT * FROM Win32_DerivedProcess"),
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
NULL,
&pEnumerator);





Thanks in Advance


abhi
QuestionActiveX control in console application Pin
Phil Harding10-Apr-06 0:51
Phil Harding10-Apr-06 0:51 
AnswerRe: ActiveX control in console application Pin
Jörgen Sigvardsson10-Apr-06 3:27
Jörgen Sigvardsson10-Apr-06 3:27 
QuestionHow to add a my own shortcut item to the outlook shortcutbar with VC Pin
lxwsh9-Apr-06 22:56
lxwsh9-Apr-06 22:56 
AnswerRe: How to add a my own shortcut item to the outlook shortcutbar with VC Pin
Ganesh_T14-Apr-06 23:29
Ganesh_T14-Apr-06 23:29 
Questionerror D8045 Pin
rahultaing9-Apr-06 21:27
rahultaing9-Apr-06 21:27 
AnswerRe: error D8045 Pin
khan++9-Apr-06 21:34
khan++9-Apr-06 21:34 
QuestionIHTMLSelectElement onchange event Pin
abhishekks9-Apr-06 21:16
abhishekks9-Apr-06 21:16 
Questionwhy can not get the variable value correctly Pin
brygid9-Apr-06 20:27
brygid9-Apr-06 20:27 
QuestionC# project as a Client to COM component Pin
rahultaing9-Apr-06 15:28
rahultaing9-Apr-06 15:28 
AnswerRe: C# project as a Client to COM component Pin
Lim Bio Liong9-Apr-06 22:24
Lim Bio Liong9-Apr-06 22:24 
QuestionHow are COM objects instantiated? Pin
Richard Andrew x649-Apr-06 12:45
professionalRichard Andrew x649-Apr-06 12:45 
AnswerRe: How are COM objects instantiated? Pin
Michael Dunn9-Apr-06 18:39
sitebuilderMichael Dunn9-Apr-06 18:39 
Questionerror: LNK2001 Pin
rahultaing9-Apr-06 10:49
rahultaing9-Apr-06 10:49 
AnswerRe: error: LNK2001 Pin
Richard Andrew x649-Apr-06 12:39
professionalRichard Andrew x649-Apr-06 12:39 
AnswerRe: error: LNK2001 Pin
Richard Andrew x649-Apr-06 13:15
professionalRichard Andrew x649-Apr-06 13:15 
GeneralRe: error: LNK2001 Pin
rahultaing9-Apr-06 13:21
rahultaing9-Apr-06 13:21 
GeneralRe: error: LNK2001 Pin
Richard Andrew x649-Apr-06 13:27
professionalRichard Andrew x649-Apr-06 13:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.