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 / DLL String Table Unsure

Author
Message
Mark Hobbs
15
Years of Service
User Offline
Joined: 9th Jul 2008
Location:
Posted: 9th Jul 2008 12:51
Hi there.

I realise there are a lot of posts about string tables and various tutorials around the Internet which I have researched and looked (well as many as I can) but I am still having an issue when trying to create the string table for my DLL to be used in dbp.

My DLL is written in C/C++ and has been created using Visual Studio 2005 SP1 (Full Version) and I have added the string table resource within the IDE, which is no problem. I am however having trouble with how this string table is meant to be setup.

Here is an example of one of my functions



and here is my string table entry for that function as it is now.



To begin with I am unsure if that is how one should handle multiple variables to be passed into the function and secondly my understanding is that [ denotes that something is to be returned but do I need to specify that type somehow?

You will also notice that the string table entry for that function does not look like this;



Namely the "@@YAXXZ" part and the quetion mark before the function name. From the tutorials I have read it would seem that this should be how the function looks when you open a DLL in say notepad and search for the function in the text. This is not the case with my DLL as the single entry for FunctionSix, and all my other functions, is simply "FunctionSix" with spaces either side before the next and previous function names that are similar.

Could the lack of the "@@YAXXZ" part be due to a compiler or linker setting that I have activated?

Like I have said I have checked out a considerable number of forum entries and tutorials but none have detailed this issue at all.

Any help on this matter would be very helpful.

Thanks

Mark
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Jul 2008 15:23
Your resource string should be:


With the [ character in your command name, the first 'parameter' is actually the return type, then is followed by the actual parameters. The % sign is used to separate the section of the string into...
1. Command/function name
2. Parameters (and return type for the function)
3. The full exported name of the function in the DLL
4. An optional descriptive string (for example, you may put the comma-separated list of the function parameter names here - Location, R, G, B). This will be displayed when you get a compile error and you have the wrong number of parameters or wrong types.

Mark Hobbs
15
Years of Service
User Offline
Joined: 9th Jul 2008
Location:
Posted: 9th Jul 2008 16:17
Thanks for the response. That clears that up for me. But what about the "@@YAXXZ" part? Can I just add this to the exported function name even if this is not what shows up when editing the DLL as a text file?

Thanks again

Mark
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Jul 2008 18:55
No, that is a part of the full function name - it will change depending on the return type and the parameter types of your function. Use what shows up in the DLL.

Mark Hobbs
15
Years of Service
User Offline
Joined: 9th Jul 2008
Location:
Posted: 18th Jul 2008 12:01
Hi,

Sorry I have been away on Holiday and still haven't managed to test this but the thing is when I open my DLL in notepad my functions simply show as;



etc. Is this likely to work then if its seemingly missing information for the string table?

Mark
Mark Hobbs
15
Years of Service
User Offline
Joined: 9th Jul 2008
Location:
Posted: 18th Jul 2008 18:34
Ok i've had a chance to test the DLL and in its current form DarkBasic Pro doesn't recognise any of the commands. I'm assuming this is because my String table is still incorrect and would hazard a guess that its down to the difference in the decorated function part of the string table.

Anyway help with this would be great.

Mark
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Jul 2008 21:15
Mark Hobbs
15
Years of Service
User Offline
Joined: 9th Jul 2008
Location:
Posted: 21st Jul 2008 16:22
Hi,

Thanx for the help so far.

Heres the DLL atm. The functionality of the methods have been removed so that they simply return the number that represents the function (FunctionOne returns 1 as an integer and FunctionTwo 2 etc etc. Note there is no FunctionFive and FunctionFour returns '4' as a string).

Thanks again

Mark h

Attachments

Login to view attachments
Mark Hobbs
15
Years of Service
User Offline
Joined: 9th Jul 2008
Location:
Posted: 21st Jul 2008 17:46
I think I've just solved this issue.

As I have been mixing c/c++ i've been wrapping function with the extern "C" parameter.

When using this it removed the seemingly random symbols from the functions within the DLL.

After making a setup without extern "C" I now see my function names when opening the dll like this;


I'll check to see if this works when I get back from my trip.

Mark h

Login to post a reply

Server time is: 2024-03-28 14:24:41
Your offset time is: 2024-03-28 14:24:41