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
hi Yves
maybe this will help...
http://www.codeproject.com/Answers/365583/GetIDsOfNames-Returns-E_ACCESSDENIED#answer1 (http://www.codeproject.com/Answers/365583/GetIDsOfNames-Returns-E_ACCESSDENIED#answer1)
:icon_eek:
Need a proxy,midl can made one but ...
oh - sorry Yves.....
see the attached
that's a shame - codeproject has a lot of good stuff on it :redface:
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