Click to See Complete Forum and Search --> : Can't Load Type Library
mamo
February 20th, 2003, 11:21 AM
I am getting a compilation error when doing:
#import "myexe.tlb" raw_interfaces_only named_guids
The error that I get is:
fatal error C1084: Cannot read type library file: 'mydll.tlb': Error loading type library/DLL.
I have also tried loading the exe directly ie. #import "myexe.exe"..., and I get the same error.
I created a test app that calls LoadTypeLib(L"mydll.tlb", &ptLib). And this seems to work(it returns S_OK).
Any ideas?
Thx.
pareshgh
February 21st, 2003, 12:29 PM
i guess the tlb isn't in proper path.
or plz specify the path of tlb.
i am not sure wether u can load exe or not.:o
-Paresh
mamo
February 21st, 2003, 02:09 PM
actually if it put the full path I get the same error:
#import "c:\my file path\myapp.tlb".....
if I put a inproper tlb name, then I get a different error (file not found). There seems to be something with "loading" or "opening" the file.
pareshgh
February 21st, 2003, 02:33 PM
so what exactly u r trying to do. if u have a COM component then u will have a dLL right. that u can add it by project refrence also. its quick easy and handy. than these import things.
:D
Paresh
mamo
February 24th, 2003, 11:22 AM
I must import because I only have the binary for the COM interface.
pareshgh
February 24th, 2003, 12:41 PM
binary in terms of DLL ?
i think if you have a dll why don't try an adding with reference.
are you using VS.NET IDE editor ?
Paresh
mamo
February 24th, 2003, 02:12 PM
>binary in terms of DLL ?
Actually it is an .EXE
>i think if you have a dll why don't try an adding with reference.
Can this still be done with a .EXE?
>are you using VS.NET IDE editor ?
Yes, 2003 Final Beta.
pareshgh
February 24th, 2003, 04:04 PM
oh ! I understood .. i think its an Inproc exe. why don't you make a dll out of it ..
so you don't need to run. just provide methods and call it from .NET.
isn't that good idea ?
Paresh
mamo
March 12th, 2003, 11:21 AM
For anyone who runs into this issue.....
In order to load a type library, all dependent type libraries must either be in the same directory path as the type library that you are trying to load or the dependent tlbs must be registered on the system.
If none of the above have been done, and your tlb uses references other type libraries you will get a
fatal error C1084: Cannot read type library file: 'mydll.tlb': Error loading type library/DLL.
pareshgh
March 12th, 2003, 04:30 PM
its not necessary to have in same folder, but in path is ok.
although registeration is the key factor without which you can't do loading or even create an instance. !!!
check my earlier posts.
;)
I guess your problem is been solved ! :D :D :D
-Paresh Gheewala
rahuld
September 13th, 2006, 05:08 AM
binary in terms of DLL ?
i think if you have a dll why don't try an adding with reference.
are you using VS.NET IDE editor ?
Paresh
hi ...
i am in same problem as mome ....
but i have to do only by #import" " mathod ..
i am using Vsual Studio2005 and in my workspace there is a NNN.tlb ..
only one project(NNN) creating file NNN.tlb get bulid successfully with
warning "MIDL2469 ignore :-no_robust commond" and making NNN.tlb
file .but other project(xxx) in same workspace /solution using NNN.tlb(#import "NNN.tlb" raw_interface_only) .
on building project xxx .it shows error c1084 :can't read NNN.tlb file ..
can u solve my problem ...
Thanx in advance..
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.