You cannot declare a handle type in a native type. vcclr.h provides the type-safe wrapper template gcroot, to refer to a CLR object from the C++ heap. This template lets you embed a virtual handle in a native type and treat it as if it were the underlying type.
The gcroot template is implemented using the [...]
8
2010
Using unmanaged code/types from managed code
If you like this post, please visit our sponsors above. Thanks!
25
2010
Arrays in C++
If you like this post, please visit our sponsors above. Thanks!
Introduction
In some programs, you may need to represent a list of items that share some characteristics. You can declare as many variables as necessary to represent such items. Here is an example of 5 numbers declared in a program:
// This is the main project file for VC++ application project
// generated using an Application Wizard.
#include [...]
21
2010
How to Easily Download Large Number of Images from Flicker.com
If you like this post, please visit our sponsors above. Thanks!
Recently I needed some images to create a dataset for a project I am doing. While Flickr.com seemed to be the best source. All i needed to do was to put in a query and a large number of relevant images would show up. But downloading original images from Flickr.com can be bit of a [...]
15
2009
Two values one address—A challenge for programmers
If you like this post, please visit our sponsors above. Thanks!
Have a look at this code, it shows some astonishing results.
1: #include <iostream.h>
2: using namespace std;
3:
4: int main()
5: {
6: const int x = 10;
7: int [...]
4
2009
3
2009
Reversing words in a string
If you like this post, please visit our sponsors above. Thanks!
Problem statement: Given a string you have transform the string such that the order of words in the string is reversed.
Input: This is a string
Output: string a is This
Share on Facebook
24
2009
Callbacks, Threads and GUI
If you like this post, please visit our sponsors above. Thanks!
This article assumes that you have a working knowledge of C++ callbacks. Recently me and a friend encountered a situation where we had to show some data on dialog box that was generated inside of an independent thread. Sharing memory can be a good idea of passing a pointer to the dialog box. However, we [...]
24
2009
Callbacks C++
If you like this post, please visit our sponsors above. Thanks!
This tutorial assumes that the reader has a basic knowledge of C++ function pointers and pointers to class member functions.
Callback function
A callback function is a function whose pointer is passed to another function and and that function calls the first function using the pointer. When such a call is made, it is said that [...]
1
2009
Linked List: Tutorial I
If you like this post, please visit our sponsors above. Thanks!
Although linked lists sounds kind of scary, don’t worry they are really easy to use once you’ve got a little practice under your belt! Linked lists form the foundation of many data storing schemes in my game!
They are really nice when you don’t know how many of a data type you will need, and [...]
Generating Documentation from XML Comments in C#
If you like this post, please visit our sponsors above. Thanks!
C# allows developers to embed XML comments into their source files—a useful facility, especially when more than one programmer is working on the same code. The C# parser can expand these XML tags to provide additional information and export them to an external document for further processing. This article shows how to use XML comments [...]