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 / annoying PureBASIC DLL error: help please

Author
Message
DarkPhear
15
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Brazil
Posted: 16th Sep 2004 14:57 Edited at: 16th Sep 2004 15:08
I'm writing a plugin in PureBASIC... Well, at least trying to... When I use call dll command from dbpro everything works fine. Then I use ResourceHacker to add the stringtable to my dll, and copy it to plugins-user folder to use as command. The strange thing is that it just worked for me yesterday... I've tried the exact same thing today (at least that's what I think) and it doesn't work anymore. DBPRO says "Failed to load DLL (1:stringplugin.dll)". It seems ResourceHacker is messing up my DLL! Now, no matter what I change in the PB code or in the string table, DBPRO gives me this error. Grrrrr
I'm trying a single simple stupid procedure and this also gives me THE error.

;My PureBasic procedure:

ProcedureCDLL teste()
ProcedureReturn 999
EndProcedure

;my stringtable:

STRINGTABLE
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
{
1, "TESTE[%L%teste%"
}

Can anyone please tell me what I'm doing wrong here? Because I just can't figure it out!

[EDIT]
Hey, I just downloaded a sample DLL written in purebasic and it gives me the same error. At least I know it's not my fault. Any ideas? [/EDIT]

Cleber de Mattos Casali, game programmer.
DarkPhear is a full freeware RPG developed by me. You can download it and some game demos for free at my page: http://darkphear.cjb.net
cybernetic wraith
14
Years of Service
User Offline
Joined: 6th Sep 2004
Location:
Posted: 17th Sep 2004 02:47
Try the procedure like so:


ProcedureCDLL.l teste()
ProcedureReturn 999
EndProcedure
DarkPhear
15
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Brazil
Posted: 17th Sep 2004 05:33
Ouch, same problem. Some of my other installed plugins are also giving me this error... Maybe my DBPRO is broken...

Cleber de Mattos Casali, game programmer.
DarkPhear is a full freeware RPG developed by me. You can download it and some game demos for free at my page: http://darkphear.cjb.net
Shadow Robert
16
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 17th Sep 2004 05:56
try this:



DO NOT construct the String table yourself, IMPORT a blank 32bit .Res ... Newletter 19/20 had one.
There is a reason for this.

Remember you can only have 20 Strings per string resource segment, this is microsoft's rule not mine.

Add to the end (probably 1 on a blank string table)

1, "Test Function[%LL%TestFunction%Dword Return = Test Function( Dword Value )";

now once that is in place make sure you click 'COMPILE SCRIPT' and then save the DLL.

put it in your Plugin-user directory and now call the function like

Variable as dword = Test Function( 10 )
Text 0, 0, Str$(Variable)




cybernetic wraith
14
Years of Service
User Offline
Joined: 6th Sep 2004
Location:
Posted: 17th Sep 2004 07:00
Also, make sure your DLL has the required GlobStruct stuff from the tutorial.
Freddix
AGK Developer
16
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 17th Sep 2004 09:06 Edited at: 17th Sep 2004 09:07
I encounter that problem when I add string table ... and sometimes, the DLL is broken even if I don't have added String Table.

Try a software called PE Explorer , Use " Recalculate Headers" and save your DLL again ( do this once you have added your string table )

Try your DLL and it should work ...

DarkPhear
15
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Brazil
Posted: 17th Sep 2004 13:35
Oh, it works great now. All broken DLLs are working.
Thank you so much guys...

By the way, PE Explorer is not free. Is there any free replacement?

Cleber de Mattos Casali, game programmer.
DarkPhear is a full freeware RPG developed by me. You can download it and some game demos for free at my page: http://darkphear.cjb.net
Freddix
AGK Developer
16
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 18th Sep 2004 04:11
I didn't find any program that make the header calculation ...
I've noticed this to Fred the Purebasic's main developper ...

OSX Using Happy Dude
15
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 18th Sep 2004 05:48 Edited at: 18th Sep 2004 17:57
Its one reason I would advise using Visual Studio - it does save a lot of headaches...


Come to the UK Convention on the 23rd & 24th of October
DarkPhear
15
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Brazil
Posted: 18th Sep 2004 06:36
Visual Studio is way too expensive, specially here in Brazil... Purebasic is easier and the price is fair. I'm also considering Dev C++ ...
Hey TCA, by the way your UserControl plugin was giving me the same error, I used PE Explorer on it and it worked.

Cleber de Mattos Casali, game programmer.
DarkPhear is a full freeware RPG developed by me. You can download it and some game demos for free at my page: http://darkphear.cjb.net
Freddix
AGK Developer
16
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 18th Sep 2004 07:52
@ DarkPhear : loooooool

OSX Using Happy Dude
15
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 18th Sep 2004 17:36 Edited at: 18th Sep 2004 17:58
Quote: "Hey TCA, by the way your UserControl plugin was giving me the same error, I used PE Explorer on it and it worked."

Dont see why - the only time a Failed to Load DLL message comes up is if you dont have the GLFW.DLL present with the main executable.
Unless of course, Brazialian DLL's have a different format... Or are you running 98/ME ?

Quote: "Visual Studio is way too expensive, specially here in Brazil"

Even seperately ?


Come to the UK Convention on the 23rd & 24th of October
DarkPhear
15
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Brazil
Posted: 19th Sep 2004 02:40
Okay, maybe it's my fault. My OS is Windows 98 SE in portuguese, and sometimes things just don't work here. For example, it took me a big headache to make BlueIDE work here. And when people make their codes like:

it just doesn't work for me, because here it is "Conex√£o TCP/IP para DirectPlay"...

Cleber de Mattos Casali, game programmer.
DarkPhear is a full freeware RPG developed by me. You can download it and some game demos for free at my page: http://darkphear.cjb.net
OSX Using Happy Dude
15
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 19th Sep 2004 05:55
Its the trouble with most programmers, we dont design the text for internationalisation. The main problem is unless you're good at other languages or know someone who can accurately translate text, it becomes too much of a bother.

Is most of the text for menus in a INI file ? If so, it might be worth getting Rob to get someone to translate the files.


Come to the UK Convention on the 23rd & 24th of October
DarkPhear
15
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Brazil
Posted: 24th Sep 2004 11:16
I think all the text is in separate ini files. It can be easily translated.

Cleber de Mattos Casali, game programmer.
DarkPhear is a full freeware RPG developed by me. You can download it and some game demos for free at my page: http://darkphear.cjb.net

Login to post a reply

Server time is: 2019-04-26 12:05:21
Your offset time is: 2019-04-26 12:05:21