[mapguide-internals] PATCH: Ticket 1047 Error in marshalling of unmanaged strings in .NET wrappers in RFC 68 implementation

Trevor Wekel trevor_wekel at otxsystems.com
Mon Jul 27 12:36:51 EDT 2009

Hi Anil,

The patch is fine.  Another alternative would be to drop GetMultiByteClassName() from INTERNAL_API and use the EXTERNAL_API GetClassName() instead.  GetNameSpace() could also be moved to EXTERNAL_API and switched to return a STRING.

>From a convention perspective, INTERNAL_API should never be used outside of C++.  EXTERNAL_API are unofficial/unsupported APIs which are exposed in PHP/.Net/Java.  These "EXTERNAL" APIs can be used to implement functionality which is not interesting to the end developer, ie. hidden goo that we really don't want to expose publically.

By comparison, PUBLISHED_APIs are fully supported, documented APIs which remain stable from release to release and are intended for public consumption.

I did the initial review of RFC 68 but did not realize that these APIs were going to be used in .Net.

So the patch you have is fine but it is more in line with existing APIs conventions to do the following:

virtual STRING GetClassName(); // existing API, use this instead of GetMultiByteClassName()
virtual STRING GetNameSpace(); // move from INTERNAL_API 


virtual char* GetMultiByteClassName() // remove
virtual char* GetNameSpace(); // move to EXTERNAL_API and switch type

Swig/IMake should automatically marshal the STRING type.


-----Original Message-----
From: mapguide-internals-bounces at lists.osgeo.org [mailto:mapguide-internals-bounces at lists.osgeo.org] On Behalf Of Anil Patel
Sent: Friday, July 24, 2009 5:35 PM
To: mapguide-internals at lists.osgeo.org
Subject: [mapguide-internals] PATCH: Ticket 1047 Error in marshalling of unmanaged strings in .NET wrappers in RFC 68 implementation

Hello all,

This is my first time submitting a proposed patch here, so please forgive any mistakes and I'll try to correct them ASAP.

I've logged a ticket and proposed patch to the ticket to fix a error in the marshalling of unmanaged strings in the .NET wrappers introduced in the RFC 68 implementation changes.

The ticket can be found here:


The patch file is attached to the ticket and also to this email.

Please let me know if there are any questions or issues.

--Anil Patel

More information about the mapguide-internals mailing list