Click here to Skip to main content
16,005,222 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Class Reference Variables in Managed C++? Using the Activator Class,,, Pin
mike montagne28-Sep-06 20:12
mike montagne28-Sep-06 20:12 
GeneralRe: Class Reference Variables in Managed C++? Using the Activator Class,,, Pin
User 58385228-Sep-06 20:43
User 58385228-Sep-06 20:43 
GeneralRe: Class Reference Variables in Managed C++? THANKS Pin
mike montagne29-Sep-06 6:09
mike montagne29-Sep-06 6:09 
GeneralRe: Class Reference Variables in Managed C++? Using the Activator Class,,, Pin
mike montagne29-Sep-06 7:33
mike montagne29-Sep-06 7:33 
GeneralRe: Class Reference Variables in Managed C++? Using the Activator Class,,, Pin
led mike29-Sep-06 7:55
led mike29-Sep-06 7:55 
GeneralRe: Class Reference Variables in Managed C++? Using the Activator Class,,, [modified] Pin
mike montagne29-Sep-06 9:29
mike montagne29-Sep-06 9:29 
GeneralRe: Class Reference Variables in Managed C++? Using the Activator Class,,, Pin
Michael Dunn7-Oct-06 7:21
sitebuilderMichael Dunn7-Oct-06 7:21 
GeneralRe: Class Reference Variables in Managed C++? Using the Activator Class,,, Pin
mike montagne10-Oct-06 9:04
mike montagne10-Oct-06 9:04 
Thanks Mike,

However, it's not really, simply a virtual constructor issue, even in Delphi or C++ Builder.

I'm aware both that we have no virtual constructors, and that we cannot call virtual methods from constructors. The nature of the constructors is not really the issue. The real issue is identifying the proper constructor of an unknown class from its class identifier. Here's the bare gist of what we need to do, expressed a bit differently:

We have a control which parents further controls of different types. Clients may populate this control with one type, with many types, and even with their own custom descendants of our base child types. Our root, composite component generates instances of these children, manages the spatial distribution and focusing of the children, routes calls to the focused child, and automates their destruction.

Clients/users may want to descend from the basic types which the original control manages; and we must also provide means for them to elect to create any one particular type (at a time) of the basic types which the control manages. This capability must be supported even at design time, in the development environment.

Because we cannot know what yet-to-exist descendants the clients of our control suite may derive from our base child classes, the necessary solution parallels our Delphi implementation, where the client can pass their class identifier (class reference) to our root control, from which our root control can identify and call the proper constructor of their descendant. Editors allow them to do this at design time, so that they do not even have to install their class/components in the IDE (which eliminates substantial work and technical difficulty for them).

The critical issue therefore is that we have to link a class identifier to the proper constructor for child classes which may not even exist at the time we produce our root component. Presently, we use a real class identifier (Delphi/CPPB "Class Reference") which is intrinsically associated with the constructor of the class; because, in Delphi/CPPB, we can call the proper constructor directly, because *it is* the default constructor of the class identifier.

But you have me thinking here. I suppose we could take a string identifier and constructor fields of a struct as our former argument, thus explicitly identifying the constructor to call -- although I don't know what issues might exist for supporting this valuable behavior at design time in VS. In other words, how would we store handles of constructors of client descendants in a collection property, so that they could be called at run time or design time?
GeneralRe: Class Reference Variables in Managed C++? Using the Activator Class... Pin
mike montagne10-Oct-06 9:08
mike montagne10-Oct-06 9:08 
GeneralRe: Class Reference Variables in Managed C++? Using the Activator Class,,, Pin
User 5838522-Oct-06 17:41
User 5838522-Oct-06 17:41 
GeneralRe: Class Reference Variables - Building Template Pin
mike montagne5-Oct-06 9:30
mike montagne5-Oct-06 9:30 
GeneralRe: Class Reference Variables - Building Template Pin
User 5838525-Oct-06 12:48
User 5838525-Oct-06 12:48 
GeneralRe: Class Reference Variables - Building Template Pin
mike montagne5-Oct-06 13:20
mike montagne5-Oct-06 13:20 
QuestionExplicit override of a property and Generic::IEnumeration Pin
User 58385227-Sep-06 20:43
User 58385227-Sep-06 20:43 
AnswerRe: Explicit override of a property and Generic::IEnumeration Pin
George L. Jackson28-Sep-06 16:45
George L. Jackson28-Sep-06 16:45 
GeneralRe: Explicit override of a property and Generic::IEnumeration Pin
User 58385228-Sep-06 18:40
User 58385228-Sep-06 18:40 
QuestionCoGetInterfaceAndReleaseStream() in managed VC++.NET 2003 Pin
lafleon27-Sep-06 8:45
lafleon27-Sep-06 8:45 
QuestionPlease determine the output Pin
Sushant Duggal27-Sep-06 0:58
Sushant Duggal27-Sep-06 0:58 
AnswerRe: Please determine the output Pin
led mike27-Sep-06 8:11
led mike27-Sep-06 8:11 
AnswerRe: Please determine the output Pin
Christian Graus27-Sep-06 12:45
protectorChristian Graus27-Sep-06 12:45 
GeneralRe: Please determine the output Pin
Sushant Duggal27-Sep-06 17:59
Sushant Duggal27-Sep-06 17:59 
GeneralRe: Please determine the output Pin
Christian Graus27-Sep-06 18:06
protectorChristian Graus27-Sep-06 18:06 
GeneralRe: Please determine the output Pin
Sushant Duggal27-Sep-06 18:31
Sushant Duggal27-Sep-06 18:31 
GeneralRe: Please determine the output Pin
Sushant Duggal27-Sep-06 18:47
Sushant Duggal27-Sep-06 18:47 
GeneralRe: Please determine the output Pin
Christian Graus27-Sep-06 19:00
protectorChristian Graus27-Sep-06 19:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.