Information générale
Catégorie:
Visual FoxPro et .NET
Versions des environnements
Jim,
Thanks for the tip. I think I tried it correctly but I still get the same error. Here is more or less what I am attempting, just to try to get something simple to work:
Basically, I need to create a modeless .net form from a VFP app. The modeless form is actually a MDIparent. I need to respond to a couple of events from this form; one to refresh the VFP form when the user performs a certain function and one to tell the VFP app that the user has closed the .Net form. So I create the .NEt form with code like the following:
x=CREATEOBJECT("testfoxclass2.frmshell")
frmShell=x.ReturnForm
(the return form method returns the .net form object. I have also tried creating a separate thread using this method, but same results)
frmshell.show
(The .net form is displayed OK.)
Next I execute a .prg that sets the eventhandler as follows:
oEvents = NEWOBJECT("myclass")
zz = EVENTHANDLER(frmShell, oEvents)
RETURN
DEFINE CLASS myclass AS session OLEPUBLIC
IMPLEMENTS IJEEvents IN "c:\documents and settings\thompssj\my documents\visual studio projects\testfoxclass2\bin\testfoxclass2.tlb"
PROCEDURE IJEEvents_ShellClosed() AS VOID
frmshell = .NULL.
RELEASE frmshell
PUBLIC frmshell
ENDPROC
PROCEDURE IJEEvents_ButtonClicked() AS VOID
MESSAGEBOX(".net form button clicked")
ENDPROC
ENDDEFINE
I put the code: RAiseEvent ShellClosed() in the .net form_closed method. Have also tried putting it in the form_closing method.
When I close the .net form, the event is fired correctly and I release the VFP form object.
I then put the call to your Closer method after the READEVENTS of my simple VFP tester app:
x.closer
I release all the objects again before the VFP app quits.
Still get this goofy error.
Thanks for helping. I'm about to give up and use a little VB6 dll to raise the events between my .net dll and VFP. This works without any issues.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement