Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. XML to header

XML to header

Scheduled Pinned Locked Moved C / C++ / MFC
csharpxmlquestionc++hardware
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andre xxxxxxx
    wrote on last edited by
    #1

    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

    _ R 2 Replies Last reply
    0
    • A Andre xxxxxxx

      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

      _ Offline
      _ Offline
      __yb
      wrote on last edited by
      #2

      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.

      A 1 Reply Last reply
      0
      • _ __yb

        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.

        A Offline
        A Offline
        Andre xxxxxxx
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • A Andre xxxxxxx

          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

          R Offline
          R Offline
          Ryan Binns
          wrote on last edited by
          #4

          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"

          A 1 Reply Last reply
          0
          • R Ryan Binns

            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"

            A Offline
            A Offline
            Andre xxxxxxx
            wrote on last edited by
            #5

            That's correct, but you can't use C headers in the managed world. As mentioned C++/CLI expects additional keywords.

            R 1 Reply Last reply
            0
            • A Andre xxxxxxx

              That's correct, but you can't use C headers in the managed world. As mentioned C++/CLI expects additional keywords.

              R Offline
              R Offline
              Ryan Binns
              wrote on last edited by
              #6

              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"

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups