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.

Programming Talk / C++ / C# - C++ Tutorial - How to create a DarkBASIC Professional plugin in Dev-C++

Author
Message
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 22nd Jun 2007 06:09 Edited at: 13th Sep 2007 10:16
Tutorial is now here.


Cheers,

-naota

DBP, $80. DBP's plugins, $320. Watching DBP Crash, Priceless.
NG Website Aex.Uni forums

Attachments

Login to view attachments
Kieran
17
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 23rd Jun 2007 04:43
this is really helpful DB, thanks im sure it will benefit alot of members on this forum and maybe we will see some nice plug-ins around from it too

thanks, Kieran

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 23rd Jun 2007 07:25
Thanks Kieran. I did spend a long time on it, would be a shame for it to go to waste. ^_^


Cheers,

-naota

Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 27th Jun 2007 10:02 Edited at: 27th Jun 2007 10:17
I get several compile errors when trying to compile the HelloWorld example.



Gamers found a solution for this by installing some sort of DirectX SDK for Dev-cpp.

http://3dfolio.com
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 27th Jun 2007 11:46
Yeah the DirectX SDK is required for GlobStruct or the DirectX commands to be used.

Cheers,

-naota

SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 2nd Jul 2007 05:07 Edited at: 2nd Jul 2007 05:10
Instead of using the DirectX stuff, you could instead define those two types like so:

and then comment out #include "D3dx9tex.h"

Note the note on the end, reminding you that that DirectX stuff has be disabled. I like this fix better, because it's quick, and doesn't take any extra installation, giving you a smaller DLL size if you don't use those two types.

EDIT: By the way, "DB user 2006+", would that '-naota' happen to be an FLCL reference?

http://www.funk.us.tt/
Xarshi
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 2nd Jul 2007 05:55
haha,FLCL is insane as hell man. That confused me sooooo much,hahaha. One of my favorite shows though. Now back to being on topic, this looks pretty nice. If I didn't have a program to get the dbp functions from the dlls in like,less than 10 seconds,I'd use this. This will help many people

Hello
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 2nd Jul 2007 07:44
@Benny53
Hells ya FLCL is awsome! One of my favorite shows too. ^^

@SunDawg
I'll implement something similiar later on. And yes. Naota is an FLCL reference ^_^


Cheers,

-naota

DrDunc
18
Years of Service
User Offline
Joined: 2nd Nov 2005
Location: MemBlock 12 (alt. file Thinking12.mem)
Posted: 3rd Jul 2007 04:48
This looks good, you have spent some time on it!
I've been looking for something like this for some time but to no avail...
Can't wait to have a good test with it. Will have to brush up my C++ though.
Well done and keep up the good work!
MaRo
18
Years of Service
User Offline
Joined: 1st Jan 2006
Location: Central Europe
Posted: 3rd Jul 2007 10:43
Thanks, this will definitely come in handy
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 3rd Jul 2007 11:06
@DrDunc
Thanks. I have spent quite some time on it, yes. But it was worth it.

@MaRo
Thank you.


Cheers,

-naota

Gamefreak
19
Years of Service
User Offline
Joined: 20th Jun 2004
Location: Cyberspace
Posted: 3rd Jul 2007 17:35
I'm having trouble getting the examples (and the tutorial to work)

-I downloaded and installed Dev C++ 4.9.8
-I downloaded and installed the DirectX package for Dev C++
-I downloaded and installed your plugin
-I opened the spinning cube project and did a Rebuild All
-I copied the dll into the user plugins folder
-I opened the DBPro spinning cube project and hit compile, it didn't recognize the command
Foe7
17
Years of Service
User Offline
Joined: 26th Mar 2007
Location:
Posted: 3rd Jul 2007 22:48
I am unable to get the above to compile, just like I am unable to get the 3D cube example to compile.

When I try and get the above to compile, I get:



and for the 3D cube:

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 4th Jul 2007 00:01
@Gamefreak & Foe7
Windows XP or Vista?


Cheers,

-naota

Gamefreak
19
Years of Service
User Offline
Joined: 20th Jun 2004
Location: Cyberspace
Posted: 4th Jul 2007 02:59
Windows XP
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 4th Jul 2007 04:55
@Gamefreak
I can't really suggest anything for your problem then. Do not use spaces in your project name, and contact GatorHex (Who was able to successfully compile, despite having the same problems).

Hope that at least somewhat helps.


Cheers,

-naota

Foe7
17
Years of Service
User Offline
Joined: 26th Mar 2007
Location:
Posted: 4th Jul 2007 10:58
Vista, but i really hope that doesn't mean that this won't work :c

-F7
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 4th Jul 2007 11:19
@Foe7
Some of my friends have experienced problems with Vista and Dev-C++... Apparently Dev-C++ was trying to look for files on the desktop, and at random other folders. The solution was to use XP for one friend, and the other, I'm not sure what his solution was. Seek out Benoj, he will help you.


Cheers,

-naota

Turoid
20
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 4th Jul 2007 17:55
Very nice tutorial, I'm going to play with it when I get home darn work...

I am awesome and always right.
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 5th Jul 2007 09:12
@Turoid
Cool. Let me know how that goes. ^_^


Cheers,

-naota

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 9th Jul 2007 12:32
When compiling it gives me about 13 errors,some compiling issues,and some of files not exising...

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 10th Jul 2007 06:54
@PoD
Can you please tell me the errors?


Cheers,

-naota

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 10th Jul 2007 14:40 Edited at: 10th Jul 2007 14:49
Well,lol.i just deleted the project.lets see if i can get them back again...

EDIT:

Here is an image,sorry for the Dutch Language though.


Attachments

Login to view attachments
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 11th Jul 2007 00:58
@Prince of Darkness
You need the DirectX 9.0c SDK... If you go through the official thread for DBPPluginSDK, you would see how to fix this.

Cheers,

-naota

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 11th Jul 2007 14:02
I already installed that lol,hence the reason i dont see why it doesnt work.


Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Jul 2007 20:25
You need to go to project options, and add an include directory for wherever the include directory is in the SDK.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 12th Jul 2007 11:32
Ah...I see...I'll try that Benjamin.


Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 12th Jul 2007 11:35
Also, I should note that it won't work with the MSVC++ DirectX SDK, only the Dev-C++ one.


Cheers,

-naota

