Using COM in Qt without dll registration/RegAsm
Milutin Mrkonjic last edited by
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 ...
TioRoy last edited by
AFAIK a COM component NEED to be registered to work properly.
You can try to call DllRegisterServer from DLL to register.
Milutin Mrkonjic last edited by
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.
COM component has to be registered. This COM specification requirement my microsoft. Can you look at ActiveQt example ?
Rondog last edited by Rondog
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?
Milutin Mrkonjic last edited by Milutin Mrkonjic
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:
- register dll with RegAsm
- 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?
Rondog last edited by
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.