XML to header
-
I've already posted this question in the XML forum but i got no answer and i think it's more related to programming than XML. I have hundreds of structs and enums which describe the data in an ECU (engine control unit), fuel map etc. The headers with thousands of lines are currently written in C and are used for the embedded system and also in the MFC project on the PC side to edit the tables and to communicate with the ECU. With Microsofts new .net strategy that won't work well anymore because the embedded and desktop world devides in my eyes. So what i would like to do now is describe the structs in XML and then create headers for C/C#/... from it. Does a common XML and XSLT file for this taks exist? Any examples? Maybe even an interface editor? Thanks Andre
-
I've already posted this question in the XML forum but i got no answer and i think it's more related to programming than XML. I have hundreds of structs and enums which describe the data in an ECU (engine control unit), fuel map etc. The headers with thousands of lines are currently written in C and are used for the embedded system and also in the MFC project on the PC side to edit the tables and to communicate with the ECU. With Microsofts new .net strategy that won't work well anymore because the embedded and desktop world devides in my eyes. So what i would like to do now is describe the structs in XML and then create headers for C/C#/... from it. Does a common XML and XSLT file for this taks exist? Any examples? Maybe even an interface editor? Thanks Andre
-
Of course xsl can do it, but u will have to render it into .h files in a pre-compile step. macros will take less time to write and pre-compile without a hustle.
The structs don't change anymore, but in cases where they does a pre-compile step could be added to the project. I would like to see how others have made it before i custom make it, how unions are described and how i can add language specific attributes to the structs. C++/CLI / C# expects additional keywords like value/ref/public...
-
I've already posted this question in the XML forum but i got no answer and i think it's more related to programming than XML. I have hundreds of structs and enums which describe the data in an ECU (engine control unit), fuel map etc. The headers with thousands of lines are currently written in C and are used for the embedded system and also in the MFC project on the PC side to edit the tables and to communicate with the ECU. With Microsofts new .net strategy that won't work well anymore because the embedded and desktop world devides in my eyes. So what i would like to do now is describe the structs in XML and then create headers for C/C#/... from it. Does a common XML and XSLT file for this taks exist? Any examples? Maybe even an interface editor? Thanks Andre
Why won't it work any more? You can use C headers in C++ under .NET
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
-
Why won't it work any more? You can use C headers in C++ under .NET
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
That's correct, but you can't use C headers in the managed world. As mentioned C++/CLI expects additional keywords.
-
That's correct, but you can't use C headers in the managed world. As mentioned C++/CLI expects additional keywords.
ABuenger wrote: That's correct, but you can't use C headers in the managed world. As mentioned C++/CLI expects additional keywords. It accepts additional keywords (ref, value etc...) but does not expect them - they are not required. If you don't use them, it specifies standard unmanaged types. I have used header files of structures from VC6 completely unmodified in VS2005 without any issues, including unions, structs and enums. Of course, there may be specific reasons why your header file doesn't work. Have you tried it?
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"