-
June 7th, 2010, 11:35 AM
#1
Why (LoadTypeLibEx failed : : Error loading type library/DLL. (Exception from HRESULT
Hello,
I am Loading type library from C++/CLI with following lines of code.
[DllImportAttribute("oleaut32.dll", SetLastError = true, CharSet = CharSet::Unicode, PreserveSig=false)]
static void LoadTypeLibEx( String^ strTypeLibName, RegKind regkind,[MarshalAs(UnmanagedType::Interface)] interior_ptr typeLib );
Object^ oTypeLib;
LoadTypeLibEx( strSubject,RegKind::RegKind_None, &oTypeLib);
It again and again giving me same exception, all I have registered type library with regsrv32, placed in current directory and given full qualified path but still its giving me same exception. Any way around?
Regards
Usman
Last edited by glitteringsound; June 7th, 2010 at 11:53 AM.
-
June 7th, 2010, 11:58 AM
#2
Re: Why (LoadTypeLibEx failed : : Error loading type library/DLL. (Exception from HRE
Why do you need PInvoke in C++/CLI? Call LoadTypeLibEx directly, as in good old C++. C++/CLI allows to write unmanaged code in any place.
-
June 7th, 2010, 01:06 PM
#3
Re: Why (LoadTypeLibEx failed : : Error loading type library/DLL. (Exception from HRE
I have done almost whole code of interop services using this managed syntax and declared every where objects of TypeLib and TypeInfo with managed type i.e ^.
LoadTypeLib is native and requires all native syntax. So ITypeLib^ won't work on this. Can you please tell me what's wrong with PInvoke calling code of LoadTypeLib.
I am getting issues of converting pin_ptr to managed and managed to pin_ptr and usage as whole of managed types in the code.
Last edited by glitteringsound; June 7th, 2010 at 01:13 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|