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 / Queries about making a plugin

Author
Message
Robert The Robot
12
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 15th Feb 2011 12:31 Edited at: 15th Feb 2011 12:32
I'm using Visual C++ 2008 Express Edition, still trying to get my head round everything, but I don't understand these points:

1) globStruct.h gives access to a lot of the core data, but what do the variables actually mean? Some are obvious (like bWindowsMouseVisible or iWindowsMouseX), but others such as pWindowsTextEntry or dwAppDisplayModeUsing are a mystery to me - what do they all mean?

2) The globstruct.h file uses DWORD datatypes, yet I have to define "unsigned int" instead - how come the name DWord isn't recognised in VC++, and where is it defined so that globstruct recognises it?

3) How can I make my plugin trigger an error message in DBPro at line xxxx if an invalid input is passed?

4) I want to use strings as part of data types, i.e:


Why do I have to use "LPSTR" and not "string" (with the generic C++ string library included)? And what exactly is LPSTR? I'm only trying using strings internally at the moment, but I will want to return them to DBPro at some point.

5) How do I call DBPro functions from within my dll? I've been following forum examples here and here, but my code refuses to compile at the moment - I've attached the whole project as it currently stands. Any ideas what I'm doing wrong? (I suspect I may have missed a function pointer declaration out, but I'm not sure)

6) Bitmap Exist occurs twice in "DBProBitmapDebug.dll" (as do some of the other functions). Is this because specifying negative bmp numbers gives access to the camera target, and if so, which undecorated function name should I use?

Any advice would be gratefully appreciated!

We spend our lives chasing dreams. Dark Basic lets us catch some of them.

Attachments

Login to view attachments
Robert The Robot
12
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 19th Feb 2011 13:12
Anyone?

We spend our lives chasing dreams. Dark Basic lets us catch some of them.
Diggsey
13
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 19th Feb 2011 13:37
- pWindowsTextEntry is the string returned by entry$()
- dwAppDisplayModeUsing is the current display mode
- DWORD is defined in windows.h
- You don't have to use LPSTR instead of std::string, you just have to use LPSTR for parameters and return values. LPSTR is equivalent to char* and implicitly converts to std::string, so it's easy to use for parameters. Returning strings is a little more complicated, and has been answered many times before
- I don't see any problems with the code. Make sure the character set is not set to Unicode in the project settings.
- Each version of a function takes different parameters, so for BitmapExist there is one which works on the current bitmap. There is a useful utility called "undname.exe" which comes with VC++. Go to the Visual Studio Command Prompt (found in the start menu) and run it. Then type in: undname <decorated function name> and it will tell you how the function was declared. For example, this is what I see when I run undname on both BitmapExist functions:


[b]
Robert The Robot
12
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 26th Feb 2011 13:13
I think I've got my code working now, thanks for all your help!

We spend our lives chasing dreams. Dark Basic lets us catch some of them.

Login to post a reply

Server time is: 2019-10-15 09:41:02
Your offset time is: 2019-10-15 09:41:02