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 / Stringtable problems

Author
Message
The Fire Within
20
Years of Service
User Offline
Joined: 1st Apr 2004
Location: localhost (127.0.0.1)
Posted: 26th Dec 2004 19:24 Edited at: 27th Dec 2004 05:49
I'm new to making DLL's but i already create one, but now i have some problems with the stringtable.
I use dev-c++ and i have a command that needs a string and 2 integers.
So what is the stringtable? I thought
MYCOMMAND[%SLL%MYCOMMAND%STRING, INTEGER,INTEGER

Please help
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 26th Dec 2004 20:21
It would start : MYCOMMAND[%SDD%

Beware the Christmas... The fattener... The drunkard...
The Fire Within
20
Years of Service
User Offline
Joined: 1st Apr 2004
Location: localhost (127.0.0.1)
Posted: 27th Dec 2004 05:51 Edited at: 27th Dec 2004 05:51
It still says in Darkbasic Pro that my parameters aren't correct.
I use:
BIND SOCKET[%SD%DBP_BindSocket%ServerAddress, Port
What is wrong with this string?
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 28th Dec 2004 22:42
DBP_BindSocket%ServerAddress, Port is whats wrong - it should just have the mangled name followed by %comment to denote a comment.

Beware the Christmas... The fattener... The drunkard...
The Fire Within
20
Years of Service
User Offline
Joined: 1st Apr 2004
Location: localhost (127.0.0.1)
Posted: 29th Dec 2004 07:01 Edited at: 29th Dec 2004 19:43
I'm confussed, i still don't get it
My command is this:
DLLIMPORT DWORD DBP_GetHostByName(LPSTR DBP_HostName)
{
LPSTR DBP_HostAddress;
DBP_RemoteHost = gethostbyname( DBP_HostName );
DBP_HostAddress = (DBP_RemoteHost->h_addr);
return (DWORD)DBP_HostAddress;
}
My stringtable:
"GET HOST BY NAME[%S%DBP_GetHostByName%Hostname"

If i don't add the [ after the command, i can use it in DB, but no string is returned... What's still wrong with this????

Never Mind i forgot to set the return type
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 29th Dec 2004 20:17 Edited at: 29th Dec 2004 20:19
Wrong and unsafe ...



The right way ...



... or something like that. You have to use DBPro memory-management system when playing with strings.

[edit]

The resource string would be:

GET HOST BY NAME[%SS%DBP_GetHostByName%Hostname

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
The Fire Within
20
Years of Service
User Offline
Joined: 1st Apr 2004
Location: localhost (127.0.0.1)
Posted: 29th Dec 2004 20:38
But i can't import globstruct.h in dev-c++, has someone a modified version for it, or knows how to modifie it so it works?
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 29th Dec 2004 21:26
Ian may have a modified version - but no guarantees. DevC is not really the right language to use...

Beware the Christmas... The fattener... The drunkard...
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Dec 2004 01:28
Here is the basic code to get the core pointer:



I've assembled it from fragments of other code, so it may not compile immediately.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
The Fire Within
20
Years of Service
User Offline
Joined: 1st Apr 2004
Location: localhost (127.0.0.1)
Posted: 30th Dec 2004 01:29 Edited at: 30th Dec 2004 02:20
Thanx all, it now works. THANKS!!!
IanG
19
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 30th Dec 2004 03:55
why does dbpro use a very complex string system, will the tpc sdk (the new one) when it is released make it easier?

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 30th Dec 2004 22:55
Quote: "why does dbpro use a very complex string system"

Probably so that memory allocation/deallocating is done inside DBPro, and thus removing a problem for the intrepid TPC writer.

Quote: "will the tpc sdk (the new one) when it is released make it easier"

You would probably just pass NULL

Beware the Christmas... The fattener... The drunkard...
The Fire Within
20
Years of Service
User Offline
Joined: 1st Apr 2004
Location: localhost (127.0.0.1)
Posted: 31st Dec 2004 00:38
Is there a way to initialise the core automaticly as the dll loads?
Must i put the DBP_InitialiseCore command in the DLL_PROCESS_ATTACH case???
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 31st Dec 2004 02:31
Quote: " Is there a way to initialise the core automaticly as the dll loads?"


Yes if you are using Visual C++, otherwise no.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
The Fire Within
20
Years of Service
User Offline
Joined: 1st Apr 2004
Location: localhost (127.0.0.1)
Posted: 31st Dec 2004 02:33
Ok, thanx.
IanG
19
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 31st Dec 2004 04:25
Quote: "Yes if you are using Visual C++, otherwise no."


how?

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 31st Dec 2004 07:08
Read the instructions

c:\Program Files\Dark Basic Software\Dark Basic Professional\Help\documents\1 Third Party Commands.htm

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 5th Feb 2005 05:25
Quote: "DevC is not really the right language to use..."



Multiplayer DLL on its way! Easy to use DLL for client/server multiplayer games.
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 5th Feb 2005 11:18
u can download vc++6 COMPILER not the editor that is what u actually pay for

my avatar is working for the first time since free-space went down
http://hck83.tophernet.net (things are startign to look up)

Login to post a reply

Server time is: 2024-04-26 19:05:56
Your offset time is: 2024-04-26 19:05:56