Hi All,

I'm trying to implement a COM object in C#. This COM object implements
an interface defined in a tlb. One of the methods in this interface has the
signature:

HRESULT GetAddFormForTab( [in] BSTR strParentType,
                                  [in] BSTR strParentUniqueID,
                          [in] BSTR strTabName,
                          [out, retval] IcolFormElements **pFormElements );

'IcolFormElements' is another interface defined in another tlb.

I've used tlbimp to produce assemblies for both tlb's and implemented
an object in C#.

The compiling goes fine but when regasm is called on the produced assembly,
i
get a strange error as shown in the next paragraph:

COM Interop registration failed. Type library exporter encountered an error
while processing 'DotNetPlugin'.  -Error: Type library exporter can not load
type DotNetPlugin.DotNetPlugin (error: System.TypeLoadException: Method
GetAddFormForTab in type DotNetPlugin.DotNetPlugin from assembly
GetAddFormForTab does not have an implementation.).

Now, 2 things are strange.

First, the text 'from assembly GetAddFormForTab' ? There is
no 'GetAddFormForTab' assembly. It's a method!?

Second, why is this an error in the first place?

I of course made sure that this method IS implemented.

The IL produced by tlbimpl for this method looks like this:

.method public hidebysig newslot virtual abstract
        instance class
[COMPOSITEEMISSARYLib]COMPOSITEEMISSARYLib.colFormElements
        marshal( interface)
        GetAddFormForTab([in] string  marshal( bstr) strParentType,
                         [in] string  marshal( bstr) strParentUniqueID,
                         [in] string  marshal( bstr) strTabName) runtime
managed internalcall
{
  .custom instance void
[mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = (
01 00 03 00 00 00 00 00 )
} // end of method ICPConfigure::GetAddFormForTab

Has anyone faced the same problem? If so, what's the plan here?

cheers
Frederic






You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to