Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access class method in .net dll from VFP9
Message
From
20/04/2008 17:10:17
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Access class method in .net dll from VFP9
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01311979
Message ID:
01311979
Views:
118
I have a .net dll (not mine - a 3rd party) that I registered using regasm /codebase that returned 'Types Registered Successfully.' I can successfully call class methods in the dll from C#. To do so, it is along the lines of:
using PowerPhone.CachStandard.API;
...
public string IP = "";
public int Port = 0;
private void btConnect_Click(object sender, System.EventArgs e)
    {
        string server = this.tbIP.Text.Trim();
        int port = int.Parse(nmPort.Value.ToString());

        //TRAPIClass class contains public methods
        int result = TRAPIClass.Connect(server,port);
        switch (result)
        {
           case (int)TRErrorCodeEnum.TR_OK:
           {
              // Each Session store its connection here
              DialogResult = DialogResult.OK;
              IP = server;
              Port = port;
              break;
           }
           case (int)TRErrorCodeEnum.TR_ERR_TCPCONNECTION:
           {

...etc.
I want to do the same from VFP9. I have tried:

DECLARE INTEGER TRAPIClass IN "PowerPhone.CachStandardAPI.dll" string, integer

Then:

lcserer = '127.0.0.1'
lnport = 5000 && these I set manually in the running service the api accesses
? TRAPIClass.Connect(lcServer,lnport) && returns 'Object TRAPIClass is not found.'

I've tried:

DECLARE INTEGER PowerPhone IN "PowerPhone.CachStandardAPI.dll" string, integer

Then:

lcserer = '127.0.0.1'
lnport = 5000 && these I set manually in the running service the api accesses
? PowerPhone.TRAPIClass.Connect(lcServer,lnport) && returns 'Object PowerPhone is not found.'



If I try:

o = CREATEOBJECT('PowerPhone.CachStandardAPI.TRAPIClass')

It returns 'Class definition 'PowerPhone.CachStandardAPI.TRAPIClass' is not found.'


It's something obvious I'm overlooking, but what?
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Next
Reply
Map
View

Click here to load this message in the networking platform