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

Santhosh Y santhosh at softjin.com
Sat Jun 26 13:52:29 CEST 2010


This email contained a .zip file attachment. Raytheon does not allow email attachments that are considered likely to contain malicious code. For your protection this attachment has been removed.

If this email is from an unknown source, please simply delete this email.

If this email was expected, and it is from a known sender, you may follow the below suggested instructions to obtain these types of attachments.

+ Instruct the sender to enclose the file(s) in a ".zip" compressed file, and rename the ".zip" compressed file with a different extension, such as, ".rtnzip".  Password protecting the renamed ".zip" compressed file adds an additional layer of protection. When you receive the file, please rename it with the extension ".zip".

Additional instructions and options on how to receive these attachments can be found at:

http://security.it.ray.com/antivirus/extensions.html
http://security.it.ray.com/news/2007/zipfiles.html

Should you have any questions or difficulty with these instructions, please contact the Help Desk at 877.844.4712

---

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.
___________________________________________________________



More information about the Qt-interest-old mailing list