COM problem

S

Steven Blair

I am attemtping to create a C# which can be used in my C++ app.
Here is my source.

http://pastebin.com/671099

Register for COM Interop is checked and the following warning is
displayed when I build:

Warning 1 "C:\Documents and Settings\sblair.TS3INTERACTIVE\My
Documents\Visual Studio 2005\Projects\Com Test1\Com
Test1\bin\Debug\Programming_CSharpDLL.dll" does not contain any types
that can be registered for COM Interop. Com Test1

As a further test, I ran:
Projects\Com Test1\Com Test1\bin\Debug>tlbexp Programming_CSharpDLL.dll
/out:programming_CSharpDLL.tlb

This generates me a tlb file and viewing in OleViewer indicates that
there no methods available to use.

Can anyone help me out with this problem?

Steven
 
W

Willy Denoyette [MVP]

|I am attemtping to create a C# which can be used in my C++ app.
| Here is my source.
|
| http://pastebin.com/671099
|
| Register for COM Interop is checked and the following warning is
| displayed when I build:
|
| Warning 1 "C:\Documents and Settings\sblair.TS3INTERACTIVE\My
| Documents\Visual Studio 2005\Projects\Com Test1\Com
| Test1\bin\Debug\Programming_CSharpDLL.dll" does not contain any types
| that can be registered for COM Interop. Com Test1
|
| As a further test, I ran:
| Projects\Com Test1\Com Test1\bin\Debug>tlbexp Programming_CSharpDLL.dll
| /out:programming_CSharpDLL.tlb
|
| This generates me a tlb file and viewing in OleViewer indicates that
| there no methods available to use.
|
| Can anyone help me out with this problem?
|
| Steven
|
|
|
|

Take a look at the AssemblyInfo.cs file, the ComVisible attribute for the
whole project is set to false, that means that no single type is exported in
the generated typelib.
What you should do is set this attribute to true, or you have to apply the
attribute on each type you want to make visible to COM clients individually.

Willy.
 
S

Steven Blair

Excellent, its working now.

Just another question though, will my class have its memory released by
the Garbage Collector, or should I be inheritting from IDisposable?.

And one last thing, how much of a performance hit in using this COm to
C# technique?
 

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