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.

Program Announcements / Dev-C++ DarkBASIC Professional Plugin Template

Author
Message
TEH_CODERER
20
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 14th Apr 2007 16:56
Hey! Thanks so much for this. Incredibly useful and its encouraged me to start learning C++ again. I've got my first few functions working in DB but this particular one won't. I think the function code is alright so I think it might be my string table entry for it. Does something look wrong to you? It should accept a string and two integers and return an integer.
3 "TC_MOUSE OVER BUTTON%SLL%[%L%MouseOverButton"
Thanks!

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 14th Apr 2007 17:20 Edited at: 14th Apr 2007 17:23
Yes, it's completely messed up. There is only one place for the return value and parameters, not two. this is how it should look:

3, "TC_MOUSE OVER BUTTON[%LSLL%MouseOverButton"

Note that you have to return a value when calling this, otherwise you'll get a compile error. If you want to make commands where you only optionally return a value, you add another entry to the string table without the [ and return type.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
TEH_CODERER
20
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 14th Apr 2007 18:32
Lol! Well it is my first day of trying. Have to learn somehow! I had several functions working where they had either only return values or only input values but none with both. Thanks!

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 14th Apr 2007 18:45
No problem. Just remember that when the command returns a value, the first parameter in the string table is the return type.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
TEH_CODERER
20
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 14th Apr 2007 19:09
Cool, thanks. Don't mean to be a pain but is there a way to retrieve the mouse coordinates within the dll? Thanks again. If I have any more questions though I'll stop hijacking this thread and make my own!

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 14th Apr 2007 19:33
Include windows.h, and do something like this:



Of course, this gives you screen coordinates rather than coordinates based on the window. If you want the latter, you could call the DBP commands for it.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
TEH_CODERER
20
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 14th Apr 2007 19:37
Thank you Benjamin!

And thanks again for the template!

TEH_CODERER
20
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 14th Apr 2007 20:07
OK I have another question but this is directly related to this so I thought it'd be OK! I was originally using the download on the 1st post. I the realised there was a newer one further down but now the same code on my part put into the newer template gives me the error show on the attached image. Any ideas? As I said, the code worked perfectly in the old template so I'm stumped.

Attachments

Login to view attachments
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 15th Apr 2007 01:05 Edited at: 15th Apr 2007 01:14
Yeah, thats an error on my part.
I'll upload an update soon.

Cheers,

-db

EDIT
Instead of an update, i'll simply tell you how to fix this. Go into your Project->Project Options. Now go into the Files tab. Once in there navigate to the commands.ini file in the treeview. Now make sure that you uncheck the "include in linking" and "include in compilation" checkboxes. Attatched is an image of what you should see.

Here is what you should see......



Albert Einstein believed that imagination is more important than knowledge.

Attachments

Login to view attachments
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 15th Apr 2007 18:12 Edited at: 15th Apr 2007 18:56
Quote: "I am working on the DBP2CPP. And is going quite well."


Does your program use:


or does it use c++ to tell the compiler it wants this file to be compiled.

I am trying to figure out how to send a the path of the file to the compiler or a string of data and have the compiler have an output path to where it would dump the exe.

Very useful convertion program. I would like to ask if I can use it in my project Dark World Game Development tool for a tool to convert Dark Basic Pro code to c++ and building a dll for creating a function lib. for Dark Basic Pro.

For my plugin problem:
I think the commands are not working because I haven't linked the .ini file will the dll. How would you do this? The Dark Basic Pro says "Unknown Paramter".

gamersforsale

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 16th Apr 2007 00:55
@Gamers for sale
It doesnt use the compiler at all. Its my own parser. As for using it to build libraries for your own software... As long as you arent redistributing it, it wont matter. But, if you want to use it in order to build your own type of compilation environment then sell it... I do have a rather strong obligation to say no to that.

As for your plugin problem, the .INI should NOT be linked with the DLL. It is a simple file. Remove it from your project even, it wont make the slightest differance. The unknown parameter thing is something else.

Cheers,

-db


Albert Einstein believed that imagination is more important than knowledge.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 17th Apr 2007 00:11
Do you have any idea what the problem is yet?

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 17th Apr 2007 04:40
Yes.

Firstly, turn this:
resource.h


Into this:
resource.h


Then, turn your commands.rc file into this:


Now, finally, compile your DLL.

Cheers,

-db


Albert Einstein believed that imagination is more important than knowledge.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 18th Apr 2007 00:55 Edited at: 18th Apr 2007 00:57
I see where I messed up. *Thinking out loud* It is has to go into the string table.*

Thanx! This really helped me out!

