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.

DarkBASIC Professional Discussion / Passing data between executables

Author
Message
Sparda
21
Years of Service
User Offline
Joined: 13th Jan 2004
Location: Pacifica
Posted: 15th Sep 2004 09:16
Once I have two dbpro programs running, is there a quick/easy way to pass variable data between the two? I tested to see if one dbpro program could read another dbpro program's variables, but it couldn't. Do I need to do this through an external .txt file?

Also, is there a way to control how many system resources a dbpro program uses? For instance, if I have two programs running, my main engine and a separate .exe, can I give more power to the main engine through Dbpro?

Thanks in advance. Hope that wasn't too confusing


Peter H
21
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 15th Sep 2004 10:30 Edited at: 15th Sep 2004 10:30
i think the only way to pass data would be with a file...

"We make the worst games in the universe."

Fang
22
Years of Service
User Offline
Joined: 2nd Jul 2003
Location:
Posted: 15th Sep 2004 11:08
You could always make a DLL that makes a Mapped File...its a common way of apps sharing data(at least in the old days when COM was called OLE).....

"I really don't know how WWIII will be fought, but WWIV will be with sticks and stones"
- Albert Einstien
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 15th Sep 2004 11:50
can you write and read the the clipboard?

"eureka" - Archimedes
DarkSin
22
Years of Service
User Offline
Joined: 23rd Jul 2003
Location: Under your bed
Posted: 15th Sep 2004 11:56
Check out the new expansion pack, in it, you have the abillity to share data with other apps.


Sparda
21
Years of Service
User Offline
Joined: 13th Jan 2004
Location: Pacifica
Posted: 15th Sep 2004 13:06
Sweet, thanks for the answers guys. Thats a really good idea Phaelex, it will probably be a lot faster than going through an external file. And Darksin, that's even better! Yay

Any thoughts on how to allocate more/less power to a certain program through dbpro?


Pheonixx
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: Columbus, Ohio
Posted: 15th Sep 2004 14:24
I only know how to steal threads in c/c++, but this is a feature I have wanted to see on the DBP compiler for a long time now. I'm trying to rally up some support for multithreading for the more advanced programmers. Particularily object loading and unloading on a backend thread, with a simple 'it is ready' flag.

A short time goal realistic solution to speed up your application is the little known 'fastsync' which bypasses the windows message handle. don't only use fastsync, because windows messages are actually needed from time to time. I use a simple game clock check to ensure the messages are being checked.

IF GameClock MOD 50 = 0
sync
ELSE
fastsync
ENDIF

Basically checking once every 50 loops. A considerable speed increase.

Pheonixx
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: Columbus, Ohio
Posted: 15th Sep 2004 14:28
One more thing, If you do end up using a clip board or file to pass data back and forth, make sure you are only passing a pointer to the data's memory location, kind of like a query of sorts.

waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 15th Sep 2004 15:13
the fastest and most reliable is to use a DLL.
Inside the DLL, create a global memory space
and then pass the pointer to this space to your 2
DB apps.

internet gaming group
current project http://home.comcast.net/~norman.perry/Archon.html
Sparda
21
Years of Service
User Offline
Joined: 13th Jan 2004
Location: Pacifica
Posted: 16th Sep 2004 03:11
@Waffle - Would you need a dll to do that? Not experienced with pointers... but doesn't dbpro already have pointer support?

@Pheonixx - Multithreading support would definitely be appreciated. I was already using fastsync In fact I was trying to have a separate program to load levels in the background.


DarkPhear
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Brazil
Posted: 16th Sep 2004 06:30
Does this DLL idea work? I though each executable would call a different instance of the DLL with different data for each...

Cleber de Mattos Casali, game programmer.
DarkPhear is a full freeware RPG developed by me. You can download it and some game demos for free at my page: http://darkphear.cjb.net
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Sep 2004 07:07
You could share memory using a DLL - using visual studio you can create global variables that are shared between all instances.

The shared memory technique is a better way to do this - for a start you can share memory between more than 2 apps, or have several areas without having to rewrite your DLL.

I wrote this code some time ago as an example - run two or more copies of it at once.



*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 19th Dec 2004 13:37
you could write a registry value with a memory space created using make memory()

Login to post a reply

Server time is: 2025-08-08 19:16:57
Your offset time is: 2025-08-08 19:16:57