Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / August 2003

Tip: Looking for answers? Try searching our database.

problems with CCW

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Perecli Manole - 28 Aug 2003 09:28 GMT
I have several problems with COM Callable Wrappers implementation. Please
answer any of the ones you know:

1. Can't get the ProgIdAttribute("Name") to work. I use
ComClassAttribute(guid,guid,guid) for all my exposed classes so I was
wondering if there is a conflict between these two Attributes. Does
ComClassAttribute cancel ProgIDAttribute?

2. I have read in several places that the ComClassAttribute() simplifies the
setting up of classes  to be exposed through COM but no where have I found
what the alternative to this class is. I get the feeling that it is more
involved but maybe can be more flexible.

3. Can't get the ClassInterface(ClassInterfaceType.AutoDispatch) to work as
an alternative to ComClassAttribute(). It is supposed to build an interface
automaticaly based on the members of the class but the class ends up having
no members through COM.

4. I have read in several places that exposed classes derived from other
classes get flattened when exposed to COM but my first hand experience shows
me otherwise. I can only see the members that are in the imediate class. The
ones derived are not visible through COM. What am I doing wrong?

5. The only way I could get the .NET class to be exposed through COM is to
register it with the GAC and make it a strong named assembly but I have read
that this is not necessary. How do I do it without these steps?

6. Is there an article out there that shows best practices for designing CCW
with step by step examples? The MSDN docs are very limited. There are so
many CCW class attributes but they are not explained in depth.

Thanks
Perry
Christian Fröschlin - 28 Aug 2003 11:19 GMT
> 3. Can't get the ClassInterface(ClassInterfaceType.AutoDispatch) to
> work as an alternative to ComClassAttribute(). It is supposed to
> build an interface automaticaly based on the members of the class but
> the class ends up having no members through COM.

All members can be accessed late bound, but don't show up in
browsers. What you want is AutoDual instead of AutoDispatch.
Perecli Manole - 28 Aug 2003 12:26 GMT
OK, I see. But when I use this instead of the ComClassAttribute the events
do not show.

>  > 3. Can't get the ClassInterface(ClassInterfaceType.AutoDispatch) to
>  > work as an alternative to ComClassAttribute(). It is supposed to
[quoted text clipped - 3 lines]
> All members can be accessed late bound, but don't show up in
> browsers. What you want is AutoDual instead of AutoDispatch.
Christian Fröschlin - 28 Aug 2003 13:16 GMT
> OK, I see. But when I use this instead of the ComClassAttribute the
> events do not show.

You need to explicitely define interfaces like this

<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)> _
Public Interface TestEventInterface
    Sub TestEvent()
End Interface

<ClassInterface(ClassInterfaceType.None), _
ComSourceInterfaces("TestLib.TestEventInterface")> _
Public Class TestClass
  Public Event TestEvent()
  ...
End Class

I don't know if this can be done together with CIT.AutoDual. If you use
CIT.None, you must also explicitely define all interfaces to be exposed
for your class (which must implement them). Only interface members are
then exposed to COM.
Perecli Manole - 30 Aug 2003 07:45 GMT
If one of my functions return a GUID I noticed that the COM wrapper exposes
this type but how can this be used from the COM side when it doesn't know
what type this is. How can I handle conversions from .NET types to COM
types?

Perry

>  > OK, I see. But when I use this instead of the ComClassAttribute the
>  > events do not show.
[quoted text clipped - 17 lines]
> for your class (which must implement them). Only interface members are
> then exposed to COM.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.