Results 1 to 6 of 6

Thread: DLL loading Error

  1. #1

    Thread Starter
    New Member PARKY_PROGRAMMING's Avatar
    Join Date
    Jul 2010
    Location
    London
    Posts
    14

    Smile DLL loading Error

    Hi, I am new to this so go easy on me and thanks in advanced for any replies.

    The current situation is that a .dll file that has not been updated in many months has currently decided on one machine not to load! I have tried re-loading the software on numerous occasions and this has not worked, I have loaded older version of the software and the machine will accept these. The machine will run the code as a whole but there is one call from VBA
    Code:
    Function SetBTListener() As ButtonListener
        Dim MenuBar As CommandBar
        Dim ToolBar As CommandBar
        Dim MenuPopup As CommandBarPopup
        Dim MenuBarButton As CommandBarButton
        Dim ToolBarButton As CommandBarButton
        Dim Listener As ButtonListener
        
        If IsToolBar("POW! Menu", MenuBar) Then
            If IsPopup(MenuBar, "B&acktest", MenuPopup) Then
                If IsSubButton(MenuPopup, "&Run Backtest", MenuBarButton) Then
                    If IsToolBar("POW! Toolbar", ToolBar) Then
                        If IsButton(ToolBar, "&Run Backtest", ToolBarButton) Then
                            Set Listener = New ButtonListener
                            Listener.Init MenuBarButton, ToolBarButton, Now()
                        End If
                    End If
                End If
            End If
        End If
        
        Set SetBTListener = Listener
    End Function
    That brings up the error:

    Compile error:
    Error in loading DLL

    However I know that the DLL is working as it has numerous classes associated with it that are being called and used at the same run-time, it is just this one class that will not work. The code for the class is
    Code:
    Option Explicit
    
    Private WithEvents mMenuBarButton As CommandBarButton
    Private WithEvents mToolBarButton As CommandBarButton
    Private mLastClickTime As Date
    Private mSpeedOfClick As Date 'Diff
    
    Public Sub Init(MenuBarButton As CommandBarButton, ToolBarButton As CommandBarButton, LastClickTime As Date)
        Set mMenuBarButton = MenuBarButton
        Set mToolBarButton = ToolBarButton
        mLastClickTime = LastClickTime
        mSpeedOfClick = LastClickTime ' - CDate(0)
    End Sub
    
    Private Sub mButtonClick(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean)
        Dim tNow As Date
        tNow = Now()
        mSpeedOfClick = Max(0, tNow - mLastClickTime)
        mLastClickTime = tNow
    End Sub
    
    Private Sub mMenuBarButton_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean)
        mButtonClick Ctrl, CancelDefault
    End Sub
    
    Private Sub mToolBarButton_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean)
        mButtonClick Ctrl, CancelDefault
    End Sub
    
    Public Property Get MenuBarButton() As CommandBarButton
        MenuBarButton = mMenuBarButton
    End Property
    
    Public Property Get ToolBarButton() As CommandBarButton
        ToolBarButton = mToolBarButton
    End Property
    
    Public Property Get LastClickTime() As Date
        LastClickTime = mLastClickTime
    End Property
    
    Public Property Get SpeedOfClick() As Date 'Diff
        SpeedOfClick = mSpeedOfClick
    End Property
    Not the best of coding but this is very old and has not been touched since its creation at the dawn of time!!

    All machines run XP SP3 with Office 11

    Hope this all makes sense and that you are able to help

    Thanks again

    PARKY
    Last edited by Hack; Jul 14th, 2010 at 10:19 AM. Reason: Added Code Tags

  2. #2

    Thread Starter
    New Member PARKY_PROGRAMMING's Avatar
    Join Date
    Jul 2010
    Location
    London
    Posts
    14

    Re: DLL loading Error

    Appologies, that is XP SP2

  3. #3
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: DLL loading Error

    Is this actually Visual Basic, or VBA?

  4. #4

    Thread Starter
    New Member PARKY_PROGRAMMING's Avatar
    Join Date
    Jul 2010
    Location
    London
    Posts
    14

    Re: DLL loading Error

    This is VB6
    Last edited by PARKY_PROGRAMMING; Jul 14th, 2010 at 11:50 AM.

  5. #5
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: DLL loading Error

    Machines may have office v11 installed, but what version of office are you using in your DLL references? Is that version installed on the target machine?

    You mentioned older version of the software. Do you mean an older version of the DLL? If so, did you uinstall the older DLL then try re-installing the new DLL?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  6. #6

    Thread Starter
    New Member PARKY_PROGRAMMING's Avatar
    Join Date
    Jul 2010
    Location
    London
    Posts
    14

    Re: DLL loading Error

    Office v11 is in the DLL and target machine, it is the only office version i have access to.

    Yes older versions of the DLL which have definatley been removed correctly before installing the new DLL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width