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 Discussion / DarkBasic MySQL

Years of Service
User Offline
Joined: 22nd Nov 2011
Location: asdf
Posted: 23rd Nov 2011 05:39
Hey, just curious how to integrate Dark Basic with my Player Information Database. The game itself will have a login form, created in C++, and after a user successfully logs in, the game loads. Each user is given a certain amount of "Currency" on registration called Fool's Gold. I just want to know what I have to do to get this information to pull into DarkBasic so I can add it to the player's screen.

Thank You.

-ClickTwiceHosting and Designs Administrator
Years of Service
User Offline
Joined: 23rd Jul 2006
Posted: 26th Nov 2011 19:44

A lot depends on the depth of integration that you desire. DB is designed to be a self contained game engine - though there are a lot of ways to get it to communicate with the outside world - and therefore it doesn't easily maintain communication with other independent apps.

Based on your question, I'll assume you know something about programming the windows API, you can pass information from a windows app in the form of a string and start a DBC app using the winapi command:


and in DBC, add the command:


at the top of the code.

I've knocked together a quick example of this process. In the attached zip file, there are 2 programs.


Extract the files to the same directory. Launch start_dbc_app.exe and a dialog box will open up with a text box and an ok button. The text box is just to hint at the idea of entering a password. Whatever you type in this box will be part of what will be sent to DB.

Once you click on OK, what you typed will be stored in a string and then dbc_app.exe will be launched and that string will be passed to the command line variable in DBC called cl$().

It's from cl$() that you would parse out what ever information you want DB to use. In this case you mentioned currency.

The C code, excluding the window creation and control definitions, that does the actual launching looks like this:

The full DBC code that gets launched looks like this:

Enjoy your day.


Login to view attachments

Login to post a reply

Server time is: 2023-06-10 00:56:47
Your offset time is: 2023-06-10 00:56:47