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 / How can I get DBP to work with ANYTHING?

Author
Message
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 16th Jul 2006 03:36
I made a DLL with M$VC++6, and gave it the proper string table entries. I include it in my
program, and it used to say something like "Cannot identify parameter type on 'SQUARE 8.35'" so I commented those; now my Message Box function is almost exactly like the one in the example code except the name of the function and parameter are different. It still gives me "Cannot understand command on line 12" when line 12 is nonexistent.

Here's my DLL code:


and the string table entries:

(this is just the caption of the two entries; they appear in a relative order to their function declarations)


So, to sum this post up...

what teh hecks goin on plz help

Thanky

FunkyStickmen: Battle of the Races (1%)
hyrichter
20
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 16th Jul 2006 05:14
You shouldn't include your dll like that should you? I thought you just put it in your user-plugins folder and then called the commands like normal DB commands.

Good performance is better than a good excuse.
CodeSurge -- DBP Editor for serious programmers.
MadrMan
18
Years of Service
User Offline
Joined: 17th Dec 2005
Location: 0x5AB63C
Posted: 16th Jul 2006 12:25
'load dll'
should work better then
#include

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Jul 2006 13:01
Hyrichter is right - read step 3 in the technical document and it tells you where to place your DLL.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 16th Jul 2006 16:43
K I don't get that "error on line 12" thing anymore, but I still get "Could not determine parameter type on 'SQUARE 8.35'", and with that commented I get "Could not find function 'MessageBoxPopup' somethingelseoverherelol" o.O

teh c++ suxorz

FunkyStickmen: Battle of the Races (1%)
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Jul 2006 12:25
No, you just don't really understand what you are doing here.

In your DBPro code, this:
Num# = SQUARE 8.35

Should be this:
Num# = SQUARE(8.35)

It's a function call - functions need brackets.

In your resource string, this:
SQUARE%F%?ssSquar@@YAKM@Z

Should be this:
SQUARE[%FF%?ssSquar@@YAKM@Z

The [ tells DBPro it's a function, the first F says it's returning a float, and the second F says that it needs a float argument.
It's easy when you read the docs.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 17th Jul 2006 19:23 Edited at: 17th Jul 2006 19:23
Ok, I think I get it now...but the docs didn't say that [ meant a function -- infact it told me that using [ meant that the command "doesn't take perameters".

I'll try that and see what happens; last time I tried SQUARE(8.35) it said I can only use an integer or unsigned DWORD to refer to an array index .

What would I use to tell the compiler that it takes a string and returns nothing? O.o Like with the MESSAGE BOX command in the example in the documentation (which didn't work for me ); should it be a function?

FunkyStickmen: Battle of the Races (1%)
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 17th Jul 2006 19:47
In the documentation it says that adding a [ denotes an expression i.e. a function that returns a value.

Read section 2.8 in the tech docs

I know the voices aren't real, but they have good ideas!
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 17th Jul 2006 23:30 Edited at: 17th Jul 2006 23:31
Indeed - the docs clearly state :

A command that returns a value is called an expression, and can be denoted by adding a [ bracket after the command, as follows...

Quote: "
What would I use to tell the compiler that it takes a string and returns nothing? "

Use :

MessageBox%S%...

Come to the last Unofficial DBPro Convention (http://convention.logicstudios.net/)
Dont do anything I wouldn't do. But if you do, take pictures.
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 17th Jul 2006 23:41
Oh ok, hehe...yay teh download. The command is "MESSAGE POPUP "string""

Aparently it wasn't working because I didn't notice the section which states to include the .rc file into the project

So, one last noob question, how do I tell DBP there are more than one parameters, and what they are? Would I just go like COMMAND[%FLSLLFLLFFSLL%...? I doubt it cuz it would need to know what to return -- or does it just take the last one?

Thanks for all yer help guys

FunkyStickmen: Battle of the Races (1%)

Attachments

Login to view attachments
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Jul 2006 23:49
It takes the first one. Take a look at the example string resources (section 5) in the help.

When you get to returning strings, *please* read section 4 before asking anything

For free Plug-ins and source code http://www.matrix1.demon.co.uk
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 18th Jul 2006 01:14
hehe
dbp strings, gotta love 'em

Science, Mathematics, and Physics do not lie - only people do.
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 18th Jul 2006 02:00
Uh oh, them stringies sound mean

FunkyStickmen: Battle of the Races (1%)
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 18th Jul 2006 04:16 Edited at: 18th Jul 2006 05:07


I forgot to update the string table entry for the new function which uses a LPSTR as a parameter, instead of a DWORD.

FunkyStickmen: Battle of the Races (1%)
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 22nd Jul 2006 02:01
Wonder why Lee decided that strings should be returned as a DWORD ??

Come to the last Unofficial DBPro Convention (http://convention.logicstudios.net/)
Dont do anything I wouldn't do. But if you do, take pictures.

Login to post a reply

Server time is: 2024-11-22 12:42:52
Your offset time is: 2024-11-22 12:42:52