Click here to Skip to main content
15,890,438 members
Everything / Templates

Templates

templates

Great Reads

by Bruno van Dooren
How concepts can be used in template programming for partial specialization
by Kunal Chowdhury «IN»
Customized Scrolling in Silverlight using Expression Blend
by Vincent Maverick Durano
The new version of ApiBoilerPlate has recently been released. In this post, we will take a look at the new features added to the template.
by Anton Chibisov
This tutorial showcases how to implement C++ delegates which are capable of being bound to methods and functions having arbitrary signature, i.e., any number and type of parameters and return value.

Latest Articles

by Bruno van Dooren
Ways to enforce an interface contract on static methods, similar to what you would expect from static virtual methods if they'd exist in C++
by Bruno van Dooren
How concepts can be used in template programming for partial specialization
by Bruno van Dooren
This article describes a way to hash data using the latest Win32 API and C++
by honey the codewitch
Make your projects far more powerful with some foundational code templating techniques

All Articles

Sort by Title

Templates 

7 Aug 2016 by Member 11579281
Upgrading to .Net framework 4.5 . Where's the C# services installer project template? Or is there a new method for installing / deploying services? Thanks!What I have tried:Tried searching through nuget web and found no love.
7 Aug 2016 by David_Wimbley
The way to attach an installer to your windows service is the following steps1) In new project setup, select Windows -> Windows Service project template2) Select/double click on Service1.cs3) Right click on the Design window that opened from step 2, and select "Add Installer"4) You...
17 Mar 2023 by Phoenix Liveon
How do we properly create an overloaded operator specifically this "
17 Mar 2023 by klarrra
Find some good help here. https://kbrown.hashnode.dev/c-in-computer-science
31 Jul 2014 by SrikantSahu
This tip can be used to know more about how dojo templated widgets can be created and used inside a portlet programmatically.
13 Mar 2013 by Michael D Bray
Filling in text templates from a data source.
13 May 2014 by Kinna-10626331
Hi , I'm writing the documentation of a portal that I made in SharePoint with external data sources.I want to write the developer guide and I need some guidelines to point me in the right direction , something like a template. I googled but I couldnt find anything useful, only manuals about...
6 Jul 2020 by Greg Utas
Registering and efficiently accessing polymorphic objects
13 Sep 2013 by ali rez
well, i was following one of the tutorials in this site, and was developing my own template, now, the problem is, for part of the script, i need to check more than one parameter, so naturally i tried this ---> $if$($a$==1 || $b$==1)
7 May 2014 by Gregory Morse
Activating WRL audio interfaces in native C++
15 Sep 2014 by Kinna-10626331
I would like to add the number of columns and rows through binding . I have been looking for it but I only find how to bind the content or how to do this task programatically in the code behind.I want to do it in the ColumnsDefinitions and RowDefinitions but I am starting to think that there...
24 Apr 2017 by Orjan Westin
Using template specialization to create code handling common base64 encoding varieties
16 Jan 2013 by Ajay Vijayvargiya
Covering the nitty-gritties of C++ templates.
8 Sep 2022 by Bruno van Dooren
How concepts can be used in template programming for partial specialization
7 Apr 2021 by Southmountain
I try to compile a legacy project from here on this website. it is in old style of C++ template before 2003. it is a straight definition, but I got many errors and the first error is: Error C2238 unexpected token(s) preceding ';' the template...
2 Apr 2021 by Andreas Gieriet
g++ tells error: need ‘typename’ before ‘T::abc’ because ‘T’ is a dependent scope typedef T::abc local_type; You might want to turn the time back and compile with the matching C++ standard setting on your compiler. E.g. for g++, there is a...
7 Apr 2021 by Southmountain
this link answered this question.
31 Dec 2012 by John Bandela
This post discusses another alternative to lambda move capture.
1 Dec 2019 by Vincent Maverick Durano
The new version of ApiBoilerPlate has recently been released. In this post, we will take a look at the new features added to the template.
2 Jun 2013 by eng.amir.ebrahimi
heyAre therer any tools to completely download a website template ? I'm not talking about "save as .." option at all ...I want css and images and ... on different folders , ready to use in visual studio ... ;)
8 Feb 2020 by OwenDavies
When you create an Azure Storage account to store files in a container you can set the permissions to what ever access level you want, and you can generate tokens to access the blob storage account with set periods of time. That’s what we’re going to do here today.. 0.
9 Apr 2015 by Parvathaneni Mamatha
How to use Razor Views as Email Templates and Localize them using sample WebAPI
20 Jun 2021 by dimitronic ph
I am trying to write a library using expression templates, and I need to find a way to assign the expression in an variable without evaluating it (which is what I've found in every resource, eg Wikipedia ). Also, since I want to do this for...
3 Jul 2019 by rohitsies
This article describes an advanced technique and configuration to automatically transform and run your all or selected T4 templates when a project is build.
27 May 2021 by John M. Dlugosz
Using swap etc. from generic code must be done properly. Here’s how to fix it for good.
3 Jan 2013 by chris_on_web
I want to set a background image and repeat only vertical on y.my code is
3 Jan 2013 by Sergey Alexandrovich Kryukov
This looks like the answer: http://stackoverflow.com/questions/1782979/wpf-how-do-i-create-a-background-that-repeats-horizontally-without-scalling[^].As you want "repeat-y", not x, flip x and y in the code.Please try.—SA
24 Jun 2013 by Jashobanta
Hi,I am trying to create a style that is to be applied to a Bing Map PushPin control. But I need to set the location of the Pushpin from the page where the control is implemented (like templateBinding) and not in the style. The control template in the style will be applied on an infobox...
12 Sep 2014 by Remzi Karahasan
Hi there,I have two source message and one destination message. (Eventually I would like to have another destination message to map only invalid records.) What I want to do is, loops through source message part one, compare against the source message two and find out if there is any...
7 Mar 2013 by Weidong Shen
This article describes the IClientChangeTracking interface generated by Self-Tracking Entity Generator and Visual Studio 2012.
12 Dec 2015 by FrontrunnerSoftwareIreland
I have a button template as follows that doesn't bring in values from it's templated parent via TemplateBinding apart from Content strangely and the VisualStateManager doesn't do anything at all:
7 Feb 2014 by CzimerA
Hello Everyone!I have a problem with an old project, that they want me to compile in Visual Studio. This application was working in QtCreator with gcc compiler, but while in VS10 with Qt implementation it has some compile errors. The linker doesn't find the methods in the dll. This is a...
7 Feb 2014 by Richard MacCutchan
I suspect it may be that the DLL's exports are standard C style, but the code you are generating is C++. You need to use the following construct around the QT headers.extern "C"{// QT includes go here}See http://msdn.microsoft.com/en-us/library/0603949d.aspx[^] for a full description.
8 Feb 2014 by nv3
Your SettingsWidgetList class is a template class and hence the compiler generates code for it at the moment you instanciate an object of it with a concrete template parameter. When you compiled your DLL, there probably was no need to instantiate any such object in your library code. And hence...
20 Mar 2018 by Member 13737179
Hi, I am new to expression template programming, I went through this tutorial. It's pretty good I understand things a bit but not able to replicate code to working one. Can someone help ? What I did -> From [listing 3] I saved it as matrix.h file but don't know how can I make a new matrix...
20 Mar 2018 by Rick York
The right and left parameters would be of type LeftOp and RightOp and those are of type Matrix. You can see this by looking at the template code in the listing. Here are two snippets : template class EtMatrixAdd { public: ...
8 Jan 2014 by zaphoed
Helpers to declare and define multicast event sources and sinks in C++
3 Mar 2014 by vikrantc1355
C++ Numeric Limits and Template Specialization
10 Apr 2015 by hans.sch
Hi all,I am exploring C++11 templates with Microsoft's VS2013. Recently I came across the following problem:* I have a template function with a dummy function body.* I want to create a specialization that works for all suitable types, e.g. all integer types, all floating-point types, or...
11 Apr 2015 by Philippe Mori
The following links might help :https://msdn.microsoft.com/en-us/library/ee361639.aspx[^]http://en.cppreference.com/w/cpp/types/enable_if[^]By the way, I tried your program and it works perfectly so I'm not sure of the code that you have kept...#include...
19 Apr 2015 by hans.sch
While playing with other aspects of templates, I came across the solution. It lacks some elegance because it requires a dummy parameter.templateU Invert2(U const &data, ...){ // default return data;}templatestd::enable_if_t::value,...
18 Nov 2018 by Member 13722008
is possible to convert? struct sKeyState { bool bPressed; bool bReleased; bool bHeld; }; int m_numKeys; Uint8* m_keyOldState; const Uint8* m_keyNewState; bool m_mouseOldState[5]; bool m_mouseNewState[5]; owncopy( m_keyNewState, m_keyNewState + m_numKeys, m_keyOldState...
18 Nov 2018 by RickZeeland
You can try the free version of this Converter: C++ to C# Converter[^] But be warned, these converters are not suited for complex applications !
13 May 2012 by 915086731
I get some compiling errors about template instantiation , but I can't find where the syntax errors happens. Can some help me?template class SingleList;template class SingleListNode{private: friend class SingleList; SingleListNode()...
13 May 2012 by Stefan_Lang
Seems to work in Visual Studio, so I can't say for sure what's the problem.However, I've found that friend declarations involving templates can be quite tricky to declare correctly. (used to be near impossible in older versions of VS) On occasion I fixed these problems by declaring a helper...
14 May 2012 by CPallini
Try to add the following two lines (deferred declarations):template class SingleListNode;template ostream& operator& out);template class SingleListNode{
14 May 2012 by Aescleal
The zeroth thing to do with template problems...Grab the latest compiler you can.The first thing to do with any template instantiation problems...Get rid of the template. Now I know this sounds weird but if you replace hard-code everywhere the compiler might give you an idea of...
25 May 2012 by 915086731
To my gcc , just modify the following statement friend ostream& operator(ostream& os,SingleListNode& sln)to friend ostream& operator& sln)
30 Sep 2011 by RKnGl
//C++_Class_Te...
29 Sep 2011 by Graham Breach
First, don't use a separate source file for your template code - put it in the header file:template class buffer {public: buffer(unsigned int size) { items = new T[size]; }private: T* items;};There is no default constructor defined, so you need...
29 Sep 2011 by Richard MacCutchan
I think this page[^] will help to explain it.
19 Apr 2023 by wpte
Hello,I'm new to templates in C++ and I'm having issues to port my c# code to c++I want to create a circular buffer which can hold any type thus a template is required.In c# I have this (simplified code)public class buffer;{ private T[] items; public buffer(int...
19 Apr 2023 by Member 15983336
template struct Buffer { using value_type = T; T data[N]; constexpr int size() { return N; } };
1 Dec 2017 by Jon McKee
How to do it and why it works
11 Nov 2010 by vortexico
Hello, I am pretty new to the Document/View based MFC programs.I am searching for 2 days now to an answer to my problem.1 I have a toolbar derived class called CToolBarEditor2 I have derived one so I could replace one of the buttons with an CEdit3 CToolBarEditor is a member of the...
12 Nov 2010 by basementman
1) make your CXXXtoolbar member a public member in mainfrm.h2) include mainfrm.h in your view class cpp3) use code like this below to access your toolbar:CMainFrame *pFrame = (CMainFrame *)GetApp()->m_pMainWnd;if (pFrame) pFrame->m_wndToolBar.DoSomeFunction();
13 Nov 2010 by vortexico
Thank you for your reply.How does it come that I couldn't find a solution like this on internet?Or why does the example project not have this?Anyway, Now I know how to do it, thank you, it worked.
27 Jan 2022 by Phoenix Liveon
The problem was I cannot properly separate the declaration & definition of a templated symbols such as classes, structs, functions, and many more. Before we could continue I have this quick statement on how I organized my work/project. We can...
25 Jan 2022 by Stefan_Lang
Quote: How do we do it right 1. Post your actual question at the top, maybe even in the topic heading 2. Provide your goal and relevant detail information after that, in the body of your posting. Make sure to keep it reasonably short by...
25 Jan 2022 by Stefan_Lang
I have read, but didn't understand a word of, your question. In the topic header you mention templates, so the only advice I can offer is check out this guide: https://itnext.io/c-20-modules-complete-guide-ae741ddbae3d[^] The section Quote:...
27 Jan 2022 by Stefan_Lang
Quote: The problem was I cannot properly separate the declaration & definition of a templated symbols such as classes, structs, functions, and many more Short answer: you cannot! From the link I posted above (emphasis mine): Quote: However, when...
17 Jan 2016 by cmbay
I am creating a WPF Custom Control Template and I would like one of the GeometryDrawing Brushs to use the Background Brush of the control's container. For example if I put this control on a Window I would like this particular Brush to use the Window's Background Brush. Like wise if the control...
18 Jan 2016 by Sergey Alexandrovich Kryukov
cmbay asked:…So the question is, is it possible to bind the Background of my control to its' container's background without explicitly identifying the container.It can be done by binding using RelativeSource. Please see:RelativeSource Class (System.Windows.Data)[^],C# Corner:...
9 Sep 2012 by Medo-I
Hello allThere are many website templates, but many of them don't support ASP.NET.So any one know template website like them which has templates support asp.net?Thank you in advance
9 Sep 2012 by ridoy
http://www.buytemplates.net/promotion-templates/asp.net-web-templates.php[^]http://forums.asp.net/t/1306292.aspx/1[^]
9 Sep 2012 by Espen Harlinn
Have a look at ASP.NET Themes and Skins[^]Companies like DevExpress provide a range of pleasing themes[^] for use with their libraries and asp.net.Best regardsEspen Harlinn
12 Jul 2013 by David O'Neil
VS 2012 gives an 'error C2248: ... cannot access protected member declared in class...' in the following minimal code stripped from a complete project. VS 2008 has no problems with it, and executes as expected.The line right before the issue calls the protected member in question, and no...
13 Jul 2013 by Matthew Faithfull
The rules did change but I don't think that's the problem. I think it's just that Microsoft started applying the existing ones.It's a tricky case but I think the problem can be summarized as trying to use a protected member function pointer as a template parameter to a function that does not...
13 Jul 2013 by pasztorpisti
Unfortunately I have no VS2012 at hand but I have a g++ that has always been my friend when I wanted to check whether a piece of code follows the standard or not. Using my VS2010 and g++4.5 (cygwin) I have put together the following example program that may serve you with some useful...
20 Mar 2017 by csrss
Hi there. I am trying to check for a template type if it is a pointer, basically my goal is to create a container class, which will know how to compare objects irrespectively if the object is pointer or not. I want a class to dynamically select comparing method. My current code is below, but it...
7 Jul 2011 by Doc Lobster
Be sure that your array has the right size - without using size_of!
28 Dec 2014 by Michael Gazonda
Have you ever been working with templates or constexpr and wanted to run a loop? Or maybe you have a loop you'd like to unroll and see if your program will run faster? Welcome to static_for.
18 Oct 2020 by Espen Harlinn
An introduction to C++ 20 concepts
20 Nov 2014 by Ẵsħĭsħ ɤaaj
I am trying to create a SPA model which is able to create, update, delete scheduled tasks in Visual Studio 2012 using MVC4 Hottowel SPA template. Here i have a demo class which I need to use in creating database but unable to get 1) the context of the database. 2) how to configure the...
24 Jan 2014 by Cuccurullo.Alex
Hi everyone, I am trying to create a CustomUser control, because I need a base template for all userControls in my App (I'm trying to make a Single-Window-Application) with a sort of Window-in-Window, where the userControls are sort of windows in the MainWindow.xaml.To make it I tried to...
24 Jan 2014 by Ron Beyer
Something seems off about your code, here is what a template looks like for a project I'm working on: As you see, I'm setting the default style for a user control named TestBlockControl. It should work the same for...
24 Jan 2014 by Cuccurullo.Alex
I solved this on my own by creating the template in the constructor of my control.. It was not easy but I did it..Here the code I wrote.this.DataContext = this; var template = new ControlTemplate(); var mainGrid = new...
16 Mar 2016 by Member 7833501
Hello,I am looking for a way to create a "ready to send" email-file per c#.So far I can create .oft files or even .msg files, with this behaviour per Outlook UI.Is there any way to create such a file per C#?Thanks in advanceMarc.What I have tried:I can create .eml...
14 Mar 2016 by ZurdoDev
There actually is no such things as a "Ready-to-send-email." When you are viewing your emails in Outlook they are not oft or eml files or even msg files. Outlook is loading the subject into a subject field and the body into a textbox and pulling the data from its database.You can do the...
16 Mar 2016 by Member 7833501
I found now a solution! Perhaps someone else can also use it.I create now a eml-File and to make it "sendable" / "ready to send" you just have the add the header "X-Unsent: 1" and if you open it now you can immediate send the email :-)here a short example:var message = new...
25 Sep 2014 by Sreekanth Mothukuru
In this article, we are going to create responsive HTML table using FooTable Plug-In and a hint of client side data binding using Handlebars.js library.
11 Sep 2014 by Member 11073111
I would like to use variadic templates to help solve an issue using va-args. Basically, I want to call a singular function, pass into the function a "command" along with a variable list of arguments, then dispatch the arguments to another function.I've implemented this using tried and true...
23 Sep 2014 by jsolutions_uk
I presume the problem you are having here is that you are getting an error along the lines of cmd0 does not take 5 arguments? This is because the function created as a result of the DispatchCommand(CMD_TWO, 5, 6, 7, 8, 9) is creating code that expects to call cmd0 (and cmd1) with all 5...
28 Feb 2020 by OwenDavies
Using Terraform to create an Azure Virtual Machine
27 Dec 2010 by Ashish Kaila
Declaratively and visually create custom windows in WPF
5 Apr 2013 by Member 8309007
Is there some form of template that could be used to create multiple email accounts in Outlook 2010? Or any method that would allow the details of the incoming, outgoing mail server , both ports, and other specifics? Something that would only leave the need for a username and password would...
28 Jul 2013 by Abrar Fahad
Please Help me To create customized a gridview with template from this data which is given below and the WPF xml view is given below just under the code.public partial class MainWindow : Window { List Employeedatalist = new List(); ...
28 Oct 2021 by honey the codewitch
This is a little templating engine build tool I use to make my code generation projects more maintainable.
28 Nov 2014 by Mario Majčica
A way to add a custom category for your Visual Studio Templates
1 Aug 2013 by JainPrince
Hi,I am trying to customize the type of existing field of TFS bug template using TFS Power Tools.There is a field "Priority" of type int, my requirement is to change the type of this field to string.But i am getting following error message while uploading the customized bug...
13 Nov 2010 by Kunal Chowdhury «IN»
Customized Scrolling in Silverlight using Expression Blend
8 Sep 2013 by XiaoChuan Yu
Talks about how to customize the look and behaviour of WPF Expander by templating it.
4 Dec 2012 by trucha13657
Hello!I've created datagrid with combobox (reading data from DB), but need to fix some problems, maybe someone of you can help me ;)First of all, I used grouping in dataGrid (group by name Wzór#), and everytime I want to add new element, it shows on the...
15 Dec 2019 by Ahmed Bouchefra
How to send Ajax requests in Django 2 and Python 3.7 to add CRUD operations in your application and manipulate your Django models and database without having to refresh your web pages each time
15 Dec 2019 by Ahmed Bouchefra
A Django 2 CRUD example application using generic class based views using the latest Python 3.7 version
15 Jan 2020 by Ahmed Bouchefra
In this tutorial, we’ll see by example how to create a CRUD application from scratch and step by step. We’ll see how to configure a MySQL database, enable the admin interface, and create the django views.
29 Dec 2013 by Member 10493265
Hello! My name is Kristoffer Andersen and there isn't happening anything much in my life so I decided to start coding and I'm 16 years old now so Its the perfect time to start.. I started coded a few months ago and have now downloaded and fully installed Microsoft Visual Studio 2013 and I have a...