Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

runtime error -1(ffffffff)

Status
Not open for further replies.

Transcend

Programmer
Sep 29, 2002
858
AU
Hi there guys,

I'm a bit stuck. The scenario is there, I have a webbrowser control on a form and all it does is open up a picture when given a file location. Basically my users call up drawing records, and if a file location exists they can open up the picture. At the moment the way they close the form is just by clicking the little x at the top right of the form. However once I try to open up the 3rd or 4th picture I get the error

runtime error -1(ffffffff)
Method 'Show' of object 'frmDrawingImage' failed

and the program crashes.

However when I go into debug mode and hit debug here, then continue, the picture opens up fine!!
Any ideas??

Thanks in advance

Transcend
 
I should add that i'm not opening up 4 different instances of the form - i'm closing the form then reopening it.

I'm just really stuck on this one! Should I be adding something to my form_unload event???

Transcend

[noevil]
 
why not use the

on error goto Err:

Err:
exit sub Please pardon the grammar.
Not good in english.
 
In th Form_Unload event, be sure to Set all module level variables that contain object references to Nothing. I also would
Set formname = nothing
Also be sure that there are no references to the form or its controls elsewhere.

Put this in to see if the form is terminating.
Private Sub Form_Terminate()
' Do not reference any form or control properties.
Msgbox "terminated"
End Sub

If you do not get the message, the form is unloading the controls but not terminating. There is a difference. If the form does not terminate, module level variables will keep their values through the next Load. Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Hi guys,

thanks for your replies, unfortunately nothing seemed to work!! I set EVERYTHING to nothing - and while I could just put an exit sub on an error occuring I'd rather not do this ... in the end I changed the way i was opening the drawing.

Instead of using the webbrowser control I now use the Shell command to open the drawing up in imaging preview :)

Transcend

[noevil]
 

Haaa, Imaging Preview = Kodak/Wang Imaging controls (Image Edit to be more precise). So if you want to keep it in your own program....

Good Luck

 
Haha .. i didn't set it to imaging vb5prgrmr, it actually just opens up the drawings with whatever program the file is associated with :)

Most of the drawings are tif files and in my case the association was with imaging - if i change the file association a different program opens. We made it this way because they want the drawing to open outside the app - they have the option to edit it etc with another tool we created.

Thanks anyhow!

Transcend

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top