XOMBIE...very very thanks for make worry for the poor KCC
In fact, after one month of search ....and several helps by you all...Us and French forum.
I have found nearly what i search.....
After a long long time and several successive problems....
1/How send a VB dynamical string array to PB ??
Fixed by SROD with the structure
2/How not use the exe pointers ??
I found this solution : "Copy in a new array in the DLL."
Like this i can use the new array, like i want, Dim, Redim, ArraySize, Add lines, Delete lines....
3/How return the array from DLL to exe caller ??
After try several method...i have choose the first found at the beginning: "The pointer of Array"
For my little head..it's the more simple
But i have changed the VB code, because before, i copy directly pointers of DLL array, in VB array
And when i free the VB exe array, i freeing in the same time the DLL pointers, because it's the same

And my error is here...
So now, i fixed that, in VB code i read in memory and copy array, without use the pointers, like this no risk of freeing
Finally, that works.....
But i have two regrets...
First.... i'm forced to send the size of array in VB code, otherwise the DLL can't know where stopped to read memory and that crash
Next...I'm forced too, to send a flag, for the DLL recognize, what is the exe, who call it
Because, if it's VB exe....the array is UNICODE, so i need PeekS(UNICODE)
And if it's PB exe....the array is ASCII, because i don't want compil in UNICODE, my DLL
I have the idea: "use TRUE", because in VB = -1 and for PB #True = 1 and multiply arraysize with true
After i test if the array value is negative, and if yes...the caller is VB
SROD say to me, it's not good to try to search in the memory if the array passing by the exe is or not UNICODE

And the "professional" method is to create two different functions...
I listen always my MASTER because he is very intelligent

But this time, his solution create problems to KCC
Two function by function......my DLL is already so big

So i have listen it, and stop to search solution, because it's difficult to use the API "istextunicode" if the DLL is not UNICODE (That's another member GEBONET who say that to me)
So....this is my cowpat code

For a MASTER like you, they are not one month of search, perhaps one hour
But apparently, SROD say to me, it's not a method use by the professionals
A DLL don't modify an exe array
Then.... i'm happy to create this code, even if it's not a regular method

Because...i repeat a little bit too much...but it's really the heart of hundred of my functions, and it's really important for me to create a good code

The first time...i have create a bad code ..and several softwares is bugged
If you can take a little bit of time to see, my code.
And if you found a method for not send sizearray or found if the array send is UNICODE, without compile the DLL in UNICODE....i'm very interesting
And obiously...if you see an error for the memory or other..i'm also interesting
Your advice is very very important for KCC
My code passing a VB and PB array dynamical string in DLL, modify the array (Replace five first "Sentence" word to "KCC"), add 2 lines, and return in the VB or PB exe
The second time, it reverse the function (Replace five first "KCC" word to "Sentence"), and always add 2 lines, and return in the VB or PB exe
In the ZIP, you have the caller of DLL PB, the caller of DLL VB, The exe VB caller of DLL, the EXCEL file caller of DLL (Like this you can try without VB6) , and obviously the code and the DLL
http://erdsjb.free.fr/PureStorage/Xombie.zip
I wish you a good day
And again sincerely thanks, to your interest
