Instantiate dll created in C# . net for VB6

Asked

Viewed 1,202 times

2

I have a dll that I want to consume, developed in c#, and I want to upload this dll to VB6. How can I do this? What steps should I follow?

Inside the VB6 code below you already have a call to this dll:

Dim mail As New MamMail
    Body = Replace(Body, vbCrLf, "</BR>")
    mail.SendMail smtpServer, smtpPort, smtpSsl, userName, Password, fromAddress, toAddress, cc, Subject, Body
    Set mail = Nothing
    Exit Sub

But when I compile in vb6 I get: compile error.User defined type not defined.

  • 1

    Here’s a step by step: http://answall.com/questions/47254/com-interop-com-client-e-server/47328#47328

2 answers

0


In its project of DLL do the following:

Configuration Properties -> Build configure the property Register for COM interop with the value True.

And in your project VB add reference to Type Library "Dataname";

Source.

0

VB6 calling components. Net is not recommended. Remember that VB6 support no longer exists. But if necessary, you should export your interface with the proper commands for this. See in this link more information.
Remember to set your dll to x86, otherwise there may be error in 64-bit module load.

  • Okay, I will do that. Thank you very much

Browser other questions tagged

You are not signed in. Login or sign up in order to post.