How to use a *.cls

D

Daniel

I found a possible solution to a previous post about retrieving image
extended properties. I downloaded ImageProperties.cls from
http:'www.mvps.org/emorcillo
website.

I have 2 issues however. Firstly it was posted in his 'Old VB6' section,
does this mean I will have problems with access 2000 and 2003?

Secondly, How do I use this file? I imported it into my db, but how do I
make call to use it? I know nothing about APIs any help in understanding
them would be much appreciated!

Thank you,

Daniel
 
S

Stefan Hoffmann

hi Daniel,
Daniel said:
I have 2 issues however. Firstly it was posted in his 'Old VB6' section,
does this mean I will have problems with access 2000 and 2003?
Maybe, but not necessarily.
Secondly, How do I use this file? I imported it into my db, but how do I
make call to use it? I know nothing about APIs any help in understanding
them would be much appreciated!
It is a class module. You don't need to know anything about API calls,
but you need to know a little bit about classes and objects:

To use it, you have to create an object and us it:

Dim obj As ImageProperties

Set obj = New ImageProperties

' do stuff with obj.

Set obj = Nothing


mfG
--> stefan <--
 
D

Daniel

Stefan,

Based on your previous post I have a basic Fucntion
****
Function img()
Dim obj As ImageProperties

Set obj = New ImageProperties

With obj
.OpenImage ("c:\picture.jpg")
Debug.Print "Height: " & .Height
Debug.Print "Width: " & .Width
Debug.Print "HorizontalResolution: " & .HorizontalResolution
Debug.Print "VerticalResolution: " & .VerticalResolution
Debug.Print "PixelFormat: " & .PixelFormat

'For Each it In .Item()
'If IsNull(it) = False Then Debug.Print "Item: " & it
'Next it
End With

obj.CloseImage

Set obj = Nothing

End Function
****

Is there a way to make the commented out section work,

For Each it In .Item()
If IsNull(it) = False Then Debug.Print "Item: " & it
Next it

that is to loop through all the Item tags to basically make a complete
listing of all the image properties? How do you enumerate them all in a loop
function without having to explicitly having to code each tag?

Could you also point me in the right direction for getting so basic info
about classes and objects.

Thank you,

Daniel
 
S

Stefan Hoffmann

hi Daniel,
Is there a way to make the commented out section work,
As far as i can see in the source of the class no.
For Each it In .Item()
If IsNull(it) = False Then Debug.Print "Item: " & it
Next it
You can use a normal for-loop instead:

Dim Count As Long

For Count = 0 To obj.Count - 1
With obj.Item(Count)
'...
End With
Next Count

Could you also point me in the right direction for getting so basic info
about classes and objects.

http://www.di-mgt.com.au/classes.html
http://www.amazon.com/phrase/Object-Oriented-Programming


mfG
--> stefan <--
 
Top