long array passed to DLL?? 
Author Message
 long array passed to DLL??

Hi

I am writing a DLL, under windows 3.1, using Borland C++ 3.1
for windows compiling using the large memory model.
This is my first time (at writing a DLL) so forgive any obvious stupidity.
The DLL is called by an application (idl - Interactive Data Language)
which passes a very long array of bytes to the DLL by reference (2621444
bytes).
The problem I have is that the DLL can write to the first 32767 bytes
of the array, but as soon as it writes the 32768'th byte, the application
(idl) reads the whole array as being full of zeroes. Yes, the array is
indexed using a long int in the DLL, and not an int.

In the DLL the array is declared as:

  char far * Array;

and it is writen to, at least the first 32767 bytes, using simple pointer
arithmetic:

  *(Array + i) = myvalue;

where, as I said, i works from 0 to 32766, but not above - 32766 'cos I start
from 0.

Mark



Fri, 21 Feb 1997 16:29:51 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. struggling all day long: passing by address array of structures

2. passing NULL pointer from vb to c-dll of type long*

3. passing 8bytes long long type to function??

4. char size (was long long long long long int)

5. Passing arrays to dll's

6. Passing large byte-array from C# to Delphi DLL

7. Passing VB arrays to a dll written in C

8. VB 3 passing arrays to MSVC 1.52 DLL

9. Passing Array to DLL

10. passing short array parameters to VC++ DLL in VB

11. function parameters to pass a VB string array to a C++ DLL

12. HOWTO: Pass VB UDT that contains an array to VC dll

 

 
Powered by phpBB® Forum Software