Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Merging Delphi and DBPro

Author
Message
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 22nd Oct 2005 17:10
The effect I am looking for I have seen done in VB, but that was a long time ago, and I can't remember how it was done.

I am trying to make a simple app which uses Delphi and DBPro in parallel by communicating using memblocks. Does anyone know how you would go about locking a DB window inside a Delphi app? Presumably it would be done by somehow passing the DBPro window handle to Delphi and locking the window somehow? I am imagining that I could set up communications by running a DBPro app, which then ran a Delphi app, passing a pointer to a memblock somehow to it, but again I wouldn't really know where to start .

If anyone can help it would be umm... helpful . Cheers.

empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 22nd Oct 2005 17:39 Edited at: 22nd Oct 2005 17:43
You can use the win API function "SetParent" to make the DB window a child of a Delphi component, for example a panel. You can adjust the position and size of the DB window with "SetWindowPos". Depending on how exactly you want to have the DB window appear in your Delphi app, you'd probably need to change its style too.

By the way it's possible to adjust parent/child window settings on the DBpro side with an ini file. However, I haven't checked that out yet.


Play Nice! Play Basic! Version 1.089
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 22nd Oct 2005 18:29
Cool, I'll check that out and report back . Have you any ideas about the best way to communicate using memblocks?

empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 22nd Oct 2005 19:14
I'm afraid, unless your Delphi app is a DLL, memblocks won't work. Two different processes cannot access the same memory area.


Play Nice! Play Basic! Version 1.089
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 22nd Oct 2005 19:23
Create a file called [dbappname].ini.

Inside it put



it will only work for MDI apps as it was designed for FPSC. Run the dbpro app and it will render to the child window.

"A book. If u know something why cant u make a kool game or prog.
come on now. A book. I hate books. book is stupid. I know that I need codes but I dont know the codes"
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 22nd Oct 2005 19:28
Or you could try file mapping. I believe the enhancement pack supports it.

Tempest - P2P UDP Multiplayer Plugin - 80% - 25%
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 22nd Oct 2005 19:48
Yes filemapping is the best way to exchange data between separate apps. FPSC uses it it too IIRC.


Play Nice! Play Basic! Version 1.089
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 22nd Oct 2005 19:57
Hmm, sounds good. Maybe I'll have to invest in the enhancement pack.

I have managed to get the DBPro window docked with the Delphi window (in about 3 lines once you know how ). Cheers all, I'll take a look at the enhancement pack now.

Login to post a reply

Server time is: 2024-11-16 00:54:31
Your offset time is: 2024-11-16 00:54:31