Results 1 to 3 of 3

Thread: Simple Problem

  1. #1
    manishmenghani
    Guest
    Hii

    I m stucked into a very simple problem , please help me

    I had developed a Standard Exe proj and anActivex Dll proj .
    In the ActiveX Dll proj , I created a module and add a public sub into it say "Create()". Now I want to call this sub from my standard exe proj . Ihad given the reference of that proj also even though it says method not defined .

    -------Standard Exe proj -------

    public sub Main()
    Create
    end sub

    --------End----------


    ----Active X Dll-------------
    ----In a module-------

    public sub Create()
    'VB Code Inside
    End sub

    -------End-----------

    what could be the problem ????


    Thanks in Advance

  2. #2
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    To the best of my knowledge, anything declared Public in standard modules is accessible only in the same project. So if you want the Create() procedure to be available to other applications, either make it a public method of a class in the ActiveX DLL, or create a public method in a class which will execute this Create() procedure which is in a standard module.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  3. #3
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Put the Create function in a class module, and change the class module's Instancing property to 6 - GlobalMultiUse.
    Then you will be able to use it as a global function in the Standard EXE project that uses the DLL, but not in the ActiveX DLL project.
    If you want to use it as a global function in the ActiveX DLL project, you need to put it in a module.
    If you want to use it as a global function in both projects, put it in a module and make a GlobalMultiUse class that has a function which simply calls the function in the module.

    (Had to smuggle this face into the post somehow)

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