.net - Importing a VB6 dll into a c# project -


i'm trying use object made id vb6 c# project, don't have vb6 source code. did steps:

1) register mail.dll (thats vb6 dll);

2) add reference appears on com;

3) import code.

i create object. when tried call method sendmailsmtp dll got error: activex component can't create object(429)

this error common when dll not registered. registered success. there other way create vb6 dll correct interoperability ?

my code:

using system; using system.collections.generic; using system.linq; using system.text; using smtpmail;  namespace consoleapplication1 {    class program    {         static void main(string[] args)         {             string msgretorno = "";             clssmtpmail smtpmail = new clssmtpmail();             string = "test@test.com.br";             string = "test@test.com.br"; ;             string cc = "";             string subject = "teste subject";             string corpo = "mensagem de teste";              string profilesmtp = "";             string passwordsmtp = "";              try              {                  msgretorno = smtpmail.sendmailsmtp(from, to, cc, subject, corpo, profilesmtp, passwordsmtp, null);              }             catch (exception e)              {                 msgretorno = e.innerexception.message;             }         }     } } 


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -