[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 508
  • Last Modified:

RUNTIME_CLASS

I derived CMyThread from CWinThread. Does RUNTIME_CLASS can create an object whose constructor has parameter? For example:
CMyThread : public CWinThread
{
 DECLARE_DYNAMIC(CMythread)
protected:
CMyThread(Object *);
~CMyThread();
}

Also, another question is that: when I use RUNTIME_CLASS to create ab object , does that mean I do not need to use "delete" to delete the object?

Thanks.
0
jonalee
Asked:
jonalee
1 Solution
 
migelCommented:
RUNTIME_CLASS not support creation of the objects with no default constructor (constructor without parameters). See declaration of the _IMPLEMENT_RUNTIMECLASS macro in the afx.h.
Creation objects with RUNTIME_CLASS uses new operator so you need to destroy created object manually.
0
 
TheGrinchCommented:
RUNTIME_CLASS does not create objects. Read Help.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now