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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLL Problem Ergent

Status
Not open for further replies.

koukouroukou

Programmer
Feb 6, 2002
38
0
0
GR
How a DLL Knows whitch form raised it and make a refernce to that form.
Please Help me
 
Not sure why you would need to know which form created an instance of a class but assuming you do then,

Add a property to a class within the DLL that takes a form e.g.

Private frmForm As Form

Public Property Get ParentForm() As Form
Set ParentForm = frmForm
End Property

Public Property Set ParentForm(ByRef Value As Form)
Set frmForm = Value
End Property

When you create an instance of the class within the form, you can now pass a reference to the form to the class.

set objClass = new Class
set objClass.ParentForm = Me

If you need to find out which form created the class aat a later date then you just reference the ParentForm property.

Debug.Print Class.ParentFor.Caption

Hope this helps with your problem.
Andy
 
i wanted on the unload event of my_dll_form to pass back to my parent form the property of an active-x.
thanks a lot i will try it on monday.
 
Dear Andyduke
I was a total failure.I wasnt able to make the dll to see the form here my steps and my question with more details and maybe you can help me some more.

1 call the dll from Form1
2 call a form within the dll Dll_form
3 trasfer data from form1 to DLL public variables
4 i use the dll_form for connection to sql and all my other functions

So far all OK my problem now:
5 on Dll_form unload i want to activate an active x control on Form1 but my dll_form ignores the existance of Form1


thanks on advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top