Results 1 to 3 of 3

Thread: activex dll doesn't survive after initialize

  1. #1

    Thread Starter
    Addicted Member c@lle's Avatar
    Join Date
    Oct 1999
    Location
    Belgium
    Posts
    179

    activex dll doesn't survive after initialize

    i'm trying to create an activex dll class.
    (new project, activex dll)

    then i add following functions:
    Code:
    Option Explicit
    
    Private Sub Class_Initialize()
        MsgBox "Initialize"
    End Sub
    
    Private Sub Class_Terminate()
        MsgBox "Terminate"
    End Sub
    
    Public Function HelloWorld()
        MsgBox "Hello World"
    End Function
    and i save this project.
    i create the dll (file - make project1.dll)


    then i call the dll via a html page:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    
    <html>
    <head>
    <title>Page title</title>
    <script language="JavaScript" type="text/javascript">
     oDLL = new ActiveXObject("Project1.Class1");
     oDLL.HelloWorld;
    </script>
    </head>
    <body>
    <a href="javascript:x();">blabla</a><br />
    </body>
    </html>
    the line with 'new' creates the initialize message, then immediately the terminate message and then an error 'automation server can't create object'...

    the object is instantiated, but doesn't life long enough to go into the variable oDLL and to call the hellowordl function?

    what's going wrong?

  2. #2

    Thread Starter
    Addicted Member c@lle's Avatar
    Join Date
    Oct 1999
    Location
    Belgium
    Posts
    179

    Re: activex dll doesn't survive after initialize


  3. #3

    Thread Starter
    Addicted Member c@lle's Avatar
    Join Date
    Oct 1999
    Location
    Belgium
    Posts
    179

    Re: activex dll doesn't survive after initialize

    nobody who can help me on this topic?

    what part of the question is not clear? i can run the activex dll from a visual basic exe and that works. then i can instantiate the object (and call thus the initialize function), then call the helloworld function and when the object get out of scope it is terminated...

    but when used via internet explorer it gets initialized, then immediately terminated and then throws an error when calling the helloworld function??

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