comp.lang.ada
 help / color / mirror / Atom feed
From: "Antonio L�pez" <alm@gtd.es.REMOVE>
Subject: Binding to functions having reference parameter
Date: Wed, 8 May 2002 16:40:25 +0200
Date: 2002-05-08T16:40:25+02:00	[thread overview]
Message-ID: <abbddn$m00$1@nsnmrro2-gest.nuria.telefonica-data.net> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1060 bytes --]

I am doing a binding to a Dll Using Win32 binding and I have a problem with
functions having reference parameters (an C array).

�How must I declare those parameters? (ada functions doesn't allow out
parameters)

One example:

Dll fucntion is declared as :

_API_EXTERN AiInt16 _API_DLL_FUNC ApiCmdBite (AiUInt8 bModule, AiUInt8 biu,
AiUInt8 sc, AiUInt8 bite_status[]);

And I declare:

subtype UCHAR is Interfaces.C.unsigned_char;

type UCHAR_Array2 is array (0 .. 1) of aliased UCHAR;

function ApiCmdBite ( bModule : My_Win32.UCHAR; biu : My_Win32.UCHAR; sc :
My_Win32.UCHAR;

bite_status : My_Win32.UCHAR_Array2 )

return My_Win32.SHORT;

However I get a warning: "bite_status" is never assigned a value, calling
the fucntion.

Obvius It needs to be done otherwise! Could you enlight me please?

I have tried to pass the parameter as bite_status :
Interfaces.C.unsigned_char'Address but I get the error: attribute "Address"
may not be used in a subtype mark

I should be able to use for example: 'bite_status(0) := 1;' or 'if
(bite_status(1) == 2)'






             reply	other threads:[~2002-05-08 14:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-08 14:40 Antonio L�pez [this message]
2002-05-08 15:19 ` Binding to functions having reference parameter Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
2002-05-08 18:39 Beard, Frank [Contractor]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox