Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing by reference
Message
De
14/06/2002 17:10:05
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00668296
Message ID:
00668800
Vues:
31
"Container" class is not OLEPUBLIC, so the object reference has no meaning across COM. I second David about the @. about "thisform", is the form OLEPUBLIC?

>David
>
>No I can definitely pass the object through. I created a form and saved it as 'hf1.scx'
>
>On that form I have a commandbutton which has the following code
>
>
>oDll=CREATEOBJECT('d1.interface')
>lcnt=oDll.InterInit(@hf1)
>RELEASE oDll
>
>
>My dll has the following
>
>
>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'
>
>regards
>Geoff
>
>
>>Geoff,
>>
>>Ok, I'm pretty sure that you can't pass an object reference across the COM boundary.
>>
>>Why not let your app simply make calls into the COM object to carry out the allowed tasks? Or let your COM return a value that allows the app to instantiate the container itself?
>>
>>>I was getting an object does not exist message.
>>>
>>>The dll was created using VFP7
>>>
>>>I have an application which interfaces to multiple accounting packages. Each package has different options and settings. My DLL adds a container object to the main applications setting form with that interfaces options.
>>>
>>>The DLL also handles the mapping (import/export) functions to the main applications tables.
>>>
>>>The main application is generic in that the application tables vary from implimentation to implimentation.
>>>
>>>What I do not understand is how to create a pointer to my current form (ie @THISFORM or @THIS.PARENT)
>>>
>>>Also, when I check for the existence of a form it looks for a form using the name property for that form, yet I cannot reference the form object using that name.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform