
Adding external modules to a project...need help calling them
In your module (and if they are part of your project now, they are not
external modules anymore) you will have to also reference the form that the
textbox is on. So, if your txtDns1 is on Form1, then in your Module you
would do:
value = Form1.txtDns1.Text
Kevin Williamson - Microsoft Visual Basic Support
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved.
--------------------
| Subject: Re: Adding external modules to a project...need help calling them
| Date: Mon, 1 Oct 2001 16:06:49 -0500
| Lines: 133
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
| Newsgroups: microsoft.public.vb.com
| NNTP-Posting-Host: h20s112a184n47.user.nortelnetworks.com 47.184.112.20
| Path: cppssbbsa01.microsoft.com!tkmsftngp01!tkmsftngp04
| Xref: cppssbbsa01.microsoft.com microsoft.public.vb.com:20023
| X-Tomcat-NG: microsoft.public.vb.com
|
| The global variables part is working, however, there is another problem
now.
| I have some text boxes on my main form (e.g. txtDns1). When I try to run
| the program, I get a "Compile error: Variable not defined" and is
| referencing txtDns1. The information that is in the text box (on the main
| form) needs to be able to be accessed by the newly added module. How can
I
| make all of the information that is inputted into my text boxes (on the
main
| form) available to the code that needs to be executed by the external
| module?
| --
| James McGril
| New VB6 Programmer
| > James,
| >
| > You definitely don't want an ActiveX EXE. Just create a Standard EXE.
| > Then add your main form. Then add the 3 modules. You can do all of
this
| > through Project->Add xxxx. You will have to put all of your public
| > variables in one of the modules in order for them to be global,
otherwise
| > they will be part of an instance of a form. Then from your form all you
| > have to do is type the function name.
| >
| > Kevin Williamson - Microsoft Visual Basic Support
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| > You assume all risk for your use. ? 2001 Microsoft Corporation. All
rights
| > reserved.
| >
| > --------------------
| > | Subject: Re: Adding external modules to a project...need help calling
| them
| > | Date: Mon, 1 Oct 2001 14:09:33 -0500
| > | Lines: 65
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
| > | X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
| > | Newsgroups: microsoft.public.vb.com
| > | NNTP-Posting-Host: h20s112a184n47.user.nortelnetworks.com
47.184.112.20
| > | Path: cppssbbsa01.microsoft.com!tkmsftngp01!tkmsftngp05
| > | Xref: cppssbbsa01.microsoft.com microsoft.public.vb.com:20019
| > | X-Tomcat-NG: microsoft.public.vb.com
| > |
| > | Whoa! Over my head...I think...Lets see if I can understand this one.
| > |
| > | So now I have an ActiveX exe. I have added the 3 modules and on the
| main
| > | form I have declared all of my public variables so they should be
| > available
| > | everywhere. I have a command button and when it is clicked I want it
to
| > | "call" the code in the external module (.bas) depending on the option
| > button
| > | selected. Is it possible that way?...Or do I have to create and
ActiveX
| > | dll. If so, do I simply add the .dll to the project and just "call"
| it".
| > | What would the syntax look like?
| > |
| > | Desperately need help! :)
| > |
| > | --
| > | James McGril
| > | New VB6 Programmer
| > | > You will need to add the module to your project when you compile it.
| > Then
| > | > all of the code will be withing that one standard EXE.
Alternatively
| > you
| > | > could create an ActiveX DLL or ActiveX EXE and call the objects that
| > way,
| > | > but you would have to change everything from being in a module to
| being
| > in
| > | > a class.
| > | >
| > | > Kevin Williamson - Microsoft Visual Basic Support
| > | > This posting is provided "AS IS" with no warranties, and confers no
| > | rights.
| > | > You assume all risk for your use. ? 2001 Microsoft Corporation. All
| > rights
| > | > reserved.
| > | >
| > | > --------------------
| > | > | Subject: Adding external modules to a project...need help calling
| them
| > | > | Date: Mon, 1 Oct 2001 09:36:57 -0500
| > | > | Lines: 13
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
| > | > | Newsgroups: microsoft.public.vb.com
| > | > | NNTP-Posting-Host: h20s112a184n47.user.nortelnetworks.com
| > 47.184.112.20
| > | > | Path: cppssbbsa01.microsoft.com!tkmsftngp01!tkmsftngp04
| > | > | Xref: cppssbbsa01.microsoft.com microsoft.public.vb.com:19996
| > | > | X-Tomcat-NG: microsoft.public.vb.com
| > | > |
| > | > | OK...here we go...
| > | > |
| > | > | I need to add 3 external modules (.bas) to my standard .exe. I
have
| > one
| > | > | command button and 3 option radio buttons on the form. When the
| > command
| > | > | button is "clicked" I need the code from the appropriate external
| > module
| > | > to
| > | > | be executed depending on which option radio button is selected.
How
| > do
| > | I
| > | > | "call" the external module to run the code?
| > | > | --
| > | > | James McGril
| > | > | New VB Programmer
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|