Re: Compiler bug in VC++ .Net 2003
- From: mapi33dev <mapi33dev@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 6 Jun 2005 07:06:01 -0700
Hi Jochen
Of course this line is :
(*outParam)[i] = Els::Crash;
BUT FORUM WEB UI REPLACES IT TO SMILE :-((
-------------------------------- test.h --------------------------
#pragma once
using namespace System::Runtime::InteropServices;
#define V_OK 17235968
#define V_HALT 17235969
#define V_CRASH 17235970
namespace managedC
{
public __value enum Els : unsigned int
{
Ok = V_OK,
Halt = V_HALT,
Crash = V_CRASH
};
public __gc class testClass
{
public:
static void TestMethodEnum([OutAttribute] Els (*outParam)[]);
};
}
-------------------------------- test.h --------------------------
-------------------------------- test.cpp --------------------------
#include "test.h"
#using <mscorlib.dll>
namespace managedC
{
void testClass::TestMethodEnum([OutAttribute] Els (*outParam)[])
{
*outParam = new Els[2];
for(int i = 0; i < (*outParam)->Length; i++)
(*outParam)[i] = Els::Crash;
}
}
-------------------------------- test.cpp --------------------------
-------------------------------- test.cs --------------------------
using System;
using System.Collections;
using managedC;
namespace marshalBug
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
for(int i = 0; ; i++)
{
Els[] paramEnum;
testClass.TestMethodArray(out paramEnum);
foreach(Els t in paramEnum)
Console.WriteLine(t);
GC.Collect();
}
}
}
}
-------------------------------- test.cs --------------------------
.
- References:
- Compiler bug in VC++ .Net 2003
- From: Sergey Golovkin via . NET 247
- Re: Compiler bug in VC++ .Net 2003
- From: Jochen Kalmbach [MVP]
- Compiler bug in VC++ .Net 2003
- Prev by Date: Re: Divide error during debug
- Next by Date: Re: Can I do this?
- Previous by thread: Re: Compiler bug in VC++ .Net 2003
- Next by thread: What is the easy way to provide c# interface to my C++ unmanaged d
- Index(es):
Relevant Pages
|