Board index » delphi » dispid of VB COM Object??

dispid of VB COM Object??

i have tried this:

 LCID, ID,i,J: integer;

 Disp:=CreateComObject(ProgIDToClassID('WolfCom.DynCom')) as IDispatch;
  MethodName := StringToOleStr('GetVal');

  OleCheck(Disp.GetIDsOfNames(GUID_NULL, @MethodName, 1, LCID, @ID));
// ID was like 160909034
  OleCheck(Disp.GetTypeInfo(0,LCID,TypeDesc));

  OleCheck(TypeDesc.GetFuncDesc(ID,funDesc));

But GetFunDesc Fails with "Unable to find element".

Any  hints

Thanks

--

Pavesi Enrico
Nexus Informatica S.r.l.
Melegnano (Mi)  ITALY
Enrico.Pav...@nexusinf.it
Sito WEB http://www.nexusinf.it/

"God is Real - unless declared Integer"

 

Re:dispid of VB COM Object??


GetFuncDesc does not accept a DISPID value. It requires a 0-based integer of
the vtable method index that you want to obtain. For instance, if your
vtable is layed out like this:

IFoo = interface
  func QI
  func AddRef
  func Release
  func Foo
end;

GetFuncDesc (3) returns the desc for the Foo method

--
have fun

Binh Ly
www.techvanguards.com

Quote
"Enrico Pavesi" <nxpav...@tin.it> wrote in message

news:98066s$3974@bornews.inprise.com...
Quote
> i have tried this:

>  LCID, ID,i,J: integer;

>  Disp:=CreateComObject(ProgIDToClassID('WolfCom.DynCom')) as IDispatch;
>   MethodName := StringToOleStr('GetVal');

>   OleCheck(Disp.GetIDsOfNames(GUID_NULL, @MethodName, 1, LCID, @ID));
> // ID was like 160909034
>   OleCheck(Disp.GetTypeInfo(0,LCID,TypeDesc));

>   OleCheck(TypeDesc.GetFuncDesc(ID,funDesc));

> But GetFunDesc Fails with "Unable to find element".

> Any  hints

> Thanks

> --

> Pavesi Enrico
> Nexus Informatica S.r.l.
> Melegnano (Mi)  ITALY
> Enrico.Pav...@nexusinf.it
> Sito WEB http://www.nexusinf.it/

> "God is Real - unless declared Integer"

Other Threads