Forum > General

C++ porting: Is this really a template "CDocTemplate"

(1/1)

jamie:
I need to create to a limited degree a CDocTemplate equivalent to To C++.

MS states it as being a template, is this really a Template ? if I can write a generic for it.

I just want to cut to the shortest path possible.

https://learn.microsoft.com/en-us/cpp/mfc/reference/cdoctemplate-class?view=msvc-170

marcov:
I'm no C++ interoperability expert, but an abstract base class, without standard constructor/destructors might be an  C++ rendering of an interface?

jamie:
There is a "CCmdTarget" as a inherited class attached to that also, but that class is mainly used in my case to post messages to the window that is logged within that current instance.

 I don't know if using an interface here warrants that type of code, there is a constructor for that the CDOCTemplate, but as with most C++ classes, destructors are called, maybe not in this case however.


 

jamie:
Ok, I am going to give the compiler a run for its money!  :o

Looks like I first need to implement the CMultiDocTemplate then the CDOcTemplate and so on.

We will see how the Generics fares!

iLya2IK:
From the description of the CDocTemplate class, I see that this is a classic abstract class (it is not a template in the understanding of c++). In Pascal, it can be implemented either by interfaces (if you do not want to free up the allocated memory yourself) or by directly translating the description of the CDocTemplate class into Pascal syntax (pascal has all the necessary specifiers for this).

Navigation

[0] Message Index

Go to full version