Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
| Search | Today's Posts | Mark Forums Read
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 30th, 2006, 01:07 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , .
Posts: 121
Thanks: 1
Thanked 0 Times in 0 Posts
Default Using .NET Dll from VB6 application

Hello everybody,
I've created the DLL in VB.NET and then try to reference this DLL inside my VB6.0 application. But it does not give me the chance to reference this DLL. The Error:

Can't add the reference to the specified file.

I think there are some interop issues. Does anybody have any examples how to do this?

Thanks in advance,
 -Dmitriy
  #2 (permalink)  
Old January 30th, 2006, 01:34 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there.. are you sure you can do this?? i know you can reference vb6 dll's in .net.. but the other way i never heard...

HTH

Gonzalo
  #3 (permalink)  
Old January 30th, 2006, 01:55 PM
Authorized User
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dmitriy: yes this is possible

In brief, in your .NET assembly you will need to expose each class's methods and properties by marking that class with a special COM interoperable attribute.

To deploy your .NET assembly so that you can consume it from unmanaged (eg. VB6) code you can use the .NET tool "REGASM"

There's a hell of a lot of stuff out there on this topic, so a few good web searches should get you in the right ballpark
  #4 (permalink)  
Old January 30th, 2006, 02:10 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , .
Posts: 121
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Yes I want to do this. What is the reason? I need to create the VB6 application which supposes to send a ton of e-mails. This application utilized the Outlook object. I’ve created this app. and it worked perfectly till the moment I've installed the SP3 for Outlook 2000. The new security package starts to pop-up the security warning:
"A program is trying to access your Address Book"
(http://support.microsoft.com/kb/262618/EN-US/)
So, it is not possible to suppress this message.
I've decided to send an email from the Exchanger Server without using
The Outlook Object library. I've done this in ASP.NET before and it works. I've created DLL in .NET to use one in my VB6 application...

Maybe there is some different way to do this?

-Dmitriy
  #5 (permalink)  
Old January 30th, 2006, 02:15 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

thanks gcianfanelli for clarify that.

HTH

Gonzalo
  #6 (permalink)  
Old January 30th, 2006, 04:43 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , .
Posts: 121
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I found the detailed description how to do this. For developers who interested there are two helpful links:

http://support.microsoft.com/default...b;en-us;817248

http://msdn.microsoft.com/library/de...lregasmexe.asp

Thanks to everybody.
-Dmitriy
:)


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use vb6.0 ocx or dll in asp.net 1.1 Pramods ASP.NET 1.0 and 1.1 Basics 1 June 22nd, 2007 06:32 AM
VB6 DLL in ASP.NET 2.0 thenoseknows ASP.NET 2.0 Professional 1 March 2nd, 2007 05:04 PM
Use .net dll in VB6? wakeup .NET Framework 2.0 3 March 8th, 2006 05:39 PM
Using .NET DLL from inside VB6 application Dmitriy General .NET 1 January 30th, 2006 04:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.