Results 1 to 4 of 4

Thread: ActiveX Exe Object Question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2000
    Location
    BC, Canada
    Posts
    142
    Could someone please tell me the difference using New or CreateObject to create a class object from an Activex exe.

    for instance I have class called printers.printclass(Exe) and Letters.Parameters(dll)

    then, In the Client code:

    Code:
       private jdp as Letters.Parameters
       Private WithEvents PrintL As Printers.PrintClass
       
       Set PrintL = New Printers.PrintClass
        'OR 
        Set PrintL = CreateObject("Printers.Printclass")
        'I just use one of above two lines
         'then jdp is created here
        PrintL.StartPrint jdp  'call the object method with a parameter
    I got an error from last line before starting executing all code, saying "error in loading dll"

    So, I would like to clarify the difference between New and CreateObject and If you could give me some leads on the error, that would be great too. Thanks for your help

  2. #2
    Guest
    If this is your dll, Is the dll correctly registered. vb is suppose to do it for you when you make the dll, but there are a lot of things vb is SUPPOSED to do. "regsrv32 dllname.dll"

  3. #3
    Lively Member
    Join Date
    Aug 1999
    Posts
    89
    To use the new, you'll have to add the reference if the object has no reference in your project. Where else with Creatobject, you don't have to have a reference. Once the reference is there, you can use the new keyword any where in your project. But for the createobject, as soon as you set it to nothing, you'll need to create the object again.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2000
    Location
    BC, Canada
    Posts
    142

    Thanks

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width