Results 1 to 5 of 5

Thread: re-usable code

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    25

    re-usable code

    if i have a Class Module within an executable file, can i call a method from that Class from another executable file.

    Thanks
    Sam

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    No, you would have to create a DLL with the class file.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106
    You can instantiate the class in the second program, and use it, but how would you expect to use it across programs? An instance of the class would be much like a global variable of any other type. Would you realistically expect to be able to use that variable in a second program?

    Uh, in other words, no. If the second program is running, you could get the two to communicate such that you could use it, but calling a function in a separate execution space seems like a strange thing to allow. The address of the function would be different each time the other program ran.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    25
    thanks

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Ummm...... if it is a standard EXE, no. But if you create it as an ActiveX EXE, then yes you can, as long as the class is public as well.

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

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