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

Managed C++/CLI

 
AnswerRe: traffic light simulation..mfc using vb.net Pin
Christian Graus20-Sep-05 18:49
protectorChristian Graus20-Sep-05 18:49 
AnswerRe: traffic light simulation..mfc using vb.net Pin
RichardS21-Sep-05 6:08
RichardS21-Sep-05 6:08 
Questionjumble words.... using mfc vb.net Pin
Aisya Sofea20-Sep-05 16:26
Aisya Sofea20-Sep-05 16:26 
AnswerRe: jumble words.... using mfc vb.net Pin
RichardS21-Sep-05 6:04
RichardS21-Sep-05 6:04 
Questionmfc Pin
Aisya Sofea20-Sep-05 16:12
Aisya Sofea20-Sep-05 16:12 
AnswerRe: mfc Pin
Christian Graus20-Sep-05 18:53
protectorChristian Graus20-Sep-05 18:53 
QuestionLink time info gathering Pin
Rostfrei20-Sep-05 10:34
Rostfrei20-Sep-05 10:34 
AnswerRe: Link time info gathering Pin
RichardS20-Sep-05 14:23
RichardS20-Sep-05 14:23 
Hi Rostfrei,

One way of doing this is to create a dummy counting class and just create instances of it. Hence this becomes:
countcpp.h:
#ifndef __COUNT_H__
#define __COUNT_H__

#include <iostream.h>

#define REGISTER_MODULE(file,des) static CCountCpp g_cppFile (file, des);

class CCountCpp
{
public:
   CCountCpp (void) { }

   CCountCpp (const char *strFile, const char *strDes)
   {
      cout << strFile << "{ " << strDes << " }" << endl;
      ++m_iCppCount;
   }

   static int m_iCppCount;
};


#endif // __COUNT_H__

This just creates a static CCountCpp object per REGISTER_MODULE define. Because of the static objects they can be the same name across modules as long as you are not including .cpp files. To use:
#include "countcpp.h"

REGISTER_MODULE(__FILE__, "disk writer");

int CCountCpp::m_iCppCount = 0;

void main (void)
{
   CCountCpp c;
   cout << "Cpp count: " << c.m_iCppCount << endl;
}

Naturally you would remove the main, it is just there for show.

regards,
Rich


"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
QuestionHelp: RAPI based utility for copying files and folders PC->PocketPC Pin
mark.thornhill20-Sep-05 3:31
mark.thornhill20-Sep-05 3:31 
Questionmovefileex + win9x + directory Pin
emmi20-Sep-05 0:02
emmi20-Sep-05 0:02 
AnswerRe: movefileex + win9x + directory Pin
RichardS20-Sep-05 7:50
RichardS20-Sep-05 7:50 
QuestionAn Algorithm !! Pin
Jomy John19-Sep-05 15:23
Jomy John19-Sep-05 15:23 
AnswerRe: An Algorithm !! Pin
Christian Graus19-Sep-05 18:18
protectorChristian Graus19-Sep-05 18:18 
GeneralRe: An Algorithm !! Pin
VaporTrace19-Sep-05 20:16
VaporTrace19-Sep-05 20:16 
GeneralRe: An Algorithm !! Pin
VaporTrace19-Sep-05 20:20
VaporTrace19-Sep-05 20:20 
GeneralRe: An Algorithm !! Pin
Jomy John19-Sep-05 23:25
Jomy John19-Sep-05 23:25 
GeneralRe: An Algorithm !! Pin
Christian Graus20-Sep-05 11:10
protectorChristian Graus20-Sep-05 11:10 
GeneralRe: An Algorithm !! Pin
Jomy John20-Sep-05 14:53
Jomy John20-Sep-05 14:53 
GeneralRe: An Algorithm !! Pin
Christian Graus20-Sep-05 14:55
protectorChristian Graus20-Sep-05 14:55 
GeneralRe: An Algorithm !! Pin
Jomy John21-Sep-05 4:52
Jomy John21-Sep-05 4:52 
GeneralRe: An Algorithm !! Pin
Christian Graus21-Sep-05 9:11
protectorChristian Graus21-Sep-05 9:11 
GeneralRe: An Algorithm !! Pin
Jomy John21-Sep-05 10:21
Jomy John21-Sep-05 10:21 
GeneralRe: An Algorithm !! Pin
Christian Graus21-Sep-05 10:25
protectorChristian Graus21-Sep-05 10:25 
GeneralRe: An Algorithm !! Pin
Jomy John21-Sep-05 21:48
Jomy John21-Sep-05 21:48 
GeneralRe: An Algorithm !! Pin
Christian Graus22-Sep-05 12:17
protectorChristian Graus22-Sep-05 12:17 

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.