Empty window in 64 bit app Visual Studio 12

Forum for reporting problems
Post Reply
Ibi
Posts: 19
Joined: Mon Jul 29, 2013 12:44 am

Empty window in 64 bit app Visual Studio 12

Post by Ibi »

Hi
When I pick Kernelcad object and place it on my windows form on visual studio 12,
only a wire frame box appears at the design time with a message saying (unfortunately I do not have the exact message
".... 64 bit .. object will appear when program runs".
And when I run the program nothing happens. On my lap top all working well
Ibi

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: Empty window in 64 bit app Visual Studio 12

Post by nickz »

Hi Ibi

There are two issues:

1. In form editor 64 bit component should work like that. It does not show the 3d model in form editor, instead it shows a warning that it will be OK at runtime. It is caused by the fact that the Visual Studio itself is a 32 bit application (64 bit does not exist yet). So 64 bit KC can not be loaded and we have to resort to some tricks

2. We have reproduced the other problem of empty window at runtime. We are investigating... It should not take long. Pls watch this thread for the next few days

Nick

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: Empty window in 64 bit app Visual Studio 12

Post by nickz »

Ibi,
We have fixed the empty window problem and an issue with explorer in today’s update 3741: http://www.dynoinsight.com/ProDown.htm

(b) In the current version 4.3 the model Explorer only works when the application targets .NET 2.0. See the next post on this thread if you decide to target a different framework version and not to use Explorer.

Below is a mini tutorial on creating a 64 Windows Forms application. It is based on VB .NET, Visual Studio 2012 on Windows 8.1. With minor differences in GUI it applies to earlier version of Visual Studio and C#.

1. Create new .NET Windows Forms application
2. Open the Properties form of the project. Make sure in the Compile Tab the Target CPU is “Any CPU”
3. Open Application Tab in the project properties. Make sure that the Target framework is “.NET Framework 2.0”. By default it is 4.5. Click OK on the warning message.
4. Open the main form in form editor (design)
5. Expand Components group of controls in the Toolbox. If you do not see “KernCADnet Control” right-click inside the group and select “Choose items”. In the opened form click on the “COM Components” tab, turn on “KerCADnet Control” check box and click OK.
6. Click “KernCADnet Control” in the Toolbox and select a rectangle on the form to place it
7. You should see a green window with a wireframe box and text “KernelCAD .NET ... 3D will be displayed at runtime”. It is not an error as explained above. The actual model will appear when you compile and run the app
8. Select the added control on the form and open properties window: In menu View > Other Windows > Properties Window or press Alt+Enter (this may not be available in all IDE)
9. In the ModelPath property (Misc group) type: Models\Light.glm and make sure RenderSolid property is true
10. Switch to x64 platform either using the combo under the VS menu or Build > Configuration Manager > Active Solution Platform
11. Build and run the application. You should see the 3D view of the Light.glm model

If you see a different result close and reopen Visual Studio and try creating a new application

In Visual Studio 2010 .NET Forms app the 2 And 3 Options are on the Compile tab under the “Advanced Compiler Options”.

In case you are modifying and existing project and do not have the “Any CPU” platform, select Build > Configuration Manager in the VS menu. In the Active Solution platform combo select New > x64 > Copy from x86 (or any other existing configuration).

Theoretically the b) limitation can be ignored if Model Explorer is not used. In my today’s test that was true for .NET versions 3.*, but not for 4.*. We are investigating this. Please watch this thread.

Nick

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: Empty window in 64 bit app Visual Studio 12

Post by nickz »

Visual Studio 2008 or later can create 64 bit applications, but it is a 32 bit application itself. This has to be kept in mind when creating a 64 bit application which uses KernelCAD.

To create a Windows Forms 64 bit application start with either Any CPU or x86 configuration.
- With this configuration active add KernelCAD control to the form, change the properties and close the form.
- Create new x64 configuration: In the Active Solution platform combo select New > x64 > Copy from Any CPU (or x86). It should be active after that.
- Build and run the application
So the main thing is that the form containing KernelCAD control can only be opened with either Any CPU or x 86 configurations active as Visual Studio cannot load a 64 bit component itself. In the Any CPU or x 86 configurations VS uses a 32 bit version of KernelCAD supplied in the x64 installation

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: Empty window in 64 bit app Visual Studio 12

Post by nickz »

The above method of creating x64 apps works for any version of Visual Studio and any version of .NET with one exception: .NET v4.0 or 4.5 on Visual Studio 2012. We are still investigating this problem. .NET 4.0 works OK on Visual Studio 2010
Pls keep in touch
Nick

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: Empty window in 64 bit app Visual Studio 12

Post by nickz »

We have made progress with .NET 4 support, but at the moment it looks like it will have to be in the new version 4.4. There are too many changes, which can destabilise the software.
We hope to make a quick release for this purpose

KC is the top of a long chain of component suppliers. Some of them are very large and it takes a while to start supporting the next version of Visual Studio. I would say it would be a safer bet to stay behind one version. For example when Microsoft releases Visual Studio 2012 there is a good chance that Visual Studio 2010 is well supported by all

Nick

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: Empty window in 64 bit app Visual Studio 12

Post by nickz »

As described in http://www.dynoinsight.com/phpBB3/viewt ... f=2&t=2903 There is a division: 64 bit applications targeting .NET earlier than 4.0 are supported only by v4.3. .NET 4.0 or later is supported only by KC 4.4 (or later).

In v4.4 adding control to the form can be done in any configuration and platform. It should work after that with any selection of configuration and platform

Another notice related to the tutorial above for completeness: In case of 32 bit platform there is needed an additional step after step 4:
- In Compile Tab of project properties Target CPU (Build Tab, Target platform for C#) must be x86, not Any CPU. This is because the application is going to use the native KC component and bitness has to be determined on the build stage

Nick

Post Reply