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.

DLL Talk / Writing dll in Visual C++ 2008

Author
Message
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 29th Jan 2009 03:54 Edited at: 17th Mar 2013 21:23
So I finaly found the "TECHNICAL DOCUMENTS" in the DBPro help and was following through how to write a dll. Although the example used Visual C++ 6.0 there shouldn't be much difference but I'm stuck.

I cannot seem to get pass the "Resource..." part where it leads to writing the "TESTCOMMANDS.RC".

So am I just simply missing something here or are the versions too varied that these steps are done differently?

Maybe I should use and earlier version of c++?

Attachments

Login to view attachments
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 29th Jan 2009 04:33
Im using VS 2008 standard and it works fine for me. As with standard, I can create a string resource and add the commands in the string.

I'm guessing you are using the 2008 Express version? If I remmember correctly you can't create resources directly with the express version.

Inspirational Music: Descent ][ Redbook Audio CD Soundtrack
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 29th Jan 2009 04:40
Yes I'm using Express. I'm completely new to this, how can I create resources in express?
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 29th Jan 2009 05:12 Edited at: 29th Jan 2009 05:56
Well I tried to search for two programs I remmebered that where made in the past. For the life of me, I forget what they where called and my forum search came up with nothing.

One program you have to pay for and the other one was free. Basically, they open up your dll that you have created and allow you to add a string resource to them. But, If I remmeber right, again, they need a .net dissassembler program to work with in which you can get for up to .net 2.0 ... I forget if that's all correct. Mabie somebody else can enlighten the deal with those progams are. Sry, I forget the specific details...

EDIT:
Here's a thread on one but the website seems to be gone for it
http://forum.thegamecreators.com/?m=forum_view&t=85711&b=5

EDIT:
Ah, here's the free one by the winch
http://forum.thegamecreators.com/?m=forum_view&t=44946&b=8

Thats the only way I know of that you could get string resources in your express made dll. Mabie there are others. Dunno. Good Luck.

Inspirational Music: Descent ][ Redbook Audio CD Soundtrack
Slayer93
19
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 29th Jan 2009 06:45
I edit it directly, this is how I always did it because I started in the Express version. Luckily the first dll I tried to work on was already made so I had something to work off of, that being ODE (had to make a few minor changes though).

I would use this just add in the commands into the string table and define the IDS_STRINGXX stuff in the 'resource.h'.



Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 29th Jan 2009 07:31 Edited at: 29th Jan 2009 07:32
I'm not really getting what you're saying. I'm looking at chunks chunks' source and I see a file that has looks exactly like that, it's the .rc file.

Are you saying to copy stuff from the .rc file into the .h file?

I also tried to compile chunks chunks source just as it is and it's causing an error. It also seems Express cannot handle recources editing at all.
Slayer93
19
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 30th Jan 2009 01:29
Quote: "Are you saying to copy stuff from the .rc file into the .h file?"


Keep it as an .rc file. You will need to have a resource.h file that has things like

#define IDS_STRING1 1
#define IDS_STRING2 2
#define IDS_STRING3 3
etc...

One for each command.

Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 4th Feb 2009 00:07
I have a similar problem:
I'm trying to write my first dll in VC++ 2008 Express but failling at the first hurdle. The help files state:
Quote: "1.1. Open Visual C++ 6.0 and select NEW, choose Win32 Dynamic-Link Library"

However, there is no 'Win32 Dynamic-Link Library' option.
What option should I use to create my new project?

Thanks



IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 4th Feb 2009 00:23
Add a standard Win32 project and click OK.

A dialog box will appear - click on application settings link, or click Next and the dialog will change.

Select the DLL radio button and click on Finish.

Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 4th Feb 2009 00:32
Thanks Ian



Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 4th Feb 2009 00:53 Edited at: 4th Feb 2009 01:33
OK, I have my dll created, the next hurdle is creating the string table. Once again the help files seem a little outdated and read:
Quote: "2.2. Click INSERT from the Menu, then RESOURCE..

2.3. Select STRING TABLE to highlight it and then click NEW to create a new string table
"


There is no INSERT menu option. I have search through all the menu options but I can't find how to create a string table.

Anyone?

[edit] Nevermind ... I've just found out that the Resource thingy isn't included in the Express version. So, I am now downloading vis2008 pro, for the princely sum of zero pence ... the joys of being a student again!



chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 4th Feb 2009 10:48
@Ashingda 27 which source of mine are you trying to compile , let us know and i might be able to help you.

@scraggle welcome to the joys of plugin creation and c++ , good luck.

chunks

nvidia geforce 8600gt + amd athlon 64
windows xp pro.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 4th Feb 2009 14:00
Quote: "So, I am now downloading vis2008 pro, for the princely sum of zero pence"

Sorry, I should have thought to suggest that to you. You'll be happy to know that VS2008 pro works just fine with the GDK too.

Slayer93
19
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 4th Feb 2009 23:25
Quote: "So, I am now downloading vis2008 pro, for the princely sum of zero pence ... the joys of being a student again!"


Hmm, I have got to check that out

Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 5th Feb 2009 16:40 Edited at: 5th Feb 2009 16:41
Quote: "which source of mine are you trying to compile , let us know and i might be able to help you."


When you helped enderleit with his blend 2 image dll you included a source with it. So when I got stuck making my own dll I remember I had yours a while back so I checked it out. After loading the source it wouldn't compile, saying it's missing something like a "afxres.h"?
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 6th Feb 2009 03:20
afrex.h is included in a vis studio project file , i don`t actually know what it`s for , so i usually start with win32 project then select empty project ,and it only uses the files i want .

bear in mind to compile that code you will need to include the dbpcommands header too.

thanks chunks

nvidia geforce 8600gt + amd athlon 64
windows xp pro.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 6th Feb 2009 23:50
If not too late, I'll give you the steps to create a DLL in VC++ express edition:

1. Open VC++ Express
2. Select New > Project
3. Use the project type Win32 and select Win32 Project
4. In the dialog box, select Application Settings and check the DLL radio button.
5. Your project is now created. Browse to your project directory and use notepad to create an empty .rc file. I do this by first creating a new text document, then open it, and save it to something like "resource.rc" (you have to type .rc yourself).
6. Rightclick the resource folder in VC++ Express and use "add an existing file" to add the resource file to your project. Do the same with the globstruct.h and dbpsh.h files.

7. Finally, you just have to copy this part in the .cpp file:


Your resource file is built as followed:


Where each command is built as followed:
nr, "COMMAND%PARAMETERS%DECOR_NAMES%DESCRIPTION"

nr is an index starting from 1 all the way up.
COMMAND is the command DBP will take.
PARAMETERS search the forums for this one.
DECOR_NAMES can be found by opening the compiled DLL in notepad, and use Find (CTRL + F) for the functions you declared in your source code. If you had for example void Hello(int a,b); you would search for Hello and copy the string starting by a ?Hello@@[some chars until a space].
No other things have to be written in this resource file for it to work.

I agree, it takes a bit more time to create a DLL in VC++ Express edition, but it works.

Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 7th Feb 2009 01:17
Wow thanks very much!
Xenocythe
18
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 7th Feb 2009 22:50
Why didn't you use the search feature?

http://forum.thegamecreators.com/?m=forum_view&t=125439&b=20


Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 9th Feb 2009 09:30
I do use the search but usually I'd get alot of odd stuff come up while searching the entire forum so I've been only doing searches relating to just one board.

Had no idea there was one on another board already. Thanks for pointing it out.

Login to post a reply

Server time is: 2024-04-20 06:11:53
Your offset time is: 2024-04-20 06:11:53