|
Subject:
|
wrong code in book
|
|
Posted By:
|
dennist685
|
Post Date:
|
1/20/2006 8:35:58 AM
|
regarding IDisposable On page 249 he says to put in the code
Public Class Person Implements IDisposable
Then it says This interface defines two methods—Dispose and Finalize—that need to be implemented in the class. Visual Studio automatically inserts both of these methods into your code:
But it didn't
I had to put in the methods myself, with his modifications
Private Overloads Sub Dispose(ByVal disposing As Boolean) If Not Me.disposed Then If disposing Then ‘ TODO: put code to dispose managed resources mPhones = Nothing End If ‘ TODO: put code to free unmanaged resources here End If Me.disposed = True End Sub
But mphones isn't acceptable because its implemented in the employee class.
The problem is that the rest of the chapter builds on this. How do I fix this so the rest of the chapter and perhaps subsequent chapters are useful to me.
dennist685
|
|
Reply By:
|
RamaRamachandran
|
Reply Date:
|
2/21/2006 10:28:39 AM
|
>> Visual Studio automatically inserts both of these methods into >> your code:
>> But it didn't
It will. If you hit the enter key after the text
Implements IDisposable
- hope this helps
- Rama
|