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 / November 2006

Tip: Looking for answers? Try searching our database.

Problem in using C# dll in Vc++ project

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ashukasama@rediffmail.com - 11 Oct 2006 15:11 GMT
Hello All,

I have a dll created in c# visual studio 2005. i wanted to use this dll
in vc++ project created in visual studio 2003. I am doing following
steps for using the dll developed in 2005:
1. Exporting dll to tlb using tlbexp command provided by visual studio
2005.
2. Adding reference of generted tlb file in vc++ project.

It is causing problem in adding this tlb in vc++ project. Instead if we
create dll in visualstudio 2003 and create tlb out of it and use in
vc++ project it works fine.

Can somebody help me in resolving the backward compatiblity issue.

Thanks in Advance
Ashish
jiangsheng[MVP] - 15 Oct 2006 05:50 GMT
You can write an interface in 2003 and derive from it in 2005 ( you 1.x
assembly need to be referenced and will run on CLR 2.0). Declare an pointer
of the interface in the 1.x assembly and assign an object of the derived
class to it.

Another way is using events. Declare events in the 1.x assembly and handle
the events in the 2.0 assembly.

Signature

Regards
Sheng Jiang

Microsoft Most Valuable Professional in Visual C++
http://www.jiangsheng.net
http://blog.joycode.com/jiangsheng/

> Hello All,
>
[quoted text clipped - 13 lines]
> Thanks in Advance
> Ashish
ashukasama@rediffmail.com - 19 Oct 2006 06:10 GMT
Dear  jiangsheng,

i  am unable to understand what u want to say.
please explain it clearly so i can understand

thanks in advance
Ashish Kasama

> You can write an interface in 2003 and derive from it in 2005 ( you 1.x
> assembly need to be referenced and will run on CLR 2.0). Declare an pointer
[quoted text clipped - 28 lines]
> > Thanks in Advance
> > Ashish
murthy - 06 Nov 2006 12:56 GMT
Hi Ashish,

Use REGASM instead of tblexp.
This will make sure that your dll is registered in the registry.

Regards
Murthy

> Hello All,
>
[quoted text clipped - 13 lines]
> Thanks in Advance
> Ashish

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.