Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help for my first dll

Status
Not open for further replies.

koukouroukou

Programmer
Feb 6, 2002
38
0
0
GR
i created a dll with my forms and the basic ADO recordsets i need.I managed to call the forms (newfrm) and write into the sql table but only the values that comes right througt the dll form (newfrm).
How can i take the public values from my primary from to the newfrm?
 
your query wasnt so clear, did you want to pass values other than the ones through your form?
 
I would like to pass values from the form that calls the dll and creates the new form.These are values that are stored as Public from my .exe .
 
Your DLL can't get a value from anything else. DLL's are independant and work with functions and subs. Just think of using a DLL function as you would in a code module where you have no globals. This is an example of how a currency converter could be made in one EXE. Lets say you had a form with 2 text boxes.
[tt]
Global MyMoney as Currency

Private Sub Command1_Click()
MyMoney = txtOriginalAmount
txtConvertedAmount = Convert
End Sub

Public Function Convert() as Currency
Convert = MyMoney * 2.2
End Function
[/tt]
If we wanted to use a DLL instead for the conversion we would do this:
Form EXE
[tt]
Private Sub Command1_Click()
m_Convert as MyDLL.Convert

MyMoney = txtOriginalAmount
txtConvertedAmount = m_Convert(MyMoney)
End Sub
[/tt]
DLL Code
[tt]
Public Function Convert(ByVal MyMoney as Currency) as Currency
Convert = MyMoney * 2.2
End Function
[/tt]
I hope that helps to explain it a little. Craig, mailto:sander@cogeco.ca

Remember not to name the Lambs...
It only makes the chops harder to swallow
 
i understand all this and thank you very much.
my question realy is to send something back from the loaded form.
on the unload event of mydll.form to send something like this:
mystartupform.text1 = "test"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top