ImageMagickObject error in VB

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
spieler
Posts: 47
Joined: 2004-10-08T09:03:16-07:00
Location: Iowa

ImageMagickObject error in VB

Post by spieler »

I'm using the Windows ImageMagickObject interface with VB6 on Vista Business SP1 32-bit.

The problem I am seeing is that using the reference is no longer working the way it used to.

On 6.3.6, both Command1 and Command2 work.
On 6.5.4, only Command2 works. Command1 returns
-2147418113:Method 'Identify' of object 'IMagickImage' failed
(This looks a little strange with the I in front of MagickImage)

In short, it looks like the early binding is no longer working, but late binding is. Is this working as intended?

Thanks,
Gary

Code: Select all

Private Sub Command1_Click()
On Error GoTo ErrorHandler
Dim omi As New ImageMagickObject.MagickImage
    MsgBox (omi.Identify("-format", "%m", "rose:"))    
Exit Sub
ErrorHandler:
    MsgBox (Err.Number & ":" & Err.Description)
End Sub

Private Sub Command2_Click()
On Error GoTo ErrorHandler
Dim omi
    Set omi = New ImageMagickObject.MagickImage
    MsgBox (omi.Identify("-format", "%m", "rose:"))   
Exit Sub
ErrorHandler:
    MsgBox (Err.Number & ":" & Err.Description)
End Sub
Edit: corrected subject
spieler
Posts: 47
Joined: 2004-10-08T09:03:16-07:00
Location: Iowa

Re: ImageMagickObject error in VB

Post by spieler »

Others continue to get this error. Magick, what other details do you need?

Thanks,
Gary
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ImageMagickObject error in VB

Post by magick »

We tried your script (with cscript) and it got a syntax error. Can you post a complete script that will compile and run. Note, we are not VB developers so any additional help to reproduce the problem is welcome.
spieler
Posts: 47
Joined: 2004-10-08T09:03:16-07:00
Location: Iowa

Re: ImageMagickObject error in VB

Post by spieler »

Since VBScript does not have early binding (e.g you cannot do "Dim omi As New ImageMagickObject.MagickImage" -- only "Dim omi"), you will not be able to reproduce this with VBScript.

I tried this with MS VB 2008 Express Edition (free), but it worked fine.

I'm sure there are quite a few changes between the two version numbers I mentioned, but were there any changes in software or the way the .dll is being created?
Post Reply