Page 1 of 1

is this possible

PostPosted: July 14th, 2007, 10:41 pm
by Wardlow
Someone wrote a DLL in C++. Am I able to read the thing in Delphi, do some calculations and send back an output back to the DLL that was created in C++???

Thanks,
Wardlow

PostPosted: July 15th, 2007, 8:07 am
by Johnny_Bit
you do that all the time just by using WinAPI...

Yes you can, you just have to have way to call dlls using stdcall.

PostPosted: July 15th, 2007, 5:52 pm
by Wardlow
thanks for the reply johnny. This may seem like a hard question to answer.

I bought a book that has helped me a great deal learning delphi. The book mentions how to read the DLL, like reading a function and then being able to use that function.

But imagine there is this variable called WhatToDo in the DLL. I'm importing several functions from the DLL (which i know how to do now) doing some calculations now I want to send something back to tell the DLL and say there is this variable WhatToDo(which in the DLL). My book doesn't explain how you send information back, just explains the other way.

Thanks

PostPosted: July 16th, 2007, 6:28 pm
by Johnny_Bit
hmm... i've never had experiene with that kind of thing in delphi, now i can't even check it because i work on linux and use c/c++...

in my opinion the only way to get a variable from dll (if that is even possible) would be statically link dll and have variable thet is external in that lib, while in lib itself it's exported.

other way round is if lib gives some way of modifying it's variables by it's exported methods.

PostPosted: July 17th, 2007, 7:34 pm
by Kambiz
The easiest solution is creating dll as a Delphi package (bpl). The other solution is using Windows API for map files.

PostPosted: July 17th, 2007, 10:31 pm
by Johnny_Bit
i don't know if it's possible with delphi but currently some of my project use shared memory maps and it works like a charm for my purposes