Click here to Skip to main content
16,006,065 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: calling managed code from unmanaged code (vc6) Pin
Dragan Matic5-Sep-06 21:56
Dragan Matic5-Sep-06 21:56 
GeneralRe: calling managed code from unmanaged code (vc6) Pin
led mike6-Sep-06 5:16
led mike6-Sep-06 5:16 
QuestionIcon information?? Pin
Sgg2453-Sep-06 19:12
Sgg2453-Sep-06 19:12 
AnswerRe: Icon information?? [modified] Pin
WillemM4-Sep-06 5:29
WillemM4-Sep-06 5:29 
Questionwhat is the implementation? Pin
robeelyn2-Sep-06 5:02
robeelyn2-Sep-06 5:02 
AnswerRe: what is the implementation? Pin
Jun Du2-Sep-06 5:44
Jun Du2-Sep-06 5:44 
GeneralRe: what is the implementation? Pin
bryce20-Sep-06 19:22
bryce20-Sep-06 19:22 
QuestionTricky bug in a VC 8.0 compiler (preprocessor) [modified] Pin
FilipStrugar1-Sep-06 15:32
FilipStrugar1-Sep-06 15:32 
I've been working on a memory usage logging system, and came upon this strange preprocessor bug appearing while using __VA_ARGS__ in a specific way.

This is the source that should but doesn't compile on VC++ 8.0 (included is also a hacky workaround):

<br />
#include <new.h><br />
<br />
//hackfix:<br />
//template<class T>  void *     internal_alloc( int locationID, int lineNumber, const char * pFileName, const char * pCompilerBugFix = 0 )<br />
template<class T>  void *     internal_alloc( int locationID, int lineNumber, const char * pFileName )<br />
{<br />
   return 0;//malloc( sizeof(T) );<br />
}<br />
<br />
//hackfix:<br />
//#define                       internal_new( __obj_type, ... )                new( internal_alloc<__obj_type>( __COUNTER__, __LINE__, __FILE__, "" ) ) __obj_type( __VA_ARGS__ )<br />
#define                       internal_new( __obj_type, ... )                new( (internal_alloc<__obj_type>(__COUNTER__, __LINE__, __FILE__)) ) __obj_type( __VA_ARGS__ )<br />
<br />
void main()<br />
{<br />
   int * pTest1 = internal_new( int );       // this one doesn't work properly<br />
   int * pTest2 = internal_new( int, 1 );    // this one works properly<br />
<br />
   // preprocessed output, buggy version:<br />
   //int * pTest1 = new( (internal_alloc<int>(0, 16  ".\\blahblah.cpp")) ) int(  );     <- notice the missing comma after '16'<br />
   //int * pTest2 = new( (internal_alloc<int>(1, 17, ".\\blahblah.cpp")) ) int( 1 );    <br />
<br />
   // preprocessed output, hackfix:<br />
   //int * pTest1 = new( internal_alloc<int>( 0, 16, ".\\blahblah.cpp"  "" ) ) int(  );       <br />
   //int * pTest2 = new( internal_alloc<int>( 1, 17, ".\\blahblah.cpp", "" ) ) int( 1 );    <br />
}<br />


It looks like the __VA_ARGS__ solver removes the wrong comma in 'no arguments' scenario Smile | :)

I wonder how it works on some other compiler?
AnswerRe: Tricky bug in a VC 8.0 compiler (preprocessor) Pin
FilipStrugar2-Sep-06 12:07
FilipStrugar2-Sep-06 12:07 
Questiongmtime on WinCE giving local time Pin
dummy80831-Aug-06 18:10
dummy80831-Aug-06 18:10 
QuestionDeclaring a String object as an automatic variable Pin
juju_hli31-Aug-06 8:41
juju_hli31-Aug-06 8:41 
AnswerRe: Declaring a String object as an automatic variable Pin
Nish Nishant31-Aug-06 9:00
sitebuilderNish Nishant31-Aug-06 9:00 
GeneralRe: Declaring a String object as an automatic variable Pin
juju_hli31-Aug-06 9:03
juju_hli31-Aug-06 9:03 
QuestionHow to combine all emls into a dbx via programming Pin
Parshant Verma30-Aug-06 2:24
Parshant Verma30-Aug-06 2:24 
QuestionSelecting an item in listview via windows api. Pin
Marco225030-Aug-06 2:16
Marco225030-Aug-06 2:16 
QuestionGetting Icon information from which application is run Pin
Sgg24530-Aug-06 0:14
Sgg24530-Aug-06 0:14 
AnswerRe: Getting Icon information from which application is run Pin
Milton Karimbekallil1-Sep-06 2:21
Milton Karimbekallil1-Sep-06 2:21 
QuestionDifference b/w #include and #import? Pin
Vikas_Yadav28-Aug-06 21:41
Vikas_Yadav28-Aug-06 21:41 
AnswerRe: Difference b/w #include and #import? Pin
Nish Nishant29-Aug-06 4:07
sitebuilderNish Nishant29-Aug-06 4:07 
QuestionAnchors and Inheritance Pin
Mohamad H. ARAB27-Aug-06 22:58
Mohamad H. ARAB27-Aug-06 22:58 
QuestionBinaryWriter won't write japanese correctly. [modified] Pin
samkook27-Aug-06 14:27
samkook27-Aug-06 14:27 
QuestionProblem with CLS compliance of enums Pin
Super Lloyd27-Aug-06 5:22
Super Lloyd27-Aug-06 5:22 
QuestionHow to use recompiled header file? Pin
Super Lloyd27-Aug-06 4:11
Super Lloyd27-Aug-06 4:11 
QuestionManaged Wrapper for native abstract base class Pin
zenzero27-Aug-06 2:22
zenzero27-Aug-06 2:22 
AnswerRe: Managed Wrapper for native abstract base class Pin
tutu_cloud6-Sep-06 9:47
tutu_cloud6-Sep-06 9:47 

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.