News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Reading Typelib

Started by TouEnMasm, November 10, 2012, 05:53:25 AM

Previous topic - Next topic

TouEnMasm

I have a problem reading a Typelib inside an exe
All is good until I call GetIDsOfNames
Quote
;Load the type library from our EXE's resources
invoke GetModuleFileNameW,g_hModule,addr WfileName,MAX_PATH
;LoadRegTypeLib
invoke LoadTypeLibEx,addr WfileName,REGKIND_NONE,addr ppvITypeLib
;invoke RegisterTypeLib,ppvITypeLib,addr WfileName, NULL
ITypeLib GetTypeInfoOfGuid,addr IID_IFrscript,addr ITypeInfo
ITypeInfo GetIDsOfNames,addr szfunct,1,addr rgDispID    ;access violation
Fa is a musical note to play with CL


TouEnMasm

 :icon_eek:
Need a proxy,midl can made one but ...
Fa is a musical note to play with CL

dedndave

oh - sorry Yves.....

see the attached

that's a shame - codeproject has a lot of good stuff on it   :redface:

TouEnMasm

The help file on the function is very confused.
I put a sample here.
Quote
.data
dispid          dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
rgszNames  dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
pcNames dd 0
.code
ITypeInfo GetNames,1,addr rgszNames,sizeof rgszNames,addr pcNames      
ITypeInfo GetIDsOfNames,addr rgszNames,pcNames,addr dispid
lea ebx,rgszNames
@@:
.if dword ptr [ebx] != 0
   mov ecx,[ebx]
   invoke SysFreeString,ecx
   mov dword ptr [ebx],0
   add ebx,4
   jmp @B
.endif
Fa is a musical note to play with CL