merogg
Topic Author
Posts: 3
Joined: 12 Jun 2013, 23:25

Build tool refusing Class directive

24 Jun 2013, 23:34

I've been following the tutorials included with the documentation and tried to create an usercontrol, but the build tool refuses to build resources with the x:Class directive. E.g. I can't build the UserControl example shown at /Doc/Gui.Core.UserControlTutorial.html nor any of my own UserControls.

This is the build tool output for the UserControl in the tutorials:

> Build Package MyApps/Controls
> Building MyApps/Controls/NumericUpDown.xaml
Parsing UserControl (@1,0)
Unknown type 'NumericUpDown'
< Build Package MyApps/Controls [0.137197 sg]

Am I missing something? Any help appreciated.
 
User avatar
jsantos
Site Admin
Posts: 3935
Joined: 20 Jan 2012, 17:18
Contact:

Re: Build tool refusing Class directive

25 Jun 2013, 00:24

Hi,

I suppose you generated a .dll and put it in the /Bin directory right? That is the correct way to extend NoesisGUI, but there is a bug in the later versions of NoesisGUI: it doesn't register classes that are not included in the original SDK. We just fixed this and all the documentation about it is being improved because lot of information is lacking.

We expect to upload a prev1.0 in the next 24h with all this.

Thanks!
 
edgarhsanchez
Posts: 34
Joined: 21 May 2012, 18:19

Re: Build tool refusing Class directive

25 Jun 2013, 02:29

this was probably causing some of my implementation of the CommandExample. Can't wait for the new stuff, exciting.
 
User avatar
jsantos
Site Admin
Posts: 3935
Joined: 20 Jan 2012, 17:18
Contact:

Re: Build tool refusing Class directive

25 Jun 2013, 04:28

Hmm.. the problems I commented are only present in C++. Unity is not affected. Your problems are with unity, aren't they?
 
edgarhsanchez
Posts: 34
Joined: 21 May 2012, 18:19

Re: Build tool refusing Class directive

25 Jun 2013, 16:41

I'll answer on the other thread in case they are separate issues. 1 sec.
 
merogg
Topic Author
Posts: 3
Joined: 12 Jun 2013, 23:25

Re: Build tool refusing Class directive

25 Jun 2013, 22:12

Hi,

I suppose you generated a .dll and put it in the /Bin directory right? That is the correct way to extend NoesisGUI, but there is a bug in the later versions of NoesisGUI: it doesn't register classes that are not included in the original SDK. We just fixed this and all the documentation about it is being improved because lot of information is lacking.

We expect to upload a prev1.0 in the next 24h with all this.

Thanks!
That's what I did. Can't wait for the release :)
 
User avatar
jsantos
Site Admin
Posts: 3935
Joined: 20 Jan 2012, 17:18
Contact:

Re: Build tool refusing Class directive

05 Jul 2013, 20:12

We uploaded a preview version of v1.0 (only sdk for win and osx) where all this problems should be solved. And the documentation have been hugely improved.

please, try it.

thanks!
 
merogg
Topic Author
Posts: 3
Joined: 12 Jun 2013, 23:25

Re: Build tool refusing Class directive

12 Jul 2013, 01:28

I got extending to work now, thanks.
 
Daki
Posts: 57
Joined: 16 Aug 2013, 00:48

Re: Build tool refusing Class directive

02 Sep 2013, 20:37

I am having some trouble getting custom UserControls working as well and it seems related to some of the discussion here.

As a first step I am trying to get the NumericUpDown example control in my existing project. I made a separate project from my game that is used to generate a dll of gui extensions, like UserControls. In this project I added the NumericUpDown logic, and built it. I put the resulting dll in the Bin directory and in the directory containing my game's exe. When I run the build tool while referencing the NumericUpDown in my game's UI, it builds successfully. However when I then run my game an exception is thrown when loading the xaml file that references the NumericUpDown control: "Can't create component NumericUpDown, it is not registered".

I am guessing that this problem might be related to that I am a little uncertain about where to put the NumericUpDown.xaml file. I would want to put it somewhere within my extensions dll project but if I do this it won't get built along with my game's resources. Because of this I stuck it in the same directory as all my other game xaml files, and it gets built along with them without error. I also changed the source path in NumericUpDown.cpp to use the same relative path that I use when loading all of my other xaml files from my game project (which load fine).

I'll also point out that I am building resources in a way that probably wasn't intended, so I will explain why and what I am doing since it may be relevant to this problem. The Noesis tools (like the resource builder) rely on the directory structure that comes with the SDK. It is set up as if you are supposed to include your game as a package within the SDK directory (much like how the TicTacToe sample is set up). This seems odd to me as I do not want to copy my game or my game's resources into the arbitrary directory where I have unpacked the Noesis SDK. Like with all other third party libraries I expect to include some components of the SDK (header files, libraries, tools...) into my project and use them from there. So that is what I did.

I already had a tools directory with my game's directory structure for compiling other assets so within that I copied some of the Noesis SDK tools (like the resource builder). Since you cannot provide these tools a path to resources I have a script to build UI that takes my UI resources and copies them to an intermediate directory that the resource builder can use ("..\Data\Packages\Gui\WKDX\Content" relative to the resource builder in my game's tools). WKDX is my project name. Then this script calls the resource builder telling it to scan and rebuild. Then the script copies all of the built resources back into the directory I want them within my project's resources directory.

This is all a bit kludgy but it allows me to keep my resources structured the way I want, and it has been working fine.
 
User avatar
jsantos
Site Admin
Posts: 3935
Joined: 20 Jan 2012, 17:18
Contact:

Re: Build tool refusing Class directive

02 Sep 2013, 21:00

As a first step I am trying to get the NumericUpDown example control in my existing project. I made a separate project from my game that is used to generate a dll of gui extensions, like UserControls. In this project I added the NumericUpDown logic, and built it. I put the resulting dll in the Bin directory and in the directory containing my game's exe. When I run the build tool while referencing the NumericUpDown in my game's UI, it builds successfully. However when I then run my game an exception is thrown when loading the xaml file that references the NumericUpDown control: "Can't create component NumericUpDown, it is not registered".
Can't create component error is happening because the DLL is not being registered. In XamlPlayer is working because our tools scan for plugins automatically. As said at the end of the Extending NoesisGUI Tutorial you have to register your new components by hand.

Please refer to that tutorial.
I already had a tools directory with my game's directory structure for compiling other assets so within that I copied some of the Noesis SDK tools (like the resource builder). Since you cannot provide these tools a path to resources I have a script to build UI that takes my UI resources and copies them to an intermediate directory that the resource builder can use ("..\Data\Packages\Gui\WKDX\Content" relative to the resource builder in my game's tools). WKDX is my project name. Then this script calls the resource builder telling it to scan and rebuild. Then the script copies all of the built resources back into the directory I want them within my project's resources directory.
We are *very* aware of the current restrictions related to data folders in NoesisGUI. In fact, we solved it in Unity but the work was not properly solved in the native sdk. Will be solved in the future because as you say it is very strange (and even dangerous) that you have to insert your folders inside the sdk. In fact your solution (I enjoyed reading it by the way) is a mockup about how the final solution will be.

Thanks for sharing your ideas!

Who is online

Users browsing this forum: No registered users and 7 guests