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. COM
  4. Design + technical issue

Design + technical issue

Scheduled Pinned Locked Moved COM
databasecsharpc++javacom
6 Posts 2 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
    Ahmed Charfeddine
    wrote on last edited by
    #1

    I am developing an application that has to act on external data that is both described and provided by the user, the client. Currently I have created a wizard and the user can choose either to provide an SQL database (thus asking him for the DSN and the SQL query) or an XML file (thus asking him to for the appropriate xQuery query) or a CSV file (thus asking him for the file where it resides and the delimiting caracater). Now, this may not be sufficient : I can imagine a plenty of complex scenario such the data cannot fall within those 3 types. What I am tempted to do then is to make it possible for the application to call an external code provided by the user and which will be responsible for retrieving the data so that the application can deal with it. My application is written in unmanaged C++, but the user may want to write that portion of code in JAVA, C# etc. My only idea, which is unfortunately still not clear (regarding implementation) is to write a sort of specification of a COM object : user must write his data-code following that spec. and my application should be able to load available COM objects that fall with particular class and allow the user to select his implementation. Then the application is capable of calling that COM object and retrieving data passed by it. (I am not even good at COM development) So do you have suggestion, is there a sample application I can inspire from ? Thank you in advance.

    Easy Profiler : a compile-time profiler for C++ www.potatosoftware.com

    A 1 Reply Last reply
    0
    • A Ahmed Charfeddine

      I am developing an application that has to act on external data that is both described and provided by the user, the client. Currently I have created a wizard and the user can choose either to provide an SQL database (thus asking him for the DSN and the SQL query) or an XML file (thus asking him to for the appropriate xQuery query) or a CSV file (thus asking him for the file where it resides and the delimiting caracater). Now, this may not be sufficient : I can imagine a plenty of complex scenario such the data cannot fall within those 3 types. What I am tempted to do then is to make it possible for the application to call an external code provided by the user and which will be responsible for retrieving the data so that the application can deal with it. My application is written in unmanaged C++, but the user may want to write that portion of code in JAVA, C# etc. My only idea, which is unfortunately still not clear (regarding implementation) is to write a sort of specification of a COM object : user must write his data-code following that spec. and my application should be able to load available COM objects that fall with particular class and allow the user to select his implementation. Then the application is capable of calling that COM object and retrieving data passed by it. (I am not even good at COM development) So do you have suggestion, is there a sample application I can inspire from ? Thank you in advance.

      Easy Profiler : a compile-time profiler for C++ www.potatosoftware.com

      A Offline
      A Offline
      Ahmed Charfeddine
      wrote on last edited by
      #2

      If the COM-based idea is possible, the question then how would I deploy the specs ? Would it be in form of an IDL file ? Is it then possible to take an IDL file and construct a COM project from it ?

      Easy Profiler : a compile-time profiler for C++ www.potatosoftware.com

      B 1 Reply Last reply
      0
      • A Ahmed Charfeddine

        If the COM-based idea is possible, the question then how would I deploy the specs ? Would it be in form of an IDL file ? Is it then possible to take an IDL file and construct a COM project from it ?

        Easy Profiler : a compile-time profiler for C++ www.potatosoftware.com

        B Offline
        B Offline
        Baltoro
        wrote on last edited by
        #3

        This is really interesting, and it sounds like an enormous amount of work. About a year ago, I was getting familiar with MIDI (a computer music format), and there was a company that was promoting a DirectX COM interface standard for creating what is known as a software synthesizer (which could process MIDI messages into sound). This component would be loaded into an application that would stream MIDI messages (which comprised a musical composition) to the synthesizer component, the COM interface would process the MIDI format and return a stream of what was essentially a continuous stream of WAVE format digital signals, which the application would then send to its own audio driver. Pretty complicated stuff. Anyway, the company (Cakewalk) that develops the music software, offers developers an SDK package (including source code for both minmal server and compatible client, and lots of html documentation) demonstrating the utility of the server component and the interface that the COM In-Process server must present to the Executable, and all the associated data structures, interfaces, callbacks, and related mechanisms required to make the whole thing work. Admittedly, it is probably more complicated that what you are suggesting. But, the point is that the COM structure must be provided and thoroughly tested, and the documentation must be clear to the client developer, before they can even begin to design a component that will interface with your server correctly. In the above mentioned example, I had to study the source code for several weeks before I completely understood how it worked, and especially, how the server-client connections were implemented. What you realize is that, the more complex the code model is, the more difficult it is to get it to work.

        A 1 Reply Last reply
        0
        • B Baltoro

          This is really interesting, and it sounds like an enormous amount of work. About a year ago, I was getting familiar with MIDI (a computer music format), and there was a company that was promoting a DirectX COM interface standard for creating what is known as a software synthesizer (which could process MIDI messages into sound). This component would be loaded into an application that would stream MIDI messages (which comprised a musical composition) to the synthesizer component, the COM interface would process the MIDI format and return a stream of what was essentially a continuous stream of WAVE format digital signals, which the application would then send to its own audio driver. Pretty complicated stuff. Anyway, the company (Cakewalk) that develops the music software, offers developers an SDK package (including source code for both minmal server and compatible client, and lots of html documentation) demonstrating the utility of the server component and the interface that the COM In-Process server must present to the Executable, and all the associated data structures, interfaces, callbacks, and related mechanisms required to make the whole thing work. Admittedly, it is probably more complicated that what you are suggesting. But, the point is that the COM structure must be provided and thoroughly tested, and the documentation must be clear to the client developer, before they can even begin to design a component that will interface with your server correctly. In the above mentioned example, I had to study the source code for several weeks before I completely understood how it worked, and especially, how the server-client connections were implemented. What you realize is that, the more complex the code model is, the more difficult it is to get it to work.

          A Offline
          A Offline
          Ahmed Charfeddine
          wrote on last edited by
          #4

          Hi and I appreciate your reply. Hoepfully I do'nt have data structures to expose ! only simple methods (and no events as well !) Look I was given the following link by Pallini in the C++/MFC forum, and indeed it's just what I am looking for, so I started creating my IDL file : http://msdn.microsoft.com/en-us/library/ms680078(VS.85).aspx[^] Respectfully,

          Easy Profiler : a compile-time profiler for C++ www.potatosoftware.com

          B 1 Reply Last reply
          0
          • A Ahmed Charfeddine

            Hi and I appreciate your reply. Hoepfully I do'nt have data structures to expose ! only simple methods (and no events as well !) Look I was given the following link by Pallini in the C++/MFC forum, and indeed it's just what I am looking for, so I started creating my IDL file : http://msdn.microsoft.com/en-us/library/ms680078(VS.85).aspx[^] Respectfully,

            Easy Profiler : a compile-time profiler for C++ www.potatosoftware.com

            B Offline
            B Offline
            Baltoro
            wrote on last edited by
            #5

            I read your other post in the C++/MFC forum. Pallini is correct (always is, in fact), you must start with MIDL. You might also find this online book useful: Inside COM++[^]. It's quite similar to Don Box's, "Essential COM".

            A 1 Reply Last reply
            0
            • B Baltoro

              I read your other post in the C++/MFC forum. Pallini is correct (always is, in fact), you must start with MIDL. You might also find this online book useful: Inside COM++[^]. It's quite similar to Don Box's, "Essential COM".

              A Offline
              A Offline
              Ahmed Charfeddine
              wrote on last edited by
              #6

              A free book ! Thanks indeed.

              Easy Profiler : a compile-time profiler for C++ www.potatosoftware.com

              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