I am building a toolkit of helpful programs and was wondering if I can use your parser for one of my tools. I would give you full credit for the parser and dev C++ template. Also when the toolkit launches it would display your "logo" if you have one.

If you are interested what it is:
www.darkworldengine.co.nr

Search the forums for:
Dark World Engine

The original name was "Dark World Gaming Engine" and now is "Dark World Toolkit".

gamersforsale

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 18th Apr 2007 03:20
Well, as long as your software is free, then sure.

Cheers,

-db


Albert Einstein believed that imagination is more important than knowledge.
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 19th Apr 2007 23:01 Edited at: 19th Apr 2007 23:01
DB, i'm having some trouble using your template. I can get the project to compile the dll, but the commands just don't work in dbp (could not understand command)... Any ideas?

Who needs a signature?
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 20th Apr 2007 00:35
Well, perhaps you should post a little bit of code? Start off with the string table, and your dba code.

Cheers,

-db


Albert Einstein believed that imagination is more important than knowledge.
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 20th Apr 2007 00:42 Edited at: 20th Apr 2007 00:43
I'm using your project straight out of the box. I compiled it, it made the dll. I copied the dll to 'compilerplugins-user'. Tried to compile the dbp code 'start my plugin', but it tells me the command does not exist. I'm using devcpp version 4.9.9.2 and dbp version 6.5.

string table


dbp code


Who needs a signature?
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 20th Apr 2007 01:52
Well, I will have a look into this.

Cheers,

-db


Albert Einstein believed that imagination is more important than knowledge.
RPDan
16
Years of Service
User Offline
Joined: 29th Apr 2007
Location:
Posted: 15th May 2007 19:56
I have exactly the same problem.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 15th Jun 2007 20:34
Could you come up with an example of how to get the object z position using db commands? I can't get it to work.

TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 16th Jun 2007 01:29
I haven't touched a compiler in months, but it's:
Z = dbObjectPositionZ( 1 );

IIRC

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 16th Jun 2007 12:10
@Gamers for sale
Yes, TKF15H has it. Also, you just have to look in the "dbpcmdlist.h" file for it. Or, you can think about what it would be in the DGDK.

Cheers,

-naota

Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 19th Jun 2007 18:53
I was making a function for clear the screen and there was some problems with the function.

It says that it doesn't reconize dbCls();



GFS

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 20th Jun 2007 03:16
@GFS
I will need more information than that, lol.

Cheers,

-naota

Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 20th Jun 2007 04:17
I fixed the problem, but now I am having more. When I try to use my commands in Dark Basic Pro, they don't work. It doesn't reconize any of them. I used dllexp to export all dll functions. The Clear Screen went though, but the rest of the commands didn't. Is there a problem with the string table? I included the list you made of Dark Basic Professional commands to use dbCls(). I get how you use the commands I just have no clue how to set them up in a function.

I have the source attached.

Let me know what you can find.

GFS

Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 20th Jun 2007 05:27
I found out my problem with this a while ago. Basically, sometimes devcpp doesn't export the string table, for no apparent reason at all. Try saving your project, closing devcpp, reopening your project, and recompiling. That should (hopefully) do the trick.

Who needs a signature?
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 20th Jun 2007 07:49
This is very weird?

I found out that the string table works if you do this:

I found this pattern to work:
DLLCMDC
DLLCMD
DLLCMDC
....

You would leave the startup function then you would have DLLCMD in front of the next function then DLLCMDC would be in front of the next.

It may be have to do with the numbers like odds and evens, but I haven't played with it.

This will fix the string table problem.

I finally got my plugin to work and call the dbpro commands.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 20th Jun 2007 14:43
@Milkman
Quote: "I found out my problem with this a while ago. Basically, sometimes devcpp doesn't export the string table, for no apparent reason at all. Try saving your project, closing devcpp, reopening your project, and recompiling. That should (hopefully) do the trick."

My version of Dev-C++ doesn't do this. I am using a rather old version 4.9.8.0. Try it out with that version and see if the problem continues.

@GFS
I'm positive that that is not what was causing it. If you have a look at my WinGUI plugin <In the WIP section> (Search for the source code within the thread), you will see that I use ONLY DLLCMDC. If you continue having problems with the template, ask me about them. If they have nothing to do with the template, then I will direct you to the nearest C++ forum for guidance with the problem. If you do happen to ask about this in a C++ forum, make sure to show the commands.h file, commands.rc file, the code snippet which you are having problems with. Good luck with everything. ^_^


Cheers,

-naota

