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 / September 2005

Tip: Looking for answers? Try searching our database.

Interop (c#, VB6) problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shesh - 22 Sep 2005 18:47 GMT
We have a C# class library (with interfaces and classes dervied from them).
This is refernced in a VB6 application and everything is fine.

Currently if the library is modified, then VB6 reference to that library
needs to be changed and VB6 app needs to be rebuilt for changes to be seen.
Is there anyway that we could decouple them? I mean modify the c# library
independent of VB6 app. After modifying the c# library, it just needs to be
copied to a directory where VB6 looks for that without changing the reference
or rebuilding it. Please give some pointers.
shesh - 22 Sep 2005 19:49 GMT
There is no issue when interop is between VB6 and VB.Net. Is it something
that is not supported in C#?
Mattias Sjögren - 22 Sep 2005 19:54 GMT
>Currently if the library is modified,

What kind of modifications are you doing? If you make breaking changes
to any interface the GUIDs will change, and that's a good thing. They
should remain the same as long as you only change implementation
details. You can always manually assign fixed GUIDs with the Guid
attribute on a type or the assembly.

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

shesh - 22 Sep 2005 20:20 GMT
Thanks Mattias. I assigned fixed GUIDs to the interfaces and classes. How do
I assign fixed GUID to the C# assembly?
Mattias Sjögren - 22 Sep 2005 20:54 GMT
>Thanks Mattias. I assigned fixed GUIDs to the interfaces and classes. How do
>I assign fixed GUID to the C# assembly?

[assembly: Guid("...")]

it becomes the LIBID for the typelib.

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

shesh - 22 Sep 2005 21:22 GMT
Thanks Mattias. I did this and everything worked fine. I even added a new
class, new mthod to the existing class in the .net dll but there was no need
to rebuild VB6 app. That's really great. Thanks again.

> >Thanks Mattias. I assigned fixed GUIDs to the interfaces and classes. How do
> >I assign fixed GUID to the C# assembly?
[quoted text clipped - 4 lines]
>
> Mattias

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.