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 / vb6 exported functions dll - strings are only first character...

Author
Message
CattleRustler
Retired Moderator
15
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 25th Oct 2004 08:04
I am using vbAdvance to create standard dlls in vb6 (http://www.vbadvance.com/index.html) to use in DBP.

all of the numerics based function return what was expected, but for some reason any function in the dll that returns a string, DBP only gets the first character back, not the whole string. Anyone know why this would happen?

Also, what needs to be done to make a standard dll into a dbp plugin? Something about a string table or a resource file, or something? Go easy on me, I don't follow that c++ mumbo jumbo, I need the "for dummies" version

thanks

find the test dll attached, its called exports.dll. You can see if the same thing happens to you with the strings. Call the "GetNow" function, which should return your system's date and time (vbNow), I only get back the first character of the string. Also there is an "AddInt" function which adds 2 passed in integers (just testing)


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!

Attachments

Login to view attachments
CattleRustler
Retired Moderator
15
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 25th Oct 2004 10:38
ok I did some searching and I found something that may be related in this thread http://www.vbadvance.com/forums/viewtopic.php?t=12. I was able to recreate the problem the other guy had where passing a dbp string to the vb dll caused the string to read as "??" in vb. When I implemented the conversion shown in the example the string appeared correctly. If anyone is seeing this, am I barking up the correct tree as far as returning strings to dbp and why I get "H" instead of "Hello World!" ?

thanks in advance


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
CattleRustler
Retired Moderator
15
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 25th Oct 2004 10:49
Ok, its solved, as long as I convert return strings using StrConv() and specify "FromUnicode", the strings appear correctly back in DBP. Neat, vb6 dll's in DBP without a C++ wrapper. Now to do the same in .net

Anyway, my question regarding making a plugin for dbp as opposed to a plain dll is still unanswered if anyone wants to give it a go.

thanks


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
BatVink
Moderator
16
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Oct 2004 01:59
Do you need the paid version of VB Advance to create Dlls? Couldn't quite work out what they meant by Console apps.

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
CattleRustler
Retired Moderator
15
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 26th Oct 2004 04:03
no, you can make dlls with the trial (which I am using). I believe a console app is an app that runs out of the windows cmd.exe console. I think thats what they mean anyway. I was just interested in the exported functions aspect anyway. It works well.


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
John Y
Synergy Editor Developer
16
Years of Service
User Offline
Joined: 4th Sep 2002
Location: UK
Posted: 26th Oct 2004 04:22
I use this to create DBP TPC's it's pretty good, the only problem is that it sometimes allows VB to fail silently so that it's a pain to debug...if you want a TPC example let me know and I'll dig it out!

CattleRustler
Retired Moderator
15
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 26th Oct 2004 05:41
yeah, that would be cool. I am curious how to turn a plain old dll into a TPC.


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
CattleRustler
Retired Moderator
15
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 27th Oct 2004 04:59
Anyone? Any info on making a standard dll (dbp usable) into a TPC?


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
OSX Using Happy Dude
15
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 27th Oct 2004 05:35
I would think it works the same as C ones - you need a string table in the correct format..

He who knows the cat becomes his slave; he who knows the dog becomes his King.
CattleRustler
Retired Moderator
15
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 27th Oct 2004 12:20
Quote: "Also, what needs to be done to make a standard dll into a dbp plugin? Something about a string table or a resource file, or something? Go easy on me, I don't follow that c++ mumbo jumbo, I need the "for dummies" version

thanks"



DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
John Y
Synergy Editor Developer
16
Years of Service
User Offline
Joined: 4th Sep 2002
Location: UK
Posted: 28th Oct 2004 06:07 Edited at: 28th Oct 2004 06:11
Here is all you need to do it..

1). Take one copy of vbadvance
2). Open one of the 'real' dll examples
3). Right your darkbasic functions in the MExports class ensuring they are public and formating perfectly (e.g. no missing off the return type)
4). Open the toolbox and choose your exported functions
5). Now make a new string table using the resource editor
6). Fill it with the required data
7). Compile!

Screenshot attached

Attachments

Login to view attachments

Login to post a reply

Server time is: 2019-07-19 08:12:49
Your offset time is: 2019-07-19 08:12:49