473,398 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

subcription out of range? how can i fix this problem Pin

hello everyone,

is there anyone could help me to this problem, I have downloaded a module file which is (exifReader), then I apply it to my system code. when I browse an image from a folder or file when I click the a button to show the properties of the image and put it to some textbox, I got this error saying " run time error 9 , Subcription out range",

this is the code for showing the properties of the image :

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2.  If Picture1.Picture = 0 Then
  3.  MsgBox ("Insert Image First")
  4.  Else
  5.  Text6.Text = CommonDialog1.FileName
  6.  Text3.Enabled = False
  7.  Dim objexif As New ExifReader
  8.       objexif.Load (Text6.Text)
  9.       Text2.Text = objexif.Tag(GPSLongitude)
  10.       Text3.Text = objexif.Tag(GPSLatitude)
  11.       Text4.Text = objexif.Tag(GPSInfo)
  12.       Text5.Text = objexif.Tag(DateTimeOriginal)
  13.  Text2.Enabled = False
  14.  Text6.Enabled = False
  15.  Text3.Enabled = False
  16.  End If
  17.  End Sub
  18.  //*******
  19.  
  20. and this the module part of code where the error shows.
  21.  
  22. Private Function InspectJPGFile() As Boolean
  23.  
  24.       Dim i As Long
  25.  
  26.       If ExifTemp(0) <> &HFF And ExifTemp(1) <> &HD8 Then
  27.             InspectJPGFile = False
  28.       Else
  29.       ///this line is having error, subscription out of range///
  30. For i = 2 To UBound(ExifTemp) + 1
  31.                   If ExifTemp(i) = &HFF And ExifTemp(i + 1) = &HE1 Then
  32.                         Offset_to_APP1 = i
  33.                         Exit For
  34.                   End If
  35.             Next
  36.  
  37.             If Offset_to_APP1 = 0 Then
  38.                   InspectJPGFile = False
  39.             End If
  40.  
  41.             Offset_to_TIFF = Offset_to_APP1 + 10
  42.  
  43.             Length_of_APP1 = _
  44.                   ExifTemp(Offset_to_APP1 + 2) * 256& + _
  45.                   ExifTemp(Offset_to_APP1 + 3)
  46.  
  47.             If Chr(ExifTemp(Offset_to_APP1 + 4)) & Chr(ExifTemp(Offset_to_APP1 + 5)) & _
  48.                   Chr(ExifTemp(Offset_to_APP1 + 6)) & Chr(ExifTemp(Offset_to_APP1 + 7)) <> "Exif" Then
  49.                   InspectJPGFile = False
  50.                   Exit Function
  51.             End If
  52.  
  53.             InspectJPGFile = True
  54.  
  55.       End If

if the codes are not enough to analyze please tell me and I post all the code for exifreader class module, any idea and help are really appreciated. thanks..


by the way I use Visual basic 6.0.. ^_^
May 22 '13 #1
1 1402
Rabbit
12,516 Expert Mod 8TB
That's because you're going above the upper bound of your array by doing the +1. I don't understand that. You're saying go one higher than the highest possible.
May 22 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Thomas R. Hummel | last post by:
Hello all, I am trying to write a query that compares a member's enrollment period with the products that their group has had during that period (all members belong to a group and the products...
6
by: Sen-Lung Chen | last post by:
Dear All: I have a question about this below function.The purpose of this function is to generate one number between a and b. -------------------------- int gennum(int a, int b) {...
0
by: Joki | last post by:
Hi all, When I push report print button, i can select print current page, selected page, 1-nnn page, but it print all page everytime. I'm using VSNET 2005 Beta1 Thanks, Joki
3
by: Tsair | last post by:
Select PoHead.*, PoItem.*, PoItem.Tranno as Tranno from PoItem INNER JOIN ON PoItem.Tranno = PoHead.Tranno Where PoHead.TranDate > #5/10/2005# AND PoHead.TranDate < #9/10/2005# AND TRUE ORDER BY...
2
by: toton | last post by:
Hi, I am trying to use boost::range with one of my own container class, and having some problem. I am missing some usage of range. Can anyone suggest a proper way for it ? To show the problem...
3
by: jen2007 | last post by:
I have several ranges of dates (2007-03-15 - 2007-03-21, format YYYY,MM,DD) and I need to list all of the dates in the range and not sure how to do this. I wrote an OnLoad procedure that should run...
3
by: girl | last post by:
i have this problem m using dataset dataadapter and dataset i would like to select a date range using a datetimepicker or monthcalendar. the data in my database for date is 05/01/2007 where 05...
0
by: Rami Prilutsky | last post by:
I'm binding the dataView to a dataset (~400000 rows) and sorting it by a key (long type). I'm retrieving values from the DataView with FindRows(object key) which returns DataRowView. The...
4
by: grego9 | last post by:
Can anyone tell me how to create a named range that can then be referred to later in VBA for excel 2000. At the minute I am simply expanding any ranges out to the maximum possible size before...
4
by: Annalyzer | last post by:
Can anyone see what's wrong with this code: Private Sub Command278_Click() On Error GoTo Err_Command278_Click Dim stDocName As String Dim whereArray() Dim stLinkCriteria,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.