Hello,

I believe, this is an easy task to do, but I couldn't find the way to do it!

I'd like to code the following function

[C#]
void DemoFunction(ref IntPtr somePointer)
{
somePointer = 1234;
}

in MC++.
But how should I declare it?

[MC++]
void DemoFunction(IntPtr^ somePointer)
translates to
[C#]
void DemoFunction(ValueType somePointer)

Please help!
Thanks VERY MUCH in advance!

Regards,
Max

RE: Marking System.IntPtr as ref ... but in MC++ by DavidAnton

DavidAnton
Mon Oct 08 07:51:03 PDT 2007

I think you're confusing MC++ with C++/CLI. The C++/CLI equivalent is (via
Instant C++):
private:
void DemoFunction(IntPtr %somePointer)
{
somePointer = 1234;
}
The MC++ (2003) equivalent is:
private:
void DemoFunction(IntPtr &somePointer)
{
somePointer = 1234;
}

--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
C++ to C++/CLI
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB or C# to C++/CLI


"Markus EÃ?mayr" wrote:

> Hello,
>
> I believe, this is an easy task to do, but I couldn't find the way to do it!
>
> I'd like to code the following function
>
> [C#]
> void DemoFunction(ref IntPtr somePointer)
> {
> somePointer = 1234;
> }
>
> in MC++.
> But how should I declare it?
>
> [MC++]
> void DemoFunction(IntPtr^ somePointer)
> translates to
> [C#]
> void DemoFunction(ValueType somePointer)
>
> Please help!
> Thanks VERY MUCH in advance!
>
> Regards,
> Max
>
>
>