From the Vulcan example “HostingVOWindowSample.zip” I have tried to create a working X# example. Unfortunately there are several problems with it and I invite everyone to take a look and point out what I have missed or done wrong. I started by creating a new Windows.Forms application and a new form called HybridForm that can be shown with a button on the initial form. With Visual Studio closed I changed HybridForm to inherit from XSharp.WinFormVOWindow (instead of System.Windows.Forms.Form). Then I added a panel control to this form, created a VO.ShellWindow and added this to the panel in the same way it is done in the sample. The problems I have are these.
1) When one of the windows is closed, the whole application ends with a runtime error “System.NullReferenceException” in Program.prg on the line Application.Run( Form1{} ). Tried several things but I could not fix it.
Code: Select all
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=VOGUIClasses
StackTrace:
at VO.ShellWindow.Destroy(__Usual[] Xs$Args)
at VO.Window.__Close(Event oEvent)
at VO.AppWindow.Dispatch(__Usual[] Xs$Args)
at VO.ShellWindow.Dispatch(__Usual[] Xs$Args)
at VOGUIClasses.Functions.__WCShellWndProc(Void* hWnd, UInt32 uMsg, UInt32 wParam, Int32 lParam)
2) The VO.ShellWindow has a menu, but this menu is not shown on the HybridForm. Also the minimize/maximize and close buttons are missing. To demonstrate that all of that should be there I show the VO.ShellWindow also as it is (i.e. not hosted by a Windows.Forms form).
3) Closing the VO.ShellWindow or the HybridWindow ends the application (with a runtime error) while I would expect that the initial Windows.Forms form would remain until it is closed itself.
Attached is the sample solution. It is quite easy to follow (I think) and I am very curious to find out what is wrong or missing.
Kees.