Pointers and C#

P

Peter

1) We create an assembly with Managed Extensions for C++ named
some_name.dll. This assembly has source code like the following

Byte * some_method() // a method returning a pointer, defined within some
class
{
....
}

This assembly is created with VS2003, i.e. it is a .NET 1.1 assembly.

2) We then create an application in C# using the assembly of step 1. In this
application we try to use some_method from the assembly. When we compile
this application with C# in VS2003 everything is fine: the C# compiler
issues no error message and the function works as expected when executed.

3) When we compile the same C# code with C# in VS2005, the compiler issues
the error message: "language does not support this construct". Using other
methods which do not use pointers from the same assembly still works
properly.

Clearly something must have changed between C#/VS2003 and C#/VS2005 with
regards to using pointers. It would be instructive to know what has been
changed. Furthermore, how can the issue be dealt with and worked around?

Peter
 
D

David Anton

I don't have an answer, just some advice - *don't* use Managed Extensions for
C++ (VC++ 2003). This was horribly buggy and the entire 2003 syntax was
thrown out for 2005, replace by C++/CLI.
--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
C++ to Ruby
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB or C# to C++/CLI
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top