*Experts* Merrion Posted November 30, 2002 *Experts* Posted November 30, 2002 Monitoring a print queue from VB.Net Any comments/suggestions for improvement? Thanks in advance Duncan Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
*Gurus* Derek Stone Posted November 30, 2002 *Gurus* Posted November 30, 2002 Glad to see you got this working in .NET. It's a good example of passing structure pointers to the Win32 API from a managed environment. Just a quick comment though. You call Marshal.FreeHGlobal() in the class' Finalize method, so keep in mind how long it may take for the Garbage Collector to actually free that unmanaged memory. The only way to ensure that the memory is freed in a timely manner is to call FreeHGlobal directly after AllocHGlobal or at least make sure to call the class' Dispose method after you're finished using it. Quote Posting Guidelines
*Experts* Merrion Posted December 1, 2002 Author *Experts* Posted December 1, 2002 Good point. I'm still trying to get out of the VB6 mentatilty on this. Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.