Memory leak with this code

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I am not the greatest at COM Interop. I understand cleaning up your resources, but usually I am using a VS generated interop library, or primary interop assemblies. Making API Calls is somewhat new to me.

Could someone please explain to me why the code at http://www.wischik.com/lu/Programmer/1bpp would leak memory and how to fix it. It is not my site, but we used it as an example.
.



Relevant Pages

  • Using Windows Portable Devices from c#
    ... Does anyone know what MS's current position is on using the WPD API ... I've found a few resources, three out of four MS resources: ... System.Runtime.InteropServices.ComTypes.IStream myStream = ... I hope this helps anyone else looking into using WPD API interop. ...
    (microsoft.public.windowsmedia.sdk)
  • Re: C# ASP.Net interop with MsWord
    ... You do not want to run run Word interop (for creating and modifying ... etc.) and this is why you couldnt find any resources regarding using Word ... > I have no problem in creating or modifying a word document in ASP.Net, ... > MSWord, given in the ASP.Net and C# environment. ...
    (microsoft.public.dotnet.languages.csharp)
  • =?Utf-8?Q?Re:_warum_ist:_using_Microsoft.O?= =?Utf-8?Q?ffice.Interop.Excel_ung=C3=BCltig?=
    ... weil "Interop" nicht bekannt ist. ... Na, der Namensraum 'Microsoft.Office.Interop.Excel' ist in der Primary Interop Assembly (PIA), auf die du verweist, nicht enthalten. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)