Valhalla Legends Archive

Member Forums => Spht's Forum => Topic started by: luth on April 27, 2007, 06:10 PM

Title: (SphtBotv3) Getting BCEL.dll to load
Post by: luth on April 27, 2007, 06:10 PM
Seeing as most of valhallalegends.com is down (and has been for quite some time), I thought this would be the most appropriate place to post.  Once the site comes back only, feel free to move this post.

I'm plagued by the gruesome red text "Failed to load BCEL.dll!" when starting SphtBotv3.  I have BCEL.dll in the application directory, as well as msvcr70.dll and msvcr71.dll (wasn't sure which one you used, and the link to vc7_crt.zip is also offline for the time being).  Because of this, none of my plugins will load or function.

What other files might I be missing that could cause BCEL.dll to fail to load?  Or what other causes, besides missing files, are there?

Much obliged.
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: Spht on April 28, 2007, 10:52 AM
What OS?

Try putting the dll's in your system\system32 directories instead
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: luth on April 28, 2007, 02:14 PM
Win2k patched all the way.

Thats the thing, I've got MSVCR*.DLL 70, 71, 80, and 80d in my system32.  This is my dev machine, so I knew I had all the VC files.  But I thought maybe you'd hardcoded the DLL path and loaded it manually, so I dropped them in the app directory too.  Didnt work, obviously.  I threw BCEL.DLL into system32 as well, but it didnt make any change.

Maybe you can think of another reason why it isn't loading?  I don't suppose you have a debug build (or maybe a runtime flag) with an expanded error log file I could use to figure out whats wrong?
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: Barabajagal on April 28, 2007, 02:47 PM
Does it need to be registered using regsvr32?
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: UserLoser on April 28, 2007, 03:02 PM
Quote from: RεalityRipplε on April 28, 2007, 02:47 PM
Does it need to be registered using regsvr32?

MSVC++ runtime files, no.  Things like ActiveX controls, yes.
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: luth on April 28, 2007, 04:02 PM
Probably a silly question, but has this been tested on win2k systems?  I don't suspect this oversight, but commonly I see people make a game using functionality that was added in XP but doesn't exist or doesn't operate the same way in 2k (Shell32 is notorious for this).
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: Barabajagal on April 28, 2007, 05:11 PM
Quote from: UserLoser on April 28, 2007, 03:02 PM
Quote from: RεalityRipplε on April 28, 2007, 02:47 PM
Does it need to be registered using regsvr32?

MSVC++ runtime files, no.  Things like ActiveX controls, yes.
I don't know what the DLL is, I was just making a guess.
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: UserLoser on April 28, 2007, 06:15 PM
Quote from: luth on April 28, 2007, 04:02 PM
Probably a silly question, but has this been tested on win2k systems?  I don't suspect this oversight, but commonly I see people make a game using functionality that was added in XP but doesn't exist or doesn't operate the same way in 2k (Shell32 is notorious for this).

Anything with a Windows NT kernel should be good
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: luth on April 28, 2007, 07:19 PM
Well, I'm at a loss.  Without a debug log or source code to step through, I have no idea how to remedy this problem.  Which is a shame, because in all other ways, this is the least obnoxious and most pleasant bot to work with.  (Granted, my experience with it is limited due to the fact plugins won't run, but that should tell you something of the others I've used...)
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: luth on April 29, 2007, 09:52 PM
Can anyone suggest another bot that I might be able to use?  Nothing fancy, though clan administration and the ability to write my own scripts for it would be required.
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: Mystical on April 29, 2007, 11:47 PM
Eternal Chat?
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: luth on April 30, 2007, 02:02 PM
The website is still down.  I don't suppose you could link me to an alternate location, or be willing to send the application via email / MSN?
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: Mystical on May 01, 2007, 01:15 PM
http://botdev.valhallalegends.com/eternalchat/

not down anymore, enjoy.
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: luth on May 01, 2007, 01:49 PM
It is back up!  Yay, now I can continue poking around the rest of the site too. :)
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: Spht on May 04, 2007, 06:35 PM
Quote from: luth on April 28, 2007, 04:02 PM
Probably a silly question, but has this been tested on win2k systems?  I don't suspect this oversight, but commonly I see people make a game using functionality that was added in XP but doesn't exist or doesn't operate the same way in 2k (Shell32 is notorious for this).

SphtBotv3 was developed entirely on Windows 2000, so yes

Also, as of the latest versions, it should run on non-NT systems as well (such as Windows 98/ME), but with limitations on some features
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: luth on May 05, 2007, 09:44 PM
Very strange that its not loading the DLL then...

Eternal Chat isn't quite all that I was hoping for, so I'd still like to get SphtBot working if at all possible.  What are the chances of getting a version with expanded debug information?  Or a copy of the source that shows how you're loading the DLL?  Might give me some information as to why I cant get it to load...  I'm a professional game programmer, and debugging is kinda my thing.  :)  I'd really like to use your bot since it provides the ability to create plugins; eternal chat only supports simple scripts that dont quite match my needs.  :-/
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: luth on May 08, 2007, 06:55 PM
Does anyone have another 'bot that has similar features of SphtBot, with the ability to write plugins beyond the capabilities of little scripts?
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: Spht on May 08, 2007, 07:01 PM
The error you're getting is displayed if LoadLibrary() returns NULL
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: luth on May 10, 2007, 02:10 PM
I assume you're calling LoadLibrary("BCEL.dll") without any path specified?  I don't suppose a version that outputs the GetLastError() number after the "Failed to load BCEL.dll!" message would be possible?

