Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp RIP ?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01201291
Message ID:
01202278
Views:
18
Hi Paul, MessageBox and CreateObject! are not implemented in the runtime. Belows is the code adapted for the current functionality, note that I inheriting from System::Object because the online compiler has not definition of Custom (a VFP Class).

Note that your code is the same, I'm providing a Quick and Dirty implementation of MessageBox.

This compiles ok with the compiler but fails to resolve System::windows::forms, because the online compiler does not references the assembly System.windows.forms.dll
o = CusTest()
o.Init()
o.Destroy()
o = .F.

FUNCTION MessageBox
LPARAMETERS cMessage, nButton, cCaption
TLOCAL nButtons as System::windows::Forms::MessageBoxButtons
nButtons = 1
System::Windows::Forms::MESSAGEBOX::Show(cMessage as System::String,cCaption as System::String,nButtons)

FUNCTION MessageBox
LPARAMETERS cMessage as System::String, nButtons as Integer
=MESSAGEBOX(cMessage,"",nButtons)


DEFINE CLASS cusTest
   cInitMessage = "Test Init"
   cDestroyMessage = "Test Destroy"

   FUNCTION Init()
     MESSAGEBOX(This.cInitMessage, 64 + 4, "Test")     
   ENDFUNC

   FUNCTION Destroy()
     MESSAGEBOX(This.cDestroyMessage, 64, "Test")
   ENDFUNC
ENDDEFINE
Previous
Reply
Map
View

Click here to load this message in the networking platform