1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

vbSendMail -- convert for ActiveX usage

Discussion in 'Software Development' started by asbo, Jun 1, 2002.

Thread Status:
Not open for further replies.
Advertisement
  1. asbo

    asbo Thread Starter

    Joined:
    Sep 21, 2001
    Messages:
    507
    Ok, inder the direction of TimCottee, I have downloaded the vbSendMail DLL, only to find that that code provided in the documentation is not compatiable with the ActiveX components. Can anyone help me here?? The DLL is available at http://www.freevbcode.com/ShowCode.Asp?ID=109

    Thanks again
     
  2. IMM

    IMM Malware Specialist

    Joined:
    Feb 1, 2002
    Messages:
    3,259
    From their docs:
    ---------------------------
    If you get the error "Run time error 429: ActiveX component can't create object" when you run your application, the vbSendMail.dll either is not installed or not properly registered. Verify that the file is installed and manually run regsvr32.exe to register the dll. If you get a "LoadLibrary ("vbSendMail.dll") failed" message, check for a missing or incorrect version of the mswinsck.ocx. It has been reported that in some rare cases, manually registering the component does not resolve this issue. In those cases, building an installation package with the Package and Deployment Wizard, has solved the problem
    --------------------------
    You are using VB6 and not vb5? If vb6 what service pack level?
    What version of mswinsock.ocx do you have?

    You did register it with regsvr32 ??
    c:\windows\system\RegSvr32.Exe  <Path>\vbSendMail.Dll

    What exactly is the error message??
     
  3. asbo

    asbo Thread Starter

    Joined:
    Sep 21, 2001
    Messages:
    507
    Ok, heres where I stand:

    *This is designed to work on a webpage*

    I created my project, and later a module to go with the vbSendMail function, and when I add the code

    Private WithEvents poSendMail As vbSendMail.clsSendMail

    and run, it returns the error:

    Compile Error:

    User-type not defined.

    Everything else appears to work fine, but I am unable to get past this, and I am not sure even why this comes up.

    *cough* *cough* newby

    :)

    In response to your post IMM, my version of VB6 is same as install level, what ever that, I suppose SP0 :). As for registering it with the system, I see no point because this is, as mentioned above, supposed to work on a webpage, and if I can get it to work without any shimnanigans, all for the better. And, according Windows, mswinsock.dll does not exist. Unless I can be guarunteed that all of the visitors will have this, I'd really hope to find some alternate way of using it, hosting it at the site, maybe.

    Please forgive me for anything that is blantly not possible, I do not have much experience with internet-related programming, in fact, I have none before this. :p
     
  4. TimCottee

    TimCottee

    Joined:
    Oct 10, 2001
    Messages:
    186
    asbo:

    You generally need to register an activex dll with the system on which it is going to run. Now there is an exception to this in that you can just include the dll in the same folder as the application's executable and it will be found without having to be registered. It still needs to be declared in the project's references. If you are getting a compile error it is the latter that is the most likely cause. Open the References dialog and make sure that the vbSendMail component is checked. If it is not then this explains the error.

    As I understand what you are trying to do, with an ASP interface you would expect the vbSendMail dll to be installed and registered on the webserver rather than the client and use your submit process to send the appropriate information to your dll on the webserver that then uses the sendmail one to actually send the message. Is this right or have I misunderstood?
     
  5. asbo

    asbo Thread Starter

    Joined:
    Sep 21, 2001
    Messages:
    507
    Yes, that is what I am trying to do, TimCottee, and thanks for your help.
     
  6. asbo

    asbo Thread Starter

    Joined:
    Sep 21, 2001
    Messages:
    507
    Hmm... I did as you suggested and still in the string

    Private WithEvents poSendMail As vbSendMail.clsSendMail

    upon running/debigging, VB highlights WithEvents and gives a

    Compile Error:

    Only valid in object module.


    Any idea what this means??
     
  7. IMM

    IMM Malware Specialist

    Joined:
    Feb 1, 2002
    Messages:
    3,259
  8. TimCottee

    TimCottee

    Joined:
    Oct 10, 2001
    Messages:
    186
    An object module is either a "class module", "form", "usercontrol" etc, a standard module is not by definition an object module and therefore you cannot use WithEvents within it. In order to do this you would be better off creating a simple class module and using this.
     
  9. asbo

    asbo Thread Starter

    Joined:
    Sep 21, 2001
    Messages:
    507
    Ok, following TimCottee's suggestion, I added a Class Module and removed the normal module. Now when I run it, in the string

    Set poSendMail = New clsSendMail

    the debugger highlights Set and claims:

    Compile Error:

    Invalid outside procedure.



    Just so that everyone will know, I am about to install SP5 for VB 6.0 and see if that helps anything.


    Thanks for all your help.
     
  10. asbo

    asbo Thread Starter

    Joined:
    Sep 21, 2001
    Messages:
    507
    SP5 didn't make any difference.
     
  11. asbo

    asbo Thread Starter

    Joined:
    Sep 21, 2001
    Messages:
    507
    Can anyone help?
     
  12. briankm

    briankm

    Joined:
    Jun 12, 2002
    Messages:
    7
  13. asbo

    asbo Thread Starter

    Joined:
    Sep 21, 2001
    Messages:
    507
    Do you want the entire project or just for Command1?
     
  14. briankm

    briankm

    Joined:
    Jun 12, 2002
    Messages:
    7
    asbo,

    I have sent a small VB project --let me know how it works for you...

    Brian
     
  15. asbo

    asbo Thread Starter

    Joined:
    Sep 21, 2001
    Messages:
    507
    Will do.

    Thanks much.
     
  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/81882