Results 1 to 4 of 4

Thread: Anybody can help me out about DLL?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Posts
    2

    Question Anybody can help me out about DLL?

    Hi, everybody,

    I'm now stuck in the debugging of an application. I hope someone
    will help me out. The problem is as follows.

    I built a DLL component named "Comp". It contains a class module
    named "Mod". My client EXE application includes a class module
    named "Client". In "Client", I have the following code:

    Public myMod as New Comp.Mod
    ...........
    ...........
    Public Function Proc (Parameter goes here)
    Set myMod=New Comp.Mod (Problem occurs in this line.)
    ..........
    ..........
    End Function

    Each time it runs to the Set statement, it gives me an error
    message saying "Class does not support automation or does
    not support expected init".
    I set the reference to Comp.dll in the EXE application. I run the
    EXE application after I start the Comp.dll (It's in a separate project.). I tried to unregister Comp.dll and then register it
    again. It still doesn't work. Appreciate any possible solutions.
    Thanks.

    Mike

  2. #2
    New Member
    Join Date
    Sep 2001
    Posts
    9

    dont use set statement

    Hi

    You have declared in Public declarations like

    Public myMod as New Comp.Mod

    there is no need to use Set statement again. You can directly access the methods or functions in myMod.

    for eg:

    myMod.functionname(your parameters goes here)


    Vijay

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Posts
    2

    Thanks!

    Thank you all for your help. I have solved my problem.


    Mike

  4. #4
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    A small note to make:

    Using
    Dim Object as New Class

    is not good coding practice. It forces the object to be created the first time it is referenced (Which we won't complain about), but thereafter, VB checks to see if the object has been created on every call to that object. This will slow down your application incredibly.

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