473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Templates

I need code to export Class Template from DLL and also client application using that Class Template ,using Vc++ MFCDLL or VC++ Win 32 dynamiclinklibrary for the creation of Dll that includes a Class Template
May 21 '07 #1
7 1230
AdrianH
1,251 Expert 1GB
I need code to export Class Template from DLL and also client application using that Class Template ,using Vc++ MFCDLL or VC++ Win 32 dynamiclinklibrary for the creation of Dll that includes a Class Template
If I understand you right, you cannot do this.

A template is a C++ construct that is compiled only when required by the rest of the programme. If it is a generic template of type T, it will not generate code for when T is an int, char, char *, long, user defined class ... the list goes on and on. You can only specify concrete classes and functions for export.


Adrian
May 21 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
A template is a compile-time feature. A DLL is a run-time deal. You won't be able to do this.
May 21 '07 #3
AdrianH
1,251 Expert 1GB
usyra42, do not double post. Please read the Posting Guidelines at the shown at the beginging of the forum.


Adrian
May 21 '07 #4
You can however, explicitly instantiate a class template or function, and export that from a static or dynamic library.
May 21 '07 #5
AdrianH
1,251 Expert 1GB
You can however, explicitly instantiate a class template or function, and export that from a static or dynamic library.
Yes, but then it is not really a template at that point. It is a concrete instantiation.


Adrian
May 22 '07 #6
can u please help in this i need some idea how to export templates ..
Is it possible to export the class templates...
i need to complete the project ..
give some idea ...
May 22 '07 #7
AdrianH
1,251 Expert 1GB
can u please help in this i need some idea how to export templates ..
Is it possible to export the class templates...
i need to complete the project ..
give some idea ...
No, it is not possible. Read the other messages in this thread.


Adrian
May 22 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Vince C. | last post by:
Hi all, I've created XML documents that are described with a schema. I'm using those documents to create web pages. All my web pages contain a fixed header and a variable document part. The...
5
by: Tom Alsberg | last post by:
Hi there... I'm recently trying to get a bit acquainted with XML Schemas and XSL. Now, I have a few questions about XSL stylesheets and templates: * Is there a way to "enter" a child element...
22
by: E. Robert Tisdale | last post by:
According to the C++ FAQ Lite: http://www.parashift.com/ What is "genericity"? Yet another way to say, "class templates." Not to be confused with "generality" (which just means avoiding...
12
by: Fabio De Francesco | last post by:
Hello. I can't understand why I can't compile the following simple code, where I think I have applied all the needed rules for templates that are declared and defined in different files (*.h and...
16
by: WittyGuy | last post by:
Hi, What is the major difference between function overloading and function templates? Thanks! http://www.gotw.ca/resources/clcm.htm for info about ]
2
by: jimbo_vr5 | last post by:
Hey I think i've figured out the idea behind apply-templates. But going through the tutorial on <http://www.w3schools.com/xsl/xsl_apply_templates.asp> theres simply just something that i dont...
25
by: Ted | last post by:
I'm putting the posts that follow here (hopefully they will follow here!) because they were rejected in comp.lang.c++.moderated. It behooves anyone reading them to first read the the thread of the...
28
by: NewToCPP | last post by:
Hi, I am just trying to find out if there is any strong reason for not using Templates. When we use Templates it is going to replicate the code for different data types, thus increasing the...
104
by: JohnQ | last post by:
Well apparently not since one can step thru template code with a debugger. But if I was willing to make the concession on debugging, templates would be strictly a precompiler thing? I have a...
7
by: Chris | last post by:
Hi All, This is a weird one but I am hoping someone can help or has some pointers, a recipe how to do the following: I have to move some code from c++ to objective-c and to do this I must...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.