[Qt-interest] QAxFactory linker issue
Santhosh Y
santhosh at softjin.com
Tue Jun 29 06:11:02 CEST 2010
Hi Qt-support,
I am trying to invoke a qaxserver object from a tester application.
I built qaxserver as an exe, (CONFIG += qt qaxserver TEMPLATE =app)
In my tester application I included CONFIG += qt qaxserver TEMPLATE
=app // Please comment whether these are correct
In my qaxserver exe, I have added following macro
QAXFACTORY_DEFAULT(
TheActiveX,// widget class
"{01234567-89AB-CDEF-0123-456789ABCDEF}",// class ID
"{01234567-89AB-CDEF-0123-456789ABCDEF}",// interface ID
"{01234567-89AB-CDEF-0123-456789ABCDEF}",// event interface ID
"{01234567-89AB-CDEF-0123-456789ABCDEF}",// type library ID
"{01234567-89AB-CDEF-0123-456789ABCDEF}"// application ID
I have given my class name "QMenus" in place of "TheActiveX" and
similarly for the rest in the above macro of my src file.
I looked in to this macro what is does in Qt src code file
"C:\Qt\4.5.2\src\activeqt\control\qaxfactory.h"
#define QAXFACTORY_DEFAULT(Class, IIDClass,
IIDInterface, IIDEvents, IIDTypeLib, IIDApp) \
QT_BEGIN_NAMESPACE \
class QAxDefaultFactory : public QAxFactory \
{ \
public: \
QAxDefaultFactory(const QUuid &app, const QUuid &lib) \
: QAxFactory(app, lib),
className(QLatin1String(#Class)) {} \
..................................................................
..................................................................
..................................................................
*QAXFACTORY_EXPORT(QAxDefaultFactory, IIDTypeLib, IIDApp) *\
Now, the .tlb file got generated from this has exported factory inside
it ; i.e. default factory QAxDefaultFactory.
Now, I am trying to write a tester app, in which I imported the .tlb
file using # import directive.
#import "../menu/debug/menusax.tlb""
//Please comment on this
Here I am trying to read factory and hence my COM object, from factory.
Following is the build error when I am working on this tester
application for COM
==============================================================================================================
1>------ Build started: Project: test, Configuration: Debug Win32 ------
1>Compiling...
1>tester.cpp
1>.\tester.cpp(24) : warning C4189: 'factory' : local variable is
initialized but not referenced
1>.\tester.cpp(22) : warning C4189: 'window' : local variable is
initialized but not referenced
1>Linking...
*1>QAxServerd.lib(qaxserver.obj) : error LNK2019: unresolved external
symbol "class QAxFactory * __cdecl qax_instantiate(void)"
(?qax_instantiate@@YAPAVQAxFactory@@XZ) referenced in function "class
QAxFactory * __cdecl qAxFactory(void)" (?qAxFactory@@YAPAVQAxFactory@@XZ)*
1>debug\test.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://d:\COM\testerForMenu\debug\BuildLog.htm"
1>test - 2 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
=================================================================
Please suggest me how to solve this issue.
Do I need to include .idl file also in my tester application *.pro file
Please reply to this ASAP.
--
----------------------------------------------------
Y Santhosh Kumar -
Senior Software Engineer,
SoftJin Technologies Pvt Ltd,
www.softjin.com
----------------------------------------------------
Business Disclaimer
____________________________________________________________
This e-mail message and any files transmitted with it are intended solely
for the use of the individual or entity to which they are addressed. It
may contain confidential, proprietary or legally privileged information.
If you are not the intended recipient please be advised that you have
received this message in error and any use is strictly prohibited. Please
immediately delete it and all copies of it from your system, destroy any
hard copies of it and notify the sender by return mail. You must not,
directly or indirectly, use, disclose, distribute, print, or copy any part of
this message if you are not the intended recipient.
___________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100629/f03f7a7b/attachment.html
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tester.cpp
Url: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100629/f03f7a7b/attachment.pl
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.pro
Url: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100629/f03f7a7b/attachment-0001.pl
More information about the Qt-interest-old
mailing list