Foe7
17
Years of Service
User Offline
Joined: 26th Mar 2007
Location:
Posted: 19th Jul 2007 01:15
Okay, well, I fixed the problem that gave me the previous error, and it is supposed to work now (I followed these steps: https://sourceforge.net/forum/message.php?msg_id=4156252

However, guess what, it doesn't work. Here's what's wrong now:



and the compile log:



so I don't know whether or not it's the code or Vista.
Kieran
17
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 19th Jul 2007 10:40
OUCH! thats the dreaded vista error
whenever it looks for a directory\Id, your doomed. Thats the error I got on vista, I was the one who switched back to XP and everything was fine.

NinJA999
18
Years of Service
User Offline
Joined: 11th Nov 2005
Location: NH
Posted: 19th Jul 2007 15:04 Edited at: 19th Jul 2007 15:19
Hmm, I followed the steps above and put the DLL into the Compiler/plugins-user folder, but DBPro's not recognizing the command!

When I look at the DLL with DLL Export, I don't see the function, only this:

agebox_Plugin.dll

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 20th Jul 2007 03:04
@Foe7
Kieran pretty much explained what to do.

@Kieran
Thanks.

@NinJA999
Can you show me the string table of the DLL, and your system specs?


Cheers,

-naota

NinJA999
18
Years of Service
User Offline
Joined: 11th Nov 2005
Location: NH
Posted: 20th Jul 2007 03:09
String Table:


Sys specs:
not sure *exactly* what you mean but
DB/Dev-C++ SDK v3
Dev-C++ 4.9.9.2
DirectX 9.0c SDK
DarkBasic Pro 6.6
MS Windows XP Home
2.2ghz amd athlon xp 3500+
2.5gb ram

if that helps?

Foe7
17
Years of Service
User Offline
Joined: 26th Mar 2007
Location:
Posted: 20th Jul 2007 08:10 Edited at: 20th Jul 2007 08:15
Well, here to report another update I've found:

It seems that the first error,



is simply solved by copying the file: dllcrt2.o, found in the lib folder, to your project directory. This then produces a similar error, solved by copying: crtbegin.o, found in libgccmingw3.4.2 to the project directory. During this, the second error (i guess:

)
remains there.

After the previous steps, i do not think that the compile log has changed. However, there is a new line of text visible under the compiler tab:



So I don't know what it means...and sadly, going back to XP is not really an option, as this PC was bought strictly for vista, and I was told to not rollback...so hopefully there's another alternative. Sadly, MSVC# doesn't work in vista either, so i'm assuming MSVC++ won't, so I'm at a loss as to what to do

[EDIT]
Ah, yes, this only seems to happen for dll's, I'm assuming as for non-dll's it doesn't call dllcrt2 and all that.
NinJA999
18
Years of Service
User Offline
Joined: 11th Nov 2005
Location: NH
Posted: 20th Jul 2007 14:33
I checked my problem with all of the examples, and none of the commands are recognized by DBPro!

Zeus
17
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 24th Jul 2007 04:52
I get these errors.

61 C:\Dev-Cpp\header.h include\DBPPlugin\DBPPluginTemplate.h: No such file or directory.

9 C:\Dev-Cpp\main.cpp expected constructor, destructor, or type conversion before "void"

9 C:\Dev-Cpp\main.cpp expected `,' or `;' before "void"

Kieran
17
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 24th Jul 2007 06:27 Edited at: 24th Jul 2007 06:28
@JSG
would help if we had some code to look at, make sure you have installed the template properly also... If you don't know any c++ or hardly any then I suggest you do so before trying this otherwise it will be too hard.
Make sure you have a newer version of dev-c++ installed as well as this was made for dev-c++ and not a different compiler, however it may work in there.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 24th Jul 2007 06:38
Looks to me like you either, A, didn't install the SDK correctly, or B, you added an "include/" to something...

Ex:



Cheers,

-naota

Zeus
17
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 24th Jul 2007 17:10
Here is my code.







Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 25th Jul 2007 00:08
That code should work. You may have installed the SDK wrong.


Cheers,

-naota

Zeus
17
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 25th Jul 2007 04:32
Can you tell me how? I read exactly how it said to install it.

NinJA999
18
Years of Service
User Offline
Joined: 11th Nov 2005
Location: NH
Posted: 25th Jul 2007 05:50
Also, do you recognize anything I did wrong?

Zeus
17
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 25th Jul 2007 16:35
Yours is the same as mine.

NinJA999
18
Years of Service
User Offline
Joined: 11th Nov 2005
Location: NH
Posted: 25th Jul 2007 18:35
Nope, because I don't get any errors in Dev-C++, unlike you.

Zeus
17
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 25th Jul 2007 20:22
Shut up. Look at mine.



Yours:



Please tell me? Who's is different?

NinJA999
18
Years of Service
User Offline
Joined: 11th Nov 2005
Location: NH
Posted: 26th Jul 2007 05:52
There's no reason to be rude. We might have the same string table, but that is irrelevant at this point in time. The point is, your errors are in Dev-C++, while mine compiles with no errors. My errors are in DBPro. Thus, we have different problems.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 26th Jul 2007 06:00
@NinJA999
They aren't the same as each other. One has spacing between the string table string, and one doesn't. However, that would not be a reason why MingW wouldn't compile correctly. It is how the pack has been installed.


Cheers,

-naota

NinJA999
18
Years of Service
User Offline
Joined: 11th Nov 2005
Location: NH
Posted: 26th Jul 2007 06:03 Edited at: 26th Jul 2007 06:26
What I mean (and what I think he meant) is that there is nothing that would make them compile differently. Which makes my problem different from his.

So, do you think I should try reinstalling? It seems to compile error-free (for me) in Dev-C++, then DBPro doesn't recognize the command.

Zeus
17
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 26th Jul 2007 06:37
Is there anyone who can help me? I did what the instructions said.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 27th Jul 2007 07:19
Ok, ask questions over here: Aex.Uni Forums.

Please make your own topic in the proper forum, thank you.


Cheers,

-naota

Login to post a reply

Server time is: 2024-04-26 12:51:46
Your offset time is: 2024-04-26 12:51:46