Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Publishing Events in a VFP DLL
Message
From
15/12/2008 15:17:11
 
 
To
15/12/2008 00:15:24
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01367304
Message ID:
01367600
Views:
8
>Look at my article "Integrating .Net WinForms with Visual FoxPro" on my web site. It shows how to use the Interop Toolkit with VFP. Granted, it uses VB, but a Google search will find an equivalent C# tool.
>
>>I'm creating a COM server for use in C#, the process it runs is a bit lenthy so I would like to create Progress event. I've looked at "Visual FoxPro and Advanced COM", but I'm not really getting how I would create an event that I can then access from C#.
>>
>>A rough outline of what I'm trying to do: (Not Runnable)
>>
>>
>>DEFINE CLASS MyVFPClass AS SESSION OLEPUBLIC
>>
>>  PROCEDURE Go()
>>    *** Lengtly process goes here.
>>    d = DATETIME()
>>    c = d
>>    DO WHILE DATETIME() - d < 10
>>      IF c != DATETIME()
>>        IF (DATETIME() - d) % 2 = 0
>>          *** Event Called Here 
>>          THIS.Progress()
>>        ENDIF
>>        c = DATETIME()
>>      ENDIF
>>    ENDDO
>>  ENDPROC
>>    
>>  PROCEDURE Progress()
>>    *** I want this to trigger an event in C#
>>  ENDPROC
>>
>>ENDDEFINE 
>>
>>
>>
>>  // C# Background worker thread.
>>  public class cVFPSession
>>    {
>>    public cVFPSession()
>>      {
>>      MyVFPClass _VFP = new MyVFPdll.MyVFPClass();
>>      MyVFPClass.Progress += Progress();
>>      MyVFPClass.Go()
>>      }
>>
>>    public void Progress()
>>      {
>>      // Report Progress using Background worker .ReportProgress;
>>      }
>>    }
>>
>>
>>Note: My other option is to create this as an EXE and use some form of inter process communication. Might that be a better solution?

Looks interesting... But one quick question before I dig into and find that it doesn't have what I need. The diagram shows events being published in VB and being consumed in VFP. I need to publish the even int VFP. Is that just missing from the diagram?

I'll have to download it and take a peak at the code but this looks like way more than I need. The VFP has no visual interface and it's only progress data that I want to share.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform