|
Memory allocated in .NET using the new command can automatically claimed by the GC as soon as the object loses scope. I say can, because it won't do it immediatly. Disposing is only required if there are unmanaged resources owned by the object.
Which means you can safely remove the "ff.Dispose()" statement.
Also see Object.Finalize Method (System)[^], Garbage Collection[^] and Implementing a Dispose Method[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thank you for this insight, Eddy. Still I am confused having the list.count variable reduced after removing the list entry (which is an instance), but the instance itself seems to be still alive (shared counter variable of the class doesn't decrement).
|
|
|
|
|
That is because it still is alive. It will remain so until the GC collects it. You can't "force" it to be deleted from memory.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
hello sir/mam
i am asking about visual basic 6.0 server client connection so please help me a i facing the problem.
i already make a tetris game and run properly but i want to connect my game to play 3 client through server.
you know the flow of a computer game hop?? it's like that the server is the one who can play the client are player1, and player2,and soon they are connecting using winsock.
how to connect my game to winsock please help me this is my project submission.
|
|
|
|
|
|
I'm looking for someone who develops a utility to integrate Gmail with CRM software
|
|
|
|
|
|
Member for six and a half years, and you still haven't worked out that we do not provide code-to-order?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Good day friends!!!
Please, before I ask my question, I know VB 6 is outdated by this must be done in VB 6 as the required.
I am able to save text as .wav file but finding it difficult to convert .wav file to text.
Any idea is welcome please.
Thanks in advance!
|
|
|
|
|
You're going to need some speech recognition engine to do this. VB6 doesn't come with one so you're going to have to find something that 1) is COM-based and 2) accepts a .WAV file as input as an alternate to a mic. Start with Google...
|
|
|
|
|
Quote: Friend
What could be happening, because when I say close a form with unload me, it is giving the following error:
Unable to unload within this context
|
|
|
|
|
Show the code where this is happening.
|
|
|
|
|
"Unload" is something from VB6 - VB.NET has a garbage collector. It will be unloaded as soon as there are no active references to the form.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Friends
Passing more information on the problem for better understanding.
See the routine below it is very simple, however I'm getting intermittent error in my application.
Searching the error I got the link below, but checking my process I did not find anything related to the item resize.
If anyone has any other information that can help me in this matter thank you for the attention.
Private Sub cmdExit_Click()
On Error GoTo TryCathError
Unload Me
Exit Sub
TryCathError:
Dim s_dsMsg As String
s_dsMsg = "Error :{" & Err.Number & "}" _
& vbNewLine & Err.Description
MsgBox s_dsMsg, vbCritical, "Error"
End Sub
link ===> msdn.microsoft.com/en-us/library/aa243662(v=vs.60).aspx
There is an Unload statement in the Resize event of a Data, Form, MDIForm, or PictureBox control.
Remove the Unload statement from the event.
|
|
|
|
|
You don't unload in VB.NET; ..and the suggestion from the other site to include an exit-sub is also nonsense.
What language are you targetting? And why do you think you need to dispose something that is in use? Unloading "Me" while you are executing one of its members is like stealing a cup while somebody is drinking coffee.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Quote: Eddy Vluggen / Grupo
I'm programming with vb 6, the error I passed is code 365
Unable to unload within this context
|
|
|
|
|
In which case you have wasted EVERYONE's time. VB6 is no longer supported. Download VB.net.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Group
Quote: How sad, but thank you for your attention.
|
|
|
|
|
nei2009 wrote: I'm programming with vb 6 VB6 is no longer supported. Good luck with it.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Group
Quote: How sad, but thank you for your attention.
|
|
|
|
|
Hi,
I've created multiple lists of my own class. Now I want to add them to a listview. with Always the same sub.
So I was thinking convert it to an ienumerable and than walk throu it. however I can't find a way to do it.
Anybody has an idee to fill my listview.
Jan
|
|
|
|
|
List<t> already implements IEnumberable<t>. There's nothing to convert.
Perhaps if you showed some examples of what you're talking about?
|
|
|
|
|
Hi,
I added 2 pictures
Picture 1 and Picture 2
Both are from different classes.
i want them to load into the same listview with the same subroutine(sub sFillListview(c as collection)) or something like that.
Prefereble with headers.
Like you can see picture 1 has only 2 columns but picture 2 has 23
thanks already for looking
Jan
|
|
|
|
|
If you want to do a kind of automation you need something what your different classes have in common.
You should provide much more details - perhaps there is a solution ...
|
|
|
|
|
Your classes have nothing in common, so your "single method to do it all" idea won't work. So, how is your "one method to rule them all" supposed to know how to handle each different class passed in the parameters?
Are you looking to take the data from these classes and format it somehow to be added to a ListView? If that's the case, you have to add something to these classes to give something in common. Create an Interface that both of these classes implements so each class can supply code to format itself to be used in a ListView:
Public Interface IListViewFormat
Function ListViewFormat() As String
End Interface
Now, each class has to implement the interface and supply the code for the ListViewFormat method.
Public Class Aansluiting Implements IListViewFormat
... properties code ...
Public Function ListViewFormat()
return String.Format("{0} - {1}", ID, aansluiting)
End Function
Then you can change your List to be a collection of IListViewFormat and pass that to your method that adds the items to a ListView.
Dim collection = New List(Of IListViewFormat)
... add your items to the List and pass it to the method
Public Sub AddToListView(ByVal collection As IList(Of IListViewFormat))
For Each item In collection
ListView1.Items.Add(item.ListViewFormat)
Next
End Sub
modified 18-Apr-17 19:28pm.
|
|
|
|