Windows.Forms and the VO.App class

This forum is meant for questions and discussions about the X# language and tools
User avatar
ArneOrtlinghaus
Posts: 478
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Re: Windows.Forms and the VO.App class

Post by ArneOrtlinghaus »

No problem.
Anything else desired from our "antiquarian bookshop"? :-)
There are still lot's of examples from my collection of the period between 1999 and 2019.
Every time I look into I always hesitate deleting something. There is an inner voice that begins to say:
May be there is something that I need in an urgent case and nobody outside in this world can give me an answer.

Arne
User avatar
ArneOrtlinghaus
Posts: 478
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Re: Windows.Forms and the VO.App class

Post by ArneOrtlinghaus »

No problem.
Anything else desired from our "antiquarian bookshop"? :-)
There are still lot's of examples from my collection of the period between 1999 and 2019.
Every time I look into I always hesitate deleting something. There is an inner voice that begins to say:
May be there is something that I need in an urgent case and nobody outside in this world can give me an answer.

Arne
User avatar
Kees Bouw
Posts: 172
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

Re: Windows.Forms and the VO.App class

Post by Kees Bouw »

ArneOrtlinghaus wrote: Wed Sep 17, 2025 9:46 am No problem.
Anything else desired from our "antiquarian bookshop"? :-)
There are still lot's of examples from my collection of the period between 1999 and 2019.
Every time I look into I always hesitate deleting something. There is an inner voice that begins to say:
May be there is something that I need in an urgent case and nobody outside in this world can give me an answer.

Arne
Hi Arne,

At the moment I am interested in anything related to the "hybrid classes" ChildWinForm, VOWinFormApp, WinFormVOWindow and WinFormVOWindowHost. Examples, documents etc. So if you come across anything else like that in your antique bookshop, please share! Thanks again!

Kees.
User avatar
ArneOrtlinghaus
Posts: 478
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Re: Windows.Forms and the VO.App class

Post by ArneOrtlinghaus »

Here are the other files I have found. Three should be from Paul Piko and two from Willy Moore.

Arne
Attachments
VulcanVOWinForm-153-080917.zip
(1.99 MiB) Downloaded 677 times
Hybrid2.zip
(972.16 KiB) Downloaded 653 times
Hybrid1.zip
(972.9 KiB) Downloaded 627 times
VulcanWinformsrightSLE.ZIP
(3.56 MiB) Downloaded 702 times
VulcanVOrightSLE.zip
(654.21 KiB) Downloaded 708 times
User avatar
ArneOrtlinghaus
Posts: 478
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Re: Windows.Forms and the VO.App class

Post by ArneOrtlinghaus »

Ginny Caughey from the USA (making programs for real Garbage collectors with programs using Software Garbage collectors) also made a document many years ago about putting together Winforms and VO-GUI, but I didn't save the document and I don't remember if it gives many other information than the files I have sent.

Arne
User avatar
robert
Posts: 4891
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Windows.Forms and the VO.App class

Post by robert »

Guys,
I checked an old Vulcan installer, and the help file contains 2 samples
- HostingVOWindowSample.zip
- VOWinFormAppSample.zip

Maybe we can adjust these for X# and include them in the next Help file. I will see what I can do.
HostingVOWindowSample.zip
(28.11 KiB) Downloaded 750 times
VOWinFormAppSample.zip
(93.92 KiB) Downloaded 738 times
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Kees Bouw
Posts: 172
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

Re: Windows.Forms and the VO.App class

Post by Kees Bouw »

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.
Image

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).
Image

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.
Attachments
WindowsFormsHybrid.zip
(3.04 MiB) Downloaded 636 times
User avatar
robert
Posts: 4891
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Windows.Forms and the VO.App class

Post by robert »

Kees,
Make sure you copy the CATO*.DLL files to the output folder

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Kees Bouw
Posts: 172
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

Re: Windows.Forms and the VO.App class

Post by Kees Bouw »

robert wrote: Wed Sep 24, 2025 3:24 pm Kees,
Make sure you copy the CATO*.DLL files to the output folder
Robert
Hi Robert,

Yes, these files are in the output folder as can be seen in the zip of the solution I attached. So that is not the cause of the problems.

Kees.
User avatar
Chris
Posts: 5472
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Windows.Forms and the VO.App class

Post by Chris »

Hi Kees,

I don't think this sample and class was intended to be used like that. If you start with a Windows.Forms app, then the winforms form is supposed to be used as the "Shell" and not have again a VO style ShellWindow. Instead, you can show VO style DataWindows etc, hosted inside a winform.

If you want to keep using a VO Shell window, then I think you need to use the other sample, still have a VO style app and add winforms to it.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply