Software Components Home

Invalid use of New keyword

Back

Question:
I am getting the message "Invalid use of New keyword" for the first line.

Answer:
The "invalid use of New keyword" is probably due to the fact that you added the component via "Project/Components..." in the VB6 IDE vs. adding a reference via "Project/References...". Remove the Chilkat Email component by unchecking the checkbox under Project/Components and add the reference by checking the checkbox under Project/References. That should fix the problem.

(Project/Components is used when you are going to drop the MailMan object onto a VB form. If you create the mailman dynamically, you want to reference it.)

    Dim mailman As New ChilkatMailMan2
    mailman.UnlockComponent "test"
    
    mailman.SmtpHost = "smtp.comcast.net"
    mailman.SmtpPort = 465
    mailman.SmtpSsl = 1