Something interesting worth noting, if I remove BCEL.dll from my system (or rename it to "foo.bar"), then "Failed to load BCEL.dll!" does not appear.  Whether that means it successfully loaded it, or you skipped over that message in the case the file does not exist (unlikely), I'm unable to test, as none of my bots have been allowed to connect to B.net today.
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: Spht on May 10, 2007, 10:35 PM
Quote from: luth on May 10, 2007, 02:10 PM
I assume you're calling LoadLibrary("BCEL.dll") without any path specified?  I don't suppose a version that outputs the GetLastError() number after the "Failed to load BCEL.dll!" message would be possible?

Something interesting worth noting, if I remove BCEL.dll from my system (or rename it to "foo.bar"), then "Failed to load BCEL.dll!" does not appear.  Whether that means it successfully loaded it, or you skipped over that message in the case the file does not exist (unlikely), I'm unable to test, as none of my bots have been allowed to connect to B.net today.

No, it uses the path the bot is running from when calling LoadLibrary().  If BCEL loaded fine, then the bot will display a "Loading plugins" message, and /listplugins will work

Try this (http://www.valhallalegends.com/spht/LoadBCEL.exe) vb app, it is basically the same process SphtBotv3 uses for loading BCEL

Sub Main()
    Dim AppPath As String
    Dim BCEL_DLL As String
    Dim hinstLib As Long
   
    AppPath = FixPath(App.path)
    BCEL_DLL = AppPath & "BCEL.DLL"
    If SetCurrentDirectory(AppPath) = 0 Then MsgBox "Failed SetCurrentDirectory(" & AppPath & ")"
    If Len(Dir(BCEL_DLL)) Then
        hinstLib = LoadLibrary(BCEL_DLL)
        If hinstLib Then
            MsgBox "Success loading " & BCEL_DLL & vbCrLf & _
                "hinstLib = " & hinstLib
            If FreeLibrary(hinstLib) Then
                MsgBox "Success freeing library"
            Else
                MsgBox "Failed freeing library"
            End If
        Else
            MsgBox "Failed loading " & BCEL_DLL & vbCrLf & _
                "Err.LastDllError = " & Err.LastDllError
        End If
    Else
        MsgBox "Could not find " & BCEL_DLL
    End If
End Sub
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: Mystical on May 10, 2007, 11:12 PM
ooh wow i didn't know sphtbot3 was in vb6.
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: tumeria on May 11, 2007, 01:41 AM
no
Title: cheap airfare
Post by: mvgfdfw on May 11, 2007, 03:25 PM
spam.
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: tumeria on May 11, 2007, 04:43 PM
tx
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: luth on May 12, 2007, 10:15 PM
Ah, thanks spam-bot.

But seriously folks...

Thanks for the quick 'n dirty VB app.  The result from the Err.LastDllError helped me diagnose and fix the problem.  Finally, its all up and workin'.  :)

Thanks again.

*edit*
QuotePlenty of examples are provided on the SDK, and there is even a plugin template created by Yoni

Where can I find these?  Forums SEARCH didn't turn up anything (well, nothing useful).  I'd like to start hacking away at some custom plugins.  :)
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: Spht on May 13, 2007, 08:38 AM
Quote from: luth on May 12, 2007, 10:15 PM
Ah, thanks spam-bot.

But seriously folks...

Thanks for the quick 'n dirty VB app.  The result from the Err.LastDllError helped me diagnose and fix the problem.  Finally, its all up and workin'.  :)

Thanks again.

So, what was the problem?

Quote from: luth on May 12, 2007, 10:15 PM
*edit*
QuotePlenty of examples are provided on the SDK, and there is even a plugin template created by Yoni

Where can I find these?  Forums SEARCH didn't turn up anything (well, nothing useful).  I'd like to start hacking away at some custom plugins.  :)

http://www.valhallalegends.com/pub/BCP/

Let us know if you make any plugins for the public!
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: luth on May 16, 2007, 06:50 PM
http://www.valhallalegends.com/pub/BCP/Documentation/
It's empty!

Is there no documentation on how to write plugins?  I have the EmptyPlugin solution for vc7, and its all fine and dandy, but theres no docs anywhere.  :)  Is there another source for BCP documentation?  Or perhaps some example source files showing some simple, routine operations?
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: tumeria on May 16, 2007, 07:03 PM
http://www.valhallalegends.com/pub/BCP/SDK/
Title: Re: (SphtBotv3) Getting BCEL.dll to load
Post by: luth on May 16, 2007, 07:14 PM
Yeah, thats where I got the SDK.  But, as I just said, there's no documentation, some some barebones files.  Granted, there's not a lot of source there, but if there is any documentation available, I'd like to read it before I start hacking away.

And, because I forgot:
Quote from: Spht on May 13, 2007, 08:38 AM
Let us know if you make any plugins for the public!
Of course.  :)  Most everything I do is public, open source, and comes with my personal tech support.  What can I say?  Once a teacher, always a teacher.