I can't tell you how many times I've stressed this to myself and to my co-workers. And wouldn't you know it - I spent the last 8 hours... an entire working day... tracking down a bug in my PocketPC, Compact Framework app. In the end, it was all because I forgot to call .Dispose on an API object.
FYI: Symbol 9000w handheld scanner device, running PocketPC. I was calling the Symbol API object: Symbol.WirelessLAN.Radio to get the Signal.Percent signal strength percentage. I added the .Dispose to my Radio object, and it's workin fine now.
Private Sub SetRadioLevel()
Dim r As Symbol.WirelessLAN.Radio
Try
r =
New Symbol.WirelessLAN.Radio
prgSignalStrength.Value = r.Signal.Percent
Finally
If Not r Is Nothing Then
r.Dispose()
End If
End Try
End Sub