Hi there,
Quick explanation : my program calls a DLL routine which returns a string-containing memptr (corresponding to a "char *" in the C++ program).
Here's a sample of the DLL code :
and here's the Progress code :
The Progress program crashes on the "get-string" instruction when the char * points to a string > 16355 Bytes...
Any idea about the reason of this crash ? Could this be a limit of the MEMPTR type (which I expected to be unlimited) ? A wrongly-set session parameter ?
Any help is welcome. Thanks in advance.
Julien
Quick explanation : my program calls a DLL routine which returns a string-containing memptr (corresponding to a "char *" in the C++ program).
Here's a sample of the DLL code :
Code:
char * sessionJava::reception() {
[...]
result = recv (ma_socket, buffer, taille, 0);
std::string var;
for(int i = 0; i < taille; i++) {
var += buffer[i];
}
delete[] buffer;
return (char *)var.c_str();
}
Code:
SET-SIZE(ptr) = 0.
SET-SIZE(ptr) = 65000.
RUN reception(OUTPUT ptr).
ASSIGN maChaine = GET-STRING(ptr, 1).
PROCEDURE reception EXTERNAL "/lib/maDLL.dll" CDECL PERSISTENT:
DEFINE RETURN PARAMETER retour AS MEMPTR.
END PROCEDURE.
The Progress program crashes on the "get-string" instruction when the char * points to a string > 16355 Bytes...
Any idea about the reason of this crash ? Could this be a limit of the MEMPTR type (which I expected to be unlimited) ? A wrongly-set session parameter ?
Any help is welcome. Thanks in advance.
Julien