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



Hello!

Here's my situation:
..NET
**************************************
I've created a simple .NET C# Class Library that uses
System.Runtime.InteropServices.
In it, I define this interface (that exposes some basic functions):

[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface IServiceWrapper

that this class implements

public class ServiceFactory : IServiceWrapper

That's all it is in .NET C#.

After compiling I use
regasm ServiceProvider.dll /tlb:ServiceProvider.tlb
to create and register the type library.
***************************************


Visual Studio C++ 6.0
***************************************
In some class in an MFC project:
....
#import "c:\ServiceProvider.tlb"
using namespace ServiceProvider;
.....
.....
double MyClass::SomeFunction()
{
  HRESULT hr;
  hr = CoInitialize(0);
  double jj = 0;

  try
  {
    IServiceWrapperPtr pCOMWrapper(__uuidof(ServiceFactory));
    jj = pCOMWrapper->SomeFunction();
    char buffer[20];
    _itoa (jj, buffer, 10);
  }
  catch (_com_error error )
  {
    char buffer[256];
    wsprintf(buffer, "Error: 0x%x %S", error.Error(),
error.Description());
    AfxMessageBox(buffer, MB_OK);
  }

  CoUninitialize();

  return jj;
}
***************************************

Ok. What I am doing is using .NET DLL's in a Visual C++ 6.0 project
using Interop.
In my machine all goes smoothley.

The error I specified happens when I use the .NET DLL and TLB in
another machine.
I've tryied to register the TLB using regtlib but the error persists.

I'm a newbie at .NET framework and I hope you can clear my doubts.

Many thanks!

.