Click here to Skip to main content
15,890,512 members
Home / Discussions / COM
   

COM

 
Questiondoubt on Activex control Pin
sunita ramesh15-Jul-06 1:03
sunita ramesh15-Jul-06 1:03 
AnswerRe: doubt on Activex control Pin
Mike Dimmick16-Jul-06 6:15
Mike Dimmick16-Jul-06 6:15 
GeneralRe: doubt on Activex control Pin
William.Wang17-Jul-06 23:40
William.Wang17-Jul-06 23:40 
GeneralRe: doubt on Activex control Pin
sunita ramesh18-Jul-06 1:23
sunita ramesh18-Jul-06 1:23 
Questionassigning an accelerator for an explorer bar (CATID - INFOBAND) and making it default view Pin
alianyn14-Jul-06 10:40
alianyn14-Jul-06 10:40 
AnswerRe: if anyone is ever interested in how i eventually did it Pin
alianyn18-Jul-06 3:45
alianyn18-Jul-06 3:45 
QuestionComponent Services Info Pin
vertigo_one14-Jul-06 7:04
vertigo_one14-Jul-06 7:04 
Questionproblem with the creation of an instance of ActiveX at runtime and with the invocation of a method from this component Pin
masanne13-Jul-06 23:58
masanne13-Jul-06 23:58 
Hallo!

I want create an instance of activeX at runtime and then invoke a method from this.
I create already a instance ( with cocreateinstance(...) and create a control with createcontrol(..)) ,
then i get the disid of the method with GetIDsOfNames(...).
I get the right dispid but if i want invoke this method i get a HRESULT = E_UNEXPECTED .
What do i wrong, please help me and a big thanks in advance.

<br />
......<br />
<br />
static CLSID clsid;	// i already get the right clsid from the registry<br />
<br />
IDispatch *pInterface = 0;<br />
<br />
CoInitialize(NULL);<br />
<br />
// create the control <br />
HRESULT hRet = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_IDispatch, (void**) &pInterface ); <br />
// examine return value <br />
if(hRet!=S_OK) pInterface = 0;  <br />
			<br />
CString CstrMethod = "CONFIG"; <br />
BSTR BstrMethod = CstrMethod.AllocSysString();<br />
<br />
DISPID dispid; <br />
<br />
// get the id of the method									<br />
hRet = pInterface->GetIDsOfNames(IID_NULL, &BstrMethod, CLSCTX_INPROC_SERVER , LOCALE_SYSTEM_DEFAULT, &dispid); <br />
<br />
if(hRet!=S_OK) MessageBox("It is not possible to get the Id of the method!");<br />
<br />
CWnd m_ControlWrapper;<br />
RECT rct = {0,0,5,50};<br />
<br />
BOOL bStat=FALSE;<br />
bStat= m_ControlWrapper.CreateControl(clsid, "Spectrometer", WS_CHILD, rct, this, 1212, NULL, FALSE, NULL);<br />
<br />
if (bStat == FALSE)<br />
{<br />
     ::MessageBox (m_hWnd,"Error!!", /*Fenster header:*/"Could not place control", MB_OK);<br />
     return;<br />
}<br />
<br />
VARIANT varResult;<br />
VariantInit(&varResult);<br />
EXCEPINFO ExceptInfo;<br />
DISPPARAMS dispparamsNoArgs = { NULL, NULL, 0, 0 };<br />
<br />
// here is the problem hRet = E_UNEXPECTED<br />
hRet = pInterface->Invoke(dispid, IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD, &dispparamsNoArgs, &varResult, &ExceptInfo, NULL);<br />
<br />
CoUninitialize(); <br />

QuestionCreate ActiveX from dialog used other ActiveX Pin
majco33313-Jul-06 22:40
majco33313-Jul-06 22:40 
QuestionCOM concept help - order of functions or parameters Pin
J.B.13-Jul-06 21:43
J.B.13-Jul-06 21:43 
AnswerRe: COM concept help - order of functions or parameters Pin
Steve S13-Jul-06 22:05
Steve S13-Jul-06 22:05 
GeneralRe: COM concept help - order of functions or parameters Pin
J.B.13-Jul-06 22:16
J.B.13-Jul-06 22:16 
QuestionHow to create object by Knowing Interface only Pin
kanduripavan13-Jul-06 1:40
kanduripavan13-Jul-06 1:40 
AnswerRe: How to create object by Knowing Interface only Pin
Alex Hazanov13-Jul-06 10:01
Alex Hazanov13-Jul-06 10:01 
GeneralRe: How to create object by Knowing Interface only Pin
kanduripavan13-Jul-06 18:50
kanduripavan13-Jul-06 18:50 
GeneralRe: How to create object by Knowing Interface only Pin
Steve S13-Jul-06 22:09
Steve S13-Jul-06 22:09 
GeneralRe: How to create object by Knowing Interface only Pin
kanduripavan14-Jul-06 0:03
kanduripavan14-Jul-06 0:03 
GeneralRe: How to create object by Knowing Interface only Pin
Steve S16-Jul-06 22:51
Steve S16-Jul-06 22:51 
QuestionModifying POST data in a BHO Pin
mdave12-Jul-06 9:27
mdave12-Jul-06 9:27 
QuestionIIDFromString Failing ! Pin
Malli_S11-Jul-06 21:38
Malli_S11-Jul-06 21:38 
AnswerRe: IIDFromString Failing ! Pin
Hans Ruck12-Jul-06 2:54
Hans Ruck12-Jul-06 2:54 
GeneralRe: IIDFromString Failing ! Pin
Malli_S12-Jul-06 18:33
Malli_S12-Jul-06 18:33 
GeneralRe: IIDFromString Failing ! [modified] Pin
Hans Ruck12-Jul-06 20:53
Hans Ruck12-Jul-06 20:53 
Questiondeveloping COM Application Pin
peter rankel11-Jul-06 21:03
peter rankel11-Jul-06 21:03 
AnswerRe: developing COM Application Pin
kumarprabhakar7411-Jul-06 22:22
kumarprabhakar7411-Jul-06 22:22 

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.