The Programming Bum
19
Years of Service
User Offline
Joined: 4th Jan 2005
Location: USA
Posted: 20th Jun 2007 15:24
Does this support any Unity commands? I am using a lot of lua in my current game. This is absolutely amazing work you've done here by the way. Even if it doesn't support Unity I may just scrap what I have so I can hop into C++
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 20th Jun 2007 18:38
Basically, you would need to add to the dbp commands source file to get Unity to work in c++. You would have to import the unity dll and all of the functions associated with it, just like the current command source file in this template does with all of the standard dbp commands. I'm actually working on something similar to this right now, automating the whole process so command import source files are automatically generated for any dbp dll plugins I want. I'll let you know how it comes.

Who needs a signature?
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 20th Jun 2007 20:04 Edited at: 20th Jun 2007 20:06
@DB user 2006+ - Thanks, I will try the older version to see if I can get it to work. I am also documenting most of you code, so it would help if you could explain some of the more commmon questions a user would ask about making there own plugin. I am also working on making my plugin more extendable into directx.

I also would like to ask if I can use the template as a part of my program Dark World. I am creating a program for creating plugins by converting Db Pro function into C++ functions and automatically set a project with the converted functions and automatically sets up the string table.

GFS

Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 20th Jun 2007 23:43 Edited at: 20th Jun 2007 23:43
Could you post a more updated version of this:

Quote: "
"


I tried to create some myself. I go some to work, but some didn't work.

It would be very helpful!

Thanx in advance!

GFS

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 21st Jun 2007 02:05
@The Programming Bum
Looks like Milkman explained it for me. Unfortunately, I don't have Unity, so I cannot add any commands to it which supports unity.

@Milkman
Heh heh, looks like I have an advanced user of this here. ^_^ Thank you for your contribution too, btw. Be sure to let me know when it's done and I will add official support for it.

@GFS
Quote: "I also would like to ask if I can use the template as a part of my program Dark World. I am creating a program for creating plugins by converting Db Pro function into C++ functions and automatically set a project with the converted functions and automatically sets up the string table."

I've already answered that question..... Several times. The answer is simply, YES. Feel free to use this template for any reason what-so-ever. You must however realise: This library is distributes in the hopes that it will be found useful to any individual or group, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.. In other words, feel free to use it for whatever you want, but I am not responsible for any damages which may occur.

Also, it would appear you are using an older version. The current version is version 2, which has the COMPLETE list of DarkBASIC Professional commands. I will have a website up and running soon enough, and I will support ALL of my current projects for DBP, which includes: WinGUI, Dev-C++ DBP Template, Extended DLL handling for DBP, DBP Console DLL, DBP Messagebox DLL, and the DBPro Additions Pack. There's only one item on there that's not free, however, which is the DBPro Additions Pack (DAP for short). Sorry, I'm rambling now.

