• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

vb6 href 'invalid property assignment'

I localize a file to my drive then try to change the html to point to it and get "invalid property assignments". The file saves fine.  The error only happens when I try to change the href to point to it.

The href prop is not read-only.  Please help me stop feeling so damn stupid.  Thx
dim im As HTMLImg
 
    For Each im In tc.getElementsByTagName("img")
        f = "c:\temp\" + id + "-" + Trim(Str(i)) + ".jpg"
        If URLDownloadToFile(0&, img.href, f, BINDF_GETNEWESTVERSION, 0&) <> ERROR_SUCCESS Then Stop
        f = "file:///" + f
--->      im.href = f         <----
        i = i + 1
    Next

Open in new window

0
jmkexp
Asked:
jmkexp
  • 5
  • 3
1 Solution
 
ee_rleeCommented:
hi
i checked and href property of HTMLImg is read-only.
0
 
jmkexpAuthor Commented:
Hmmm...??  I hit F2 in the ide and bring up the object browser and it is not listed read-only.  Many other props are.  Are you using a better source? (Obviously my results seem to agree more with your source.)
0
 
jmkexpAuthor Commented:
Changing the src prop doen't seem to effect the href prop.  But apparently this is what is used tor retrieve an image because the new file will load properly pointing to the new file after changing only src.  Full points to you still if you'll reveal the source (Luke).
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
ee_rleeCommented:
changing src prop does change the href prop, i did a test like this:

oimage.src = "C:\Winnt\Zapotec.bmp"
Debug.Print oimage.href

Result:
file:///C:/Winnt/Zapotec.bmp



0
 
jmkexpAuthor Commented:
I appreciate your efforts.  Guess I pay too much attention to stuff in the ide (which didn't update href simultaneous with src).  Skpped over the siimple var print.  (Doh!)

I'm here ready to give points if you'll just come across with your source that has href as read-only.
0
 
ee_rleeCommented:
actually that was listed on my object browser..
HTMLImg-href.bmp
0
 
jmkexpAuthor Commented:
Sunuva...   I'm sending you the points.  But that's not what it looks like in my (i guess old) stand-alone vb6.  Don't have a clue why. Seems identical save no r-o attr.  It was the first thing I checked.  If you are using VisStu maybe things are better there.  Anyway, thanx for the work.
0
 
jmkexpAuthor Commented:
Confirmed the solution I found with partial additional info as to cause.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now