🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.language.csharp
Article #9

Re: marshalling char ** from a dll in C#?

#9
From: Ron Sawyer
Date: Fri, 21 Apr 2006 02:42
28 lines
1532 bytes
It seems to be as easy as:

[DllImport("YourDllName.dll")]
public static extern int GetObjects(ref string data, int length);

// To call it...

string theData = string.Empty;

// Pad the string just in case
theData = theData.PadLeft(101,' ');

GetObjects(ref theData, 100);

I haven't fully tested it yet, but that seems to work.

"Ron Sawyer" <win8128@aol.com> wrote in message
news:4447d4c3$1@newsgroups.borland.com...
>
> I have a third party dll that has a function called GetObjects.  The
declaration is
>
> int GetObjects(char **String, int Len)
> {
>
> }
>
> How do I declare that in C#?
Technical Details
Message-ID: <4448467d@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news3.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4447d4c3$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,1fbd241866ab483b
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Ron Sawyer" <XXXRSAWYER8128XQQXX@aol.com>
From: "Ron Sawyer" <XXXRSAWYER8128XQQXX@aol.com>
Newsgroups: borland.public.csharpbuilder.language.csharp
References: <4447d4c3$1@newsgroups.borland.com>
Subject: Re: marshalling char ** from a dll in C#?
Date: Thu, 20 Apr 2006 22:42:30 -0400
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 68.67.88.125
Message-ID: <4448467d@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1145587325 68.67.88.125 (20 Apr 2006 19:42:05 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news3.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail