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 / Could Not Understand Command at line ... I've read everywhere...

Author
Message
WLGfx
11
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 29th Sep 2011 00:35 Edited at: 29th Sep 2011 01:04
I've followed all the de-structions, trying my best to get this working without the need to ask for any help.

I'm trying to put some of my code into a DLL without any joy. Why?

DBP: Test code...


The C++ (one of the files)...


The Resource.rc file...


Each time I fiddle, I compile the dll, open it in notepad, copy the decorated name.

It seems to like the command "NOISE GET HEIGHT" but doesn't like "NOISE SET PARAMS".

"NOISE SET PARAMS" doesn't return a value.

"NOISE GET HEIGHT" returns a float. (I've implemeted the DWORD thingy)

I've got lots more to add to this if I can get this DLL to actually work...

EDIT: I've figured it out...

To set a 'command' instead of a 'function' that returns a value just remove the '[' from the IDS string...



Warning! May contain Nuts!
IanM
Retired Moderator
17
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 29th Sep 2011 01:05
- When you use [ at the end of the name, you are telling DBPro it is a function, not a command.
- Never use 0 in the resource string unless there are absolutely no arguments to your command. It's never needed for functions.
- The last bit of the resource string is usually descriptive of the arguments required for the command/function - it's displayed in the error message.

You should use:
NOISE SET PARAMS%LFFFLL%?PN_Set@@YAXHMMMHH@Z%name your parameters here

WLGfx
11
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 29th Sep 2011 01:45
Thanks IanM. Very confusing when I first started and really wanted to figure everything out on my tod. I re-read some of the old posts and sussed it out, although a little too late.

When I've got the rest of the stuff working I'll add the descriptions. It's now going to be darn awkward finding all the decorated names. Notepad is doing it's job and I think this will probably be the only DLL I'll be doing this year. I'm already fed up with copy and pasting the dll file.

Just a quickie, are there any things I should know about creating the '.ini' file? I've not overloaded any commands yet.

Warning! May contain Nuts!
IanM
Retired Moderator
17
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 29th Sep 2011 15:24
One thing I do to avoid the whole decorated-names mess is to prefix the functions with 'extern "C"', which removes the decoration - it does mean that your functions all need to be named differently as this disables overloading as a side-effect.



Quote: "Just a quickie, are there any things I should know about creating the '.ini' file? I've not overloaded any commands yet."

Nothing really, except that you can't overload commands in the INI - the editor will pick up one definition or the other, not both. That won't affect the compilation process in any way though.

Diggsey
13
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th Sep 2011 18:43
Also, if you use extern "C" you won't be able to give your overloaded functions the same name in C++. I usually call them "command", "command_2", "command_3" etc. and then map them all to just "command" using the string table.

[b]
WLGfx
11
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 29th Sep 2011 20:21
I think depending on how much I end up adding to the plugin will depend on how I go about defining string table. If either way works then it's only fiddling a little to get it working.

Thanks Guys... All I need to focus on now is the html files for the help.

Warning! May contain Nuts!

Login to post a reply

Server time is: 2019-10-15 09:42:11
Your offset time is: 2019-10-15 09:42:11