|
-
Sep 3rd, 2007, 03:08 AM
#1
Thread Starter
Lively Member
COM object vs interface
Hi,
I am trying to expose my classes from VB.NET to VBA. I am currently writing my own interface for each class e.g.:
Imports System.Runtime.InteropServices
<Guid("4c42de70-4bdf-11dc-8314-0800200c9a66"), _
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)> _
Public Interface _Optimizer
...
End Interface
and afterward link the interface with my classes and so they are exposed to VBA.
There is another possiblilty I just realized in .NET and that is to select a COM class in the wizard (Add>new item>COM class)
Since I am new to interface programming, what is the difference? It seems that I do not have to write any interface at all with the second method.
It would be great if someone can elaborate this.
Thanks
-
Sep 10th, 2007, 10:55 AM
#2
Re: COM object vs interface
What kind of .NET project (VS 2003?) do you start with to create a COM Object creatable using CreateObject?
Thanks!
Dave
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Sep 11th, 2007, 03:46 AM
#3
Thread Starter
Lively Member
Re: COM object vs interface
Hi Dave,
I use VS2005. I am not sure what you mean by createobject. I click with the right mouse button on my vb project and than (Add>new item>COM class)
-
Sep 24th, 2007, 06:49 AM
#4
Re: COM object vs interface
Visual Studio automatically creates all of the necassary interfaces when you create a COM class.
-
Sep 24th, 2007, 09:12 AM
#5
Re: COM object vs interface
Does it have to be a special type of project? Does this work with 2003?
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Sep 24th, 2007, 05:55 PM
#6
Re: COM object vs interface
The ComClass is new in 2005.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|