Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing by reference
Message
 
 
To
14/06/2002 00:31:36
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00668296
Message ID:
00668500
Views:
27
Geoff,

>No I can definitely pass the object through. I created a form and saved it as 'hf1.scx'

That's cool.

>On that form I have a commandbutton which has the following code
>

Objects are always passed by reference in any method.function call. Does this work for you?
oDll=CREATEOBJECT('d1.interface')
lcnt=oDll.InterInit(thisform)
RELEASE oDll

DEFINE CLASS Interface AS CUSTOM OLEPUBLIC
 PROCEDURE InterInit
 PARAMETERS pForm as Form

 WITH pForm
  .AddObject('myContainer','Container')  && Add a Container to the form
  .myContainer.height=150
  .myContainer.width=150
  .myContainer.top=1
  .myContainer.left=1
  .myContainer.visible=.T.
 ENDWITH

 RETURN pForm.myContainer
ENDPROC
ENDDEFINE
>
>this adds the container to my form. What I dont understand is why I cannot pass 'THISFORM'

Also, you might simply return the Name of the container to the form with a return "myContainer" and let the form reference it that way. This might help prevent dangling object references.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform