Hi,
Is there anything else I got to correct. Because I am having the
same error now after 1122 loops.
Here is my EndPrinter() function
public void EndPrinter()
{
int result = EndPage(dc1);
result = EndDoc(dc1);
pDC.Dispose();
Marshal.FreeHGlobal(hdevmode); // Frees the memory. You could also
free the memory by calling the native win32 globalfree method.
DeleteDC(dc1);
}
Thanks in advance
Lalasa.
Mattias Sjögren wrote:
> >Can you tell me the method I should use to release the handle
returned
> >by GetHDevmode?
>
> The GlobalFree Win32 API, just like thie documentation says.
>
>
http://msdn.microsoft.com/library/en...modeTopic1.asp
>
> Marshal.FreeHGlobal probably works as well.
>
>
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.