@Everyone
I'll work on a version 3 of this template, from scratch. I hope that the version 3 will be much more intuitive, and helpfull for many purposes. I will also be allowing you to cut out certain commands from DBP that you don't need (ie, if you don't use 2D at all, you can cut out the DBProBasic2DDebug.dll commandset). Which should help reduce the size of your executables. I will also make severel examples for this template, and write a tutorial on how to use it, even for the C++ newcomers.


Cheers,

-naota

Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 21st Jun 2007 02:47 Edited at: 21st Jun 2007 03:07
Could you upload it the second version of the template here?

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 21st Jun 2007 03:11
On the first page, it says that if you go to the March 6th post (Which is also on the first page) you can get to the 2nd version. Here's the link for ya:

DOWNLOAD THE 2ND VERSION OF THE TEMPLATE.


Cheers,

-naota

Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 21st Jun 2007 04:21 Edited at: 21st Jun 2007 04:24
Why doesn't this work? I want the use to be able to input an integer and have it work when checking a condition.

Error:


Code:


Error:


Code:


Also, I am having a problem with creating a resource string for the string table. I don't know if I have it right.

Here is what I have:


Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 21st Jun 2007 04:47
That's a C++ question. I can't take my time to help you out there, sorry. However, feel free to ask in the Programming Talk forum.

Cheers,

-naota

Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 21st Jun 2007 07:10
To answer my question above you could give an example of recreating the command position object. I couldn't figure out how to get input from using the command into the function to use it. I think you put in paretheses, but what would go next to the variable if it is an integer? DWORD or LPINT instead of LPSTR?

It would really help to have an example!

Thanks for all your help!


GFS

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 21st Jun 2007 07:22
As I said, I will not answer any C++ questions. I do not wish to take my time writing a C++ example when there are plenty of C++ examples out there.

Have a look at this site:
http://www.cplusplus.com/doc/tutorial/


Cheers,

-naota

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 21st Jun 2007 12:21
UPDATE TO THE DEV-CPP TEMPLATE!
I have finished version 3, in a single day. I have added 3 examples, and an easier way to install it. If you find any bugs that you are POSITIVE that it/they have to do with the template/sdk, then PLEASE inform me.


Cheers,

-naota

Attachments

Login to view attachments
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 21st Jun 2007 19:59 Edited at: 22nd Jun 2007 00:04
I tested out you template and I found no problems with the template except for the export functions are not working. It would show half of the dll name for all the commands using dllexp.

One example that I would of like to see to explain how to get input from a command in a function. I think it would be in the (), but I couldn't figure out how to set it up. I am trying to send an object number as an integer into my function.

Also, I would copy an paste your explanation on how to make resource strings for the string tables and paste it above the string table commented. It would also be nice if you would put the examples from the last template for getinteger in there and come up with examples for the three you have commented under the string table.

Other then that you have one amazing template.

Keep up the good work!

GFS

Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 21st Jun 2007 23:29 Edited at: 24th Jun 2007 00:29
I am having a hard time create a simple function that takes in a number and returns one.

Example:


Something like that.

I couldn't get anything from it because it would have an error saying unknown parameter type.

Error in my code or something else?

This isn't a c++ question I am just simply asking if you can get a value from one or more input values and how you would do it. I can't get it to work for integers. You have the resource string just no function. I got the resource string right, but what did you do for the function. I looked every where on the forums and couldn't find anything. From what I learned from various source files in c++ and the template I think I have it right, but something is weird with the command in Dark Basic Pro.

Source attached

Thanks in advance!

GFS

GatorHex
19
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 21st Jun 2007 23:52 Edited at: 22nd Jun 2007 00:26
Like Gamers for Sale said, could we trouble you for a little step by step guide for creating a simple DLL?

You know like they did in the original DBP help file for VC6 what menus to click etc. for something like an DBP sends something to the DLL and the DLL returns the result back to the DBP...

DBP int1 and int2 -> DLL int1+int2=int3 -> DBP int3

I might figure it out by the time you read this, if I do i'll post my finding up but I'm still finding my way round this new IDE

Your current example is un-neccessarly complex, for example the hellow world example..



could just simply be writen...





GatorHex
19
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 22nd Jun 2007 01:27 Edited at: 22nd Jun 2007 01:42
Ok I've had a go but I'm getting an error message after compiling the DBP program that my new functions don't exist



the compiled dll has been copied to dbp/compiler/plugins-user folder

DBP


main.cpp


commands.rc


I got a feeling the DBP exmple has errors in the commands.rc with getInterger / GetValue but why doesn't PrintText work?

TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 22nd Jun 2007 02:17 Edited at: 22nd Jun 2007 02:56
If it's not finding the function, it's because your compiler didn't mangle the name the same way. Dev-C++ does not do the same mangling as Visual C++ (so PrintText does not become PrintText@@YAXPAD...)

Attachments

Login to view attachments
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 22nd Jun 2007 02:39
Precisely, TKF15H.

I responded to your problem in your own thread, GatorHex. I've given you a very simple devcpp project to get you started.

Who needs a signature?
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 22nd Jun 2007 02:43
Quote: "MYCOMMAND"

That'd be "DLLCMD", to mangle the name. And "DLLCMDC" for an unmangled name. From what I am seeing, there is no need to have a mangled name, so it would be easier to just use DLLCMDC.

Quote: "Like Gamers for Sale said, could we trouble you for a little step by step guide for creating a simple DLL?"

This quote also applies to GFS
I already said I would, did I not? If I didn't, I'm sorry I forgot to say it. Anyways, I do plan on it, and I will try to have it up today.

Quote: "If it's not finding the function, it's because your compiler didn't mangle the name the same way. Dev-C++ does not do the same mangling as Visual C++ (so PrintText does not become PrintText@@YAXPAD...)"

Thanks for answering that for me. ^_^ It's much appreciated.


Cheers,

-naota

Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 22nd Jun 2007 02:51 Edited at: 22nd Jun 2007 02:51
Also, I did in fact write a very simple step-by-step explanation of how to create a simple dll for dbp in this thread: http://forum.thegamecreators.com/?m=forum_view&t=105976&b=18
This can help get people started, and then when they are ready they can move on to using dbpuser's template

Who needs a signature?
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 22nd Jun 2007 03:47
Cool Milkman. I will be working on that tutorial now.

Cheers,

-naota

Login to post a reply

Server time is: 2024-04-24 14:13:53
Your offset time is: 2024-04-24 14:13:53