Missing meta object information with ActiveQt server
-
Hi,
I have a dll that I've written in Qt which can be used successfully with other Qt apps. The top level widget is a singleton class.
I now need to suppport someone that's using the .Net framework and want to provide the dll functionality as a COM object using ActiveQt.
I've created a wrapper application that acts as a facade to the dll. The problem I have is that when I try to compile, if the code calls functions in the original dll, I get the following error: -
1> C:\Qt\4.7.1\bin\idc.exe c:\src\dotnetcomwrapper\debug\dotnetcomwrapperd.dll /regserver
1>debug\obj\dotnetcomwrapperd.idl
1>Couldn't load library file c:\src\dotnetcomwrapper\debug\dotnetcomwrapperd.dll
1>Class has no metaobject information (error in c:\src\dotnetcomwrapper\debug\dotnetcomwrapperd.dll)!With that error, the dll fails to register as a COM service.
If I remove any calls to the dll, the compilation works and the dll is registered successfully as a COM object.
Can someone please explain why no metaobject information is being created?Having played around, I was able to get it to work once, so I know it's possible, but don't know what I did and it's no longer generating a dll with valid metaobject information.
Thanks,
Simon ;O) -
Note: I have no experience with ActiveQt.
One reason why no metaobject is generated, could be that you forgot to include the Q_OBJECT macro?
-
Thanks, that was my first thought, but it's not the problem.
It appears that when the post process calls are made to the IDL binary under Visual studio, it fails, but if I open a cmd prompt and type them myself, it then works!
It's as though the post process commands aren't being run sequentially.
-
Sorry, I can not help you with that, as that is way outside of my experience zone. Good luck!
-
[quote author="Mr-Merlin" date="1319098498"]It appears that when the post process calls are made to the IDL binary under Visual studio, it fails, but if I open a cmd prompt and type them myself, it then works!
It's as though the post process commands aren't being run sequentially.
[/quote]Sounds it's a path problem? If you enter a command line, do you use the Qt command line?
Do you build typically by MSVS?
-
Andre - thanks anyway, for taking the time to reply.
Gerolf, I don't think it's a path problem, because I can copy the commands directly from the Visual Studio build window into the cmd prompt window and then they work. The commands in VS provide full paths.
-
To the executables, yes. But where are the libraryies located, that are loaded?
I have seen such things already: A tool (idc.exe) load your build dll and that dll has dependencies which perhaps can't be resolved... -
The dependent dlls are in the same directory as the dll that idc is loading. Annoyingly, idc doesn't provide any useful output. I tried using procmon (previously filemon) to see if it's failing to find any files, but with no success.
-
I've been asked if I have found a solution. I never did work out why the post-process doesn't work the way it's supposed to. However, I did come up with a solution.
If you add qaxserver_no_postlink to the CONFIG option in the .pro file, it will turn off the post process steps that are failing.
Next, create a batch file with the required calls to the idc that work when called from the command prompt.
Add the batch file to the .pro (e.g. QMAKE_POST_LINK = postbuild_release.bat) to enable it to be called in the post process step and then reload the project.
This now works, but ensure that if you build a debug version, you'll probably need to unregister the dll before running a release version.
I hope that helps anyone else with the same issue.
-
Please, can you post the content of your .bat file?