Referenced DLL giving error: Can't create object.

Hi, I'm currently using VB 6.0 and have a DLL that I've referenced and am trying to call a function for. Whenever I try to run the program though, I'm getting "

"ActiveX component can't create object"
on this line:
strEncPass = x.EncryptPass(ENC_MYPASS, ErrMsg)

And here is the entire code:
Sub TestCCPass()

'On Error GoTo Hell

'declare an instance of the CCPass exposing the Pass module within it
Dim x As New CCPass.Pass

Dim strEncPass As String
Dim blValid As Boolean

Const ENC_MYPASS = "MyPassword" 'if less than 8 characters, encryption will fail
Const TST_MYPASS = "MyPassword" 'change this from ENC_MYPASS to test that it fails

'call the encrypt function to encrypt password...returned into strEncPass if ok
strEncPass = x.EncryptPass(ENC_MYPASS, ErrMsg) 'any errors returned into ErrMsg

If Trim(ErrMsg) <> "" Then 'check if there is an error
MsgBox "Error=" & ErrMsg, vbCritical, App.Title
End If
MsgBox "Encrypted Password=" & strEncPass, vbInformation, App.Title

'lets now verify that the encrypted password decrypts back to the original
blValid = x.VerifyPass(TST_MYPASS, strEncPass, ErrMsg)
If blValid = True Then 'yay!
MsgBox "Password is Good", vbExclamation, App.Title
Else 'boo!
MsgBox "Password Bad", vbCritical, App.Title
End If

Exit Sub
MsgBox "There was an error dammit!"

End Sub

Any input would be greatly appreciated. Thank you.


  • All I can think of is that the Pass object can not be created. Perhaps you need to call the function of another class to get a Pass clas created. You should check how to use the components in the documentation that goes with it.

    Best Regards,

  • :
    Was this dll registered on your machine?
  • : Was this dll registered on your machine?

    And has it been recompiled without binary compatibility since it was referenced?


    $ select * from users where clue > 0
    no rows returned

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!