• Welcome to Valhalla Legends Archive.
 

[Plugins] Error: ActiveX component can’t create object

Started by Networks, February 15, 2005, 08:43 PM

Previous topic - Next topic

Networks



Private Sub Load_Plugins()
    Dim tmpPlugin As String
   
    ReDim Plugins(0)
   
    Dim i As Integer
    Dim strPath As String
    With frmMain
        .FPluginBox.Path = (App.Path & "\Plugins")
        .FPluginBox.Visible = False
        For i = 0 To .FPluginBox.ListCount - 1
            strPath = App.Path & "\Plugins\" & .FPluginBox.List(i) 'Register dll.
            Shell "regsvr32 " & Chr(34) & strPath & Chr(34) & " -s"
        Next i
    End With
   
    'Load Plugins
    For i = 0 To frmMain.FPluginBox.ListCount - 1
        strPath = App.Path & "\Plugins\" & frmMain.FPluginBox.List(i)
        tmpPlugin = Split(frmMain.FPluginBox.List(i), ".dll")(0)
        Shell "regsvr32 " & Chr(34) & strPath & Chr(34) & " -s" 'Register dll.
        Set Plugins(UBound(Plugins)) = CreateObject(tmpPlugin & ".clsMain")
        ReDim Preserve Plugins(UBound(Plugins) + 1)
        AddC frmMain.RTB2, QBColor(2), "Loaded Plugin: " & frmMain.FPluginBox.List(i)
    Next i
End Sub



I am trying to load plugins from a folder getting a list of them via filelistbox (FPluginBox) however an odd thing occurs. When I load a plugin named: 'PLUGY.dll' it loads perfectly fine but when I change the name of this dll to anything else I get an error: 'ActiveX component can't create object.' Does anyone know what I can do to fix this and have it load all the plugins perfectly fine in my folder \Plugins\. 

Warrior

It's how Microsoft Active X DLLs work. You need to rename the project name as well.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Networks

Problem solved. Thank you VERY much. I think that's retarded but alright.

Warrior

Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?