0
0

while trying to use the designer generated header files with multiple projects in my application i came accross a little design flaw.

The issue is multiple definitions.
the .h files that designer generates contain no precompiler commands to check if the file’s already been included or not. You could get around this by using naming conventions in your designer files but you will still get stuck on one definition: the master category. You cannot change it in the designer yet it must be in every .h file that designer generates.

All i’m saying is that the way the file is generated should at least include
[code:1v1d8evd]

ifndef THIS_HEADER

define THIS_HEADER

// definitions

endif

[/code:1v1d8evd]

and for constant IDS like the master category
[code:1v1d8evd]

ifndef MASTER_CATEGORY_THISPROJECT

define MASTER_CATEGORY_THISPROJECT

const int EVENTCATEGORY_MASTER = 0;
const int EVENTCATEGORY_MASTER_MUSIC = 0;

define MASTER_CATEGORY_THISPROJECT

[/code:1v1d8evd]

or some other clever way of achieving the same result.

  • You must to post comments
0
0

Hi, thanks for the report. I have added this issue to our bug tracker.

Ben

  • You must to post comments
0
0

I think another cool feature for these header files would be to declare a constant int containing the number of events in total, the number of events in each group, and the number of events in each category.

I figure since this can’t really change at runtime it would be more useful to have these numbers here than get them using getNumEvents, but the main purpose for this is so that the programmer can create arrays based on the size of groups/categories/total. I myself would like this specifically for making arrays of indexes. or is there a simpler way of doing this?

thanks!

  • You must to post comments
0
0

[quote="micken":1l0672z2]I think another cool feature for these header files would be to declare a constant int containing the number of events in total, the number of events in each group, and the number of events in each category.
[/quote:1l0672z2]

This does sound like it could be useful. We will discuss this internally and get back to you.

Ben

  • You must to post comments
0
0

Hi,
Generated header files now have include guards and event count constants.

Additionally, to prevent naming collisions all constant names now have the project name inserted into them (e.g. for a project called "test", EVENTGROUP_EXAMPLES has become EVENTGROUP_TEST_EXAMPLES, etc.).

These changes will be in the next released version.

Thanks,
Ben

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.