|
TDDragon wrote: Dim im As Image = Drawing.Image.FromFile(path)
pic.Image = im
im = Nothing
All this does is set the reference that im holds to nothing. The object still exists because you passed the reference to it to pic.Image.
Remember, most (the vast majority) of object types are reference types. Setting a variable to nothing just means the variable's reference is set to nothing. It does not mean the object ceased to exist. If something else is using the actual object then it will continue to exist.
TDDragon wrote: is this what you mean by disposing the image?
No. Look for the Dispose() method.
Do NOT Dispose an object that is in use. Only Dispose of an object when it is no longer needed.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
I got it working with the dispose method
thank you very much
|
|
|
|
|
The real solution is to not use FromFile in the first place. See this[^] for the way around this little limitation.
|
|
|
|
|
I've tried the workaround but this doesn't work for me.
The images to be displayed are mostly TIF files (more than 1 page in 1 image) and with the workaround there is only 1 page (the first one) that the stream contains
|
|
|
|
|
Works fine for me.
GDI+ support for TIF files is a bit lacking. JPEG compressed TIFs are not supported by GDI, along with a few other things that I can't remember off the top of my head.
|
|
|
|
|
Is there a way to force the garbage collector to run ?
|
|
|
|
|
TDDragon wrote: Is there a way to force the garbage collector to run ?
Yes. But that is unadvisable. The garbage collector is tuned to keep your application running as smoothly as possible. Forcing it to collect may harm the performance of your application. Also, there is no guarantee that it will collect the objects that you want it to collect. It decides what is in the best interests of your application with respect to the current environment.
If objects contain unmanaged resources, such as Image s, the there will be a Dispose method. (Or Close on stream like objects).
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
Hello,
I am working on a windows application .net 2.0.
I would like to be able to write my own patch application myself that would update small changes in my main application that has been installed on the customer's computer.
I would like for them just to install a small patch, rather than build a setup program.
Can anyone point me in the right direction for creating a patch application for a windows application.
Thanks very much in advance,
Steve
|
|
|
|
|
Why reinvent the wheel that's but invented a dozen times already? How much work are you going to put into this, at such and such $ an hour versus using something off the shelf to do the same thing? How is your version going to be better than the ones you get off the shelf?
Just a thought...
Basically, you'd doing a byte-for-byte compare of the two versions of the files. You create a database of all the changes to have to make, byte-for-byte, to a certain version of a file, then your patch app has to identify the version of the file thats already installed, read the patch database to see if that version of the file is patchable, make a backup copy of the to-be-patched file, then go through and write each byte-change the database specifies.
You'll have to create a database for EACH VERSION of EACH FILE you want to change. So, if you have to files in your application that need changes, but there are 2 versions of your appout there, say v1.0 and v1.5, that need to be upgraded to a third version, say v2.0, you have to create 4 tables worth of changes.
Those table will be built by comparing both files in v1.0 to v2.0 to generate the changes for both files, AND another set comparing the v1.5 files to v2.0.
|
|
|
|
|
Clocking features are provided for through the integrated use of magnetic card reader/hand held bar code scanner. once the employee scan the card the system should save the time. is there any coding to do this..
pls help
|
|
|
|
|
Barcode readers and magnetic strip readers put keystrokes into the keyboard buffer, so there for you need to put a textbox control onto your form to capture the barcode into.
On the textbox leave event, get the current system time and write it to your database with the Employee Id
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
can you give me a sample coding..
thanks
|
|
|
|
|
Hi,
I am looping through the controls of the web page, and checking for checkboxes only. Then to be able to check if a checkbox is checked, I need to do a cast of the control to a checkbox. Please see how I did it (the name of the function where this code is in is called CreateSelectiveSQLStatement:
For Each child As Control In c.Controls
Me.CreateSelectiveSQLStatement(child)
If TypeOf child Is CheckBox Then
'Response.Write(child.ID & "<br />")
Dim chk As CheckBox = CType(child, CheckBox)
' Check if checkbox is checked
If chk.Checked Then
strFields = strFields & child.ID & ", "
Response.Write(chk.ID & "<br />")
End If
End If
Next
It doesn't display anything on the web page. Where is my error? I think it might be at:
Dim chk As CheckBox = CType(child, CheckBox)
Please can someone help me? I am using VB.NET 1.1.
Regards
ma se
|
|
|
|
|
I seem to have found my problem, I used DirectCast instead of CType, not sure why it doesn't work with CType? Maybe someone can help explain?
|
|
|
|
|
Hi
does anyone know how to get the arrow keys to respond to a flash game in a webbrowser control?
thanks
Kevin
|
|
|
|
|
Not a VB question, is it?
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Hi Steve,
this relates to the VB.NET web browser control.
|
|
|
|
|
Is the Web Browser control not a part of Internet Explorer?
Are you trying to get vb app to responed to your keypresses or your Flash app?
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
You'll have to explain what your doing more than this. Key's don't respond to anything, other than someone pressing them. What are you doing with the Flash game?
|
|
|
|
|
Hi Dave
I have written a small VB.NET app which includes a webbrowser control. It works fine but when playing flash games from websites I cannot get the arrow keys to respond. The flash game uses the arrow keys for playing a game. The arrow keys work fine in Internet Explorer. Any ideas?
thanks
|
|
|
|
|
I am able to read mail from outlook
Issue is that when i run the code it displays a diaglog box for authentication in outlook
How can i read mail without getting that diaglog box
Also ii am runing this sample in 2003 when i add the referrence in 2005 it gives error. why? and how can i add outlook reference in 2005
|
|
|
|
|
Hello All
I am creating the user control in vb.net and in the same project i am unable to add that on to the form can any one please help me out .
thanks in Advance
Bharath.S Ron
|
|
|
|
|
can you give me a specific error message?
here are 2 posibels:
1: you haven't build you project yet (you have to build the project in order to see your usercontrol in the toolbox and everytime you have changed something about the usercontrol)
2: you have declared your own constructor with variabels and have no constructor without variabels. If this is the case you can not drag and drop your usercontrol on to your form. you can only add one in code (dynamicly)
|
|
|
|
|
Have you compiled the user control project? Have you added a reference in your windows forms test project to your user control project?
|
|
|
|
|
Hi! All,
Can anybody gimme an idea of multi-threading in VB 6.0? I am a learner in VB.
Thanks and Regards,
Virendra
|
|
|
|