Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C0000005 upon vfp exe exit after responding to .net even
Message
From
02/05/2005 20:44:46
 
 
To
02/05/2005 17:46:20
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01010187
Message ID:
01010355
Views:
22
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform