LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-30-2005, 08:12 PM   #1
chanwing
Member
 
Registered: Feb 2005
Posts: 42

Rep: Reputation: 15
Unhappy MFC macros problem (porting VC++6.0 to Qt)



I am a newbie for linux programming
I have a VC++ program porting to Linux problem
A program includes IMPLEMENT_DYNCREATE(), DECLARE_DYCREATE() and DECLARE_DYNAMIC().
But I don't know how to change it.
I had already searched some information in website.
I found out that for wxWindow.
I can replace DECLARE_DYCREATE() by DECLARE_DYNAMIC_CLASS() and DECLARE_DYNAMIC() by DECLARE_CLASS().
However, I use the Qt not wxWindow.
Then, how can I do?
In fact, I am not really understand about the IMPLEMENT_DYNCREATE(), DECLARE_DYCREATE() and DECLARE_DYNAMIC(), although I saw the msdn.
Can anyone know how to solve this problem?
Thank you very much

Last edited by chanwing; 03-31-2005 at 01:24 AM.
 
Old 04-01-2005, 08:08 AM   #2
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
Looking at MSDN, here is the description of IMPLEMENT_DYNCREATE

Quote:
Use this macro with the DECLARE_DYNCREATE macro to enable objects of CObject-derived classes to be created dynamically at run time. The framework uses this ability to create new objects dynamically, for example, when it reads an object from disk during serialization. Add the IMPLEMENT_DYNCREATE macro in the class implementation file.

If you use the DECLARE_DYNCREATE and IMPLEMENT_DYNCREATE macros, you can then use the RUNTIME_CLASS macro and the CObject::IsKindOf method to determine the class of your objects at run time.

If DECLARE_DYNCREATE is included in the class declaration, then IMPLEMENT_DYNCREATE must be included in the class implementation.
The only place I have ever seen these macros used is with MFC. If you are using Qt, all of your MFC classes will be replaced by Qt anyway, so the above macros probably aren't even really needed in your case.

I believe that internally MFC uses the methods declared by these macros to dynamically create instances of the doc/view classes. It's been awhile since I did much MFC programming, so I could be wrong on that.

Last edited by deiussum; 04-01-2005 at 08:12 AM.
 
Old 04-06-2005, 06:57 PM   #3
chanwing
Member
 
Registered: Feb 2005
Posts: 42

Original Poster
Rep: Reputation: 15

oh I see.............THank you very much deiussum.
that mean I no need to use them
but what kinds of methods or functions that can Qt replace of them? is it Qt doesn't have such kind of concept that I can ignore them?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Question, Apples Contribution to Open Source + MacOs file structure question Higgy3k Other *NIX 5 07-25-2005 04:23 AM
Not your regular GRUB question - just a short question for a fried MBR!! ziphem Linux - General 3 01-31-2005 01:51 PM
2 part question: Speeding up MDK9.1/GNOME question wardialer Linux - Newbie 6 10-14-2004 03:16 PM
login prompt question & kde scheme question JustinCoyan Slackware 2 06-09-2004 02:02 PM
RE: Suse 8.0 hardware question {newbie question, pls help} Radiouk Linux - Distributions 2 06-04-2002 12:53 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration