[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[DotGNU]pInvoke params problem
From: |
Chris Smith |
Subject: |
[DotGNU]pInvoke params problem |
Date: |
Mon, 7 Oct 2002 17:10:37 +0100 |
On Sunday 06 October 2002 06:31, Gopal V wrote:
> With XSharp to refer, I think PInvoke has been tortured enough .
> GW Api cannot not prove to be more troublesome ;-)
Okay, What's the matter with the attached code then?
I've a C function that looks like this:
void
test_params( long level, const char *str, int len )
{
printf( "Level: %ld Str: %p Level: %d\n", level, str, len );
}
I export it as:
[DllImport("libexample")]
extern public static void test_params( long level, String msg, int len );
Call it like this:
Goldwater.Native.test_params( level, msg, msg.Length );
OR
Goldwater.Native.test_params( 100, "Hello", 5 );
And I get this output:
Level: 63 Str: (nil) Level: 135765976
Hmm.
I'm building with the latest tarball (not CVS) release of cscc.
The attached code has a 'build' script to get things working.
This is a simple example extracted from the more complicated wrapper suite
I'm trying to construct... that one's worse as it core dumps!!
Cheers.
Chris
--
Chris Smith
Technical Architect - netFluid Technology Ltd.
"Internet Technologies, Distributed Systems and Tuxedo Consultancy"
E: address@hidden W: http://www.nfluid.co.uk
- [DotGNU]To run ./hello.exe, Gopal V, 2002/10/01
- Re: [DotGNU]To run ./hello.exe, Chris Smith, 2002/10/10
- [DotGNU]pInvoke params problem,
Chris Smith <=
- [DotGNU]Re: pInvoke params problem, Chris Smith, 2002/10/07
- Re: [DotGNU]pInvoke params problem, Chris Smith, 2002/10/07
- Re: [DotGNU]pInvoke params problem, Rhys Weatherley, 2002/10/07
- Re: [DotGNU]pInvoke params problem, Chris Smith, 2002/10/08