is this possible

Please discuss general Delphi programming topics here.

is this possible

Postby Wardlow » July 14th, 2007, 10:41 pm

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
Wardlow
Junior Member
Junior Member
 
Posts: 38
Joined: May 31st, 2007, 10:08 pm

Postby Johnny_Bit » July 15th, 2007, 8:07 am

you do that all the time just by using WinAPI...

Yes you can, you just have to have way to call dlls using stdcall.
Thou shalt write the code, not connect the bricks.
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am

Postby Wardlow » July 15th, 2007, 5:52 pm

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
Wardlow
Junior Member
Junior Member
 
Posts: 38
Joined: May 31st, 2007, 10:08 pm

Postby Johnny_Bit » July 16th, 2007, 6:28 pm

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.
Thou shalt write the code, not connect the bricks.
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am

Postby Kambiz » July 17th, 2007, 7:34 pm

The easiest solution is creating dll as a Delphi package (bpl). The other solution is using Windows API for map files.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby Johnny_Bit » July 17th, 2007, 10:31 pm

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
Thou shalt write the code, not connect the bricks.
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron