Will VS 6.0 C++ #import a TLB created by regasm?

G

Guest

I have created a little C# project that produces a .DLL that is exposed as a
COM object using the regasm utility from the .Net Framework. Our formal
build process is all VS 6.0 C++ and VB, no .Net development components
installed at all. The build is breaking on the C++ code that tries to
#import the .tlb produced by regasm with this error message:

fatal error C1084: Cannot read type library file: 'DJMsCrmComObj.tlb': Error
loading type library/DLL

Notice that it does not say it cannot *find* the .tlb. It says it cannot
*load* the .tlb.

Should a pure VS 6.0 C++ development environment be able to use .tlb files
produced with regasm?
 
M

Mattias Sjögren

Should a pure VS 6.0 C++ development environment be able to use .tlb files
produced with regasm?

Yes. Have you had problems loading the typelib in any other situation?



Mattias
 
G

Guest

No, the compile works fine on my dev machine and the COM object loads up
without any trouble on that same machine. Is the #import trying to actually
load the associated COM object for execution? That definitely would not work
in the build machine but would be fine on my dev machine.

For the short term, could I just include the .tli and .tlh files produced by
#import? I know it's bad practice but I'm on a tight schedule and don't have
time to futz around with build issues.
 
C

Craig

Well, the resolution is this: we have to have the .Net framework installed
on the VS 6.0 C++ build machine. We don't need any .Net development pieces,
just the framework. I guess the framework updates some COM object to
properly handle .Net-generated typelibs.

Craig
 
M

Mattias Sjögren

Well, the resolution is this: we have to have the .Net framework installed
on the VS 6.0 C++ build machine.

Yes you do. Typelibs generated from assemblies reference Mscorlib.tlb
in the framework directory.



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top