Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can VFP call Powerbuilder COM objects?
Message
From
18/07/2006 11:44:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Third party products
Title:
Can VFP call Powerbuilder COM objects?
Miscellaneous
Thread ID:
01137267
Message ID:
01137267
Views:
55
Hi all,
Can VFP call Powerbuilder COM objects? This is probably my longest thread yet, please read thru. Any feedbacks/comments/anything welcome.

Let's assume that I have a PBCOM.DLL containing the classID of "COCLass_pbcom_functions" which contains a simple function called: "simple_multiplier(arg1 int, arg2 int)" which returns the Product of the two parameters.

I've tried the following:
1. This works in VB.Net (Windows application); I have a form with a button with the following code on the click event:
Dim cls As New pbcom.COClass_pbcom_functions
MsgBox(cls.simple_multiplier(2, 2))
2. This works in VB.Net (Console application); I have the following code in the Main method:
Dim cls As New pbcom.COClass_pbcom_functions
Console.WriteLine(cls.simple_multiplier(2, 2).ToString())
Console.Read()
3. Similar code works in C#.Net (Windows)

4. Similar code DOES NOT WORK in C#.Net (Console)

5. In VFP 8; I can see the object in the Object browser but this code snippet does not work:
ox = createobject("pbcom.COClass_pbcom_functions")
* Error message: Class definition pbcom.COClass_pbcom_functions is not found.
6. I tried using the INTERFACE option but the function always returns .T.
x=NEWOBJECT("myclass")
?x.Ipbcom_functions_simple_multiplier(2,2)

DEFINE CLASS myclass AS session OLEPUBLIC
   IMPLEMENTS Ipbcom_functions IN "d:\test\powerbuilder\test01\pbcom.dll" && "pbcom.COClass_pbcom_functions"
   PROCEDURE Ipbcom_functions_simple_multiplier(arg1 AS INTEGER, arg2 AS INTEGER) AS INTEGER
   * add user code here
      return dodefault(arg1,arg2)
   ENDPROC
ENDDEFINE
ramil
~~ learning to stand still
Next
Reply
Map
View

Click here to load this message in the networking platform