[Qt-interest] How to instantiate factory instance from a tester application

Santhosh Y santhosh at softjin.com
Sat Jun 26 13:49:23 CEST 2010


Hi,

I am trying to support my existing Qt application as an activeX server.  
I started with a simple example here.
I have 2- QWidgets[parent widget holds child widget] . On top of 
QAxFactory I have added my factory class,
which overwrites / implements base class virtual / pure virtual methods 
and can be used from outside to access QWidget (parent)

I built these in to an "template lib". (Please see my .pro file)

I have written a tester application(stand alone), which will invoke 
factory object and hence the objects inside it.

*Q1: The problem I am facing is how to instantiate QAxFactory object and 
subsequently creating objects...*

Please find the following attached zip files with this e-mail:

   1. ComApp.zip
          * This folder contains  following files
               1. objects.h         // Declaration of Elements in side
                  factory   (2 - QWidgets;  One inside other)
               2. objects.cpp     // Definition of Elements in side factory
               3. factory.h          // factory declaration &
                  defintion   (Qaxfactory subclass)
               4. hierarchy.pro   // project file
               5. qaxserver.rc    // resource file
               6. main.cpp         // factory macro declaration
               7. qaxserver.def  // modular defintion file
               8. hierarchy.inf
               9. qaxserver.ico
   2. TesterFile.zip
          * It has test.cpp
               1. This file #import (.tlb) of the above application
               2. Here I am trying to invoke factory and create object
                  inside it, and launch the QApplication (event loop)

Please give me inputs by going through the test.cpp file for how to 
initialize factory and hence the objects inside it. I have written few 
comments in side test.cpp file where I had some confusion.
Please suggest me how to do. You are most welcome if there any better 
ways of doing it.

*Q2: When I change to  "CONFIG += activeqt   dll"    from    " CONFIG += 
qaxserver dll"  in project file, it is giving following error.*

         link /LIBPATH:"c:\Qt\4.5.2\lib" /NOLOGO /DEBUG /DLL /MANIFEST 
/MANIFESTFILE:"debug\hierarchyax.intermediate.manifest" 
/DEF:qaxserver.def /OUT:debug\hierarchyax.dll
@C:\DOCUME~1\SANTHO~1.SOF\LOCALS~1\Temp\nm499.tmp
qaxserver.def : error LNK2001: unresolved external symbol DllCanUnloadNow
qaxserver.def : error LNK2001: unresolved external symbol DllGetClassObject
qaxserver.def : error LNK2001: unresolved external symbol DllRegisterServer
qaxserver.def : error LNK2001: unresolved external symbol 
DllUnregisterServer
qaxserver.def : error LNK2001: unresolved external symbol DumpIDL
debug\hierarchyax.lib : fatal error LNK1120: 5 unresolved externals

All those APIs are exported in .def file. Where to define and declare these?

I think for exposing Interfaces from my COM objects , I should be 
including  "CONFIG += activeqt   dll" instead "CONFIG +=qaxserver".
Please comment on this.

Regards

----------------------------------------------------
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/20100626/109b91d2/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TesterFile.zip
Type: application/x-zip-compressed
Size: 996 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100626/109b91d2/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ComApp.zip
Type: application/x-zip-compressed
Size: 4190 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100626/109b91d2/attachment-0001.bin 


More information about the Qt-interest-old mailing list