Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using COM in Qt without dll registration/RegAsm
Forum Updated to NodeBB v4.3 + New Features

Using COM in Qt without dll registration/RegAsm

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 4 Posters 2.2k 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.
  • M Offline
    M Offline
    Milutin Mrkonjic
    wrote on 18 Nov 2015, 10:59 last edited by
    #1

    Hi,

    Is there any solution to use COM in Qt, but without dll registration?

    I was register dll with RegAsm and all work nice. But, that is not good solution for my setup.

    I need some kind of COM usage without dll registration.

    Something like manifest. I can't find any example for Qt with manifest ...

    T 1 Reply Last reply 18 Nov 2015, 16:32
    0
    • M Milutin Mrkonjic
      18 Nov 2015, 10:59

      Hi,

      Is there any solution to use COM in Qt, but without dll registration?

      I was register dll with RegAsm and all work nice. But, that is not good solution for my setup.

      I need some kind of COM usage without dll registration.

      Something like manifest. I can't find any example for Qt with manifest ...

      T Offline
      T Offline
      TioRoy
      wrote on 18 Nov 2015, 16:32 last edited by
      #2

      @Milutin-Mrkonjic

      AFAIK a COM component NEED to be registered to work properly.

      You can try to call DllRegisterServer from DLL to register.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Milutin Mrkonjic
        wrote on 19 Nov 2015, 11:16 last edited by
        #3

        I make something with this line in .pro:
        QMAKE_POST_LINK = "$$PROJECT_SOURCE_FOLDER\Tools\mt.exe -manifest AppName.manifest -outputresource:AppName.exe;1"

        Now it is work without dll registration.
        Testing still in progress.

        But, I have interesting problem.
        Creating instance (CoCreate...) is not work until I do something with open file dlg:

        For example, COM is not working in my app, no matter how many times you try (in my example COM read some files).
        At first time when I open a OpenFileDlg, and immediately close, everything work fine after :)

        I can't get clue what is happened.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dheerendra
          Qt Champions 2022
          wrote on 19 Nov 2015, 13:08 last edited by
          #4

          Hi

          COM component has to be registered. This COM specification requirement my microsoft. Can you look at ActiveQt example ?

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          1 Reply Last reply
          3
          • R Offline
            R Offline
            Rondog
            wrote on 19 Nov 2015, 18:58 last edited by Rondog
            #5

            There might be a misunderstanding here.

            You can use COM objects from any software without registering anything. I do this all the time and I have never had to register any of my programs. A common example is to automate Excel.

            If you write something that exposes a COM interface it must be registered. Windows will not know how or where to find the application or interfaces otherwise.

            You don't need a manifest either. I have yet to put one in anything I have ever written (although this might be a MinGW thing which is different than MSVC).

            So, do you want to use COM without registration (using CoCreateInstance(...) and all that) to access something that already exists on the computer or do you want to expose an COM interface of some sort?

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Milutin Mrkonjic
              wrote on 20 Nov 2015, 08:22 last edited by Milutin Mrkonjic
              #6

              Hm, I have code c#. Make dll's, make wrapper in managed c++ and use that dll in native code.
              That work on two ways:

              1. register dll with RegAsm
              2. add manifest to app exe file, where is located Guids, dll names, class names ...

              I make that to work with manifest, beacause I can't use registration.

              But I have one strange problem, described in my last post. OpenFileDlg something change i app environment, so app can create instance of that dll.

              Maybe I should open new thread for that problem?

              1 Reply Last reply
              0
              • R Offline
                R Offline
                Rondog
                wrote on 20 Nov 2015, 14:45 last edited by
                #7

                I think there is a misunderstanding.

                I don't use .net at all so I might be wrong but 'managed C++' is an extension or mechanism available that allows you to write C# (or whatever) code with links to C++ dll's or other non-net libraries.

                This has nothing to do with COM as far as I know. The manifest may very well be required in this case for the DLL files (?) but I don't know if COM has anything to do with this.

                My guess to why you are having a problem would be from .net handling all the classes from the DLL and not calling the constructors when you expect (the first call to CoCreateInstance doesn't happen until the file dialog is created which is called somewhere else).

                It appears you have a problem accessing COM and not so much a problem where you need to register a COM class or interface.

                I don't use C# so I have no suggestions.

                1 Reply Last reply
                1

                1/7

                18 Nov 2015, 10:59

                • Login

                • Login or register to search.
                1 out of 7
                • First post
                  1/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved