Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 To: Jhonatan Perez
  Where is Jhonatan Perez?
 Maracaibo
 Venezuela
 Jhonatan Perez
Subject: RE: Add objects in a com server
Thread ID: 97988 Message ID: 97991 # Views: 5 # Ratings: 1
Version: Visual FoxPro 9 Category: Active X Controls & OLE Automation
Date: Wednesday, June 7, 2006 3:45:58 PM         
   



> I've developed a com server and i need to add objects from other com server. How can i do?
>
> This is the code:
>
> DEFINE CLASS persona as Session OLEPUBLIC
> nombre=""
> edad=0
> direccion=""
>
> PROCEDURE crear (nom as String,ed as Integer,dir as String)
> nombre=nom
> edad=ed
> direccion=dir
> ENDPROC
> ENDDEFINE
>
> DEFINE CLASS Server AS Session OLEPUBLIC
> ADD OBJECT jp as persona.persona
>
> * Other procedures and properties
> ENDDEFINE
>
> The error generated is: "ADD OBJECT jp as persona.persona
> Error in line 4: Command contains unrecognized phrase/keyword."


ADD OBJECT jp as OleControl WITH;
    OLEClass = [persona.persona]


Or I prefer that way:
 DEFINE CLASS Server AS Session OLEPUBLIC
        jp = NULL

   PROCEDURE Init
        this.jp = CreateObject([persona.persona])
   ENDPROC
ENDDEFINE


Borislav Borissov

ENTIRE THREAD

Add objects in a com server Posted by Jhonatan Perez @ 6/7/2006 3:24:01 PM
RE: Add objects in a com server Posted by Borislav Borissov @ 6/7/2006 3:45:58 PM
RE: Add objects in a com server Posted by Jhonatan Perez @ 6/7/2006 3:59:30 PM