473,378 Members | 1,378 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Killing stray GDI objects

C# noob alert...

I am using a third party dll file to do some processing on rtf files.
This dll however leaks GDI objects like there is no tomorrow. It
crosses the threshold of 10000 objects after processing just a 100
files. While I can work with the developers on the third party team for
a long term solution, is there a quick fix for me to use right now? Is
there some-way I can make the Garbage collector destroy these GDI
objects once they cross a threshold?

Apr 21 '06 #1
2 1810
<ji*****@gmail.com> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com...
C# noob alert...

I am using a third party dll file to do some processing on rtf files.
This dll however leaks GDI objects like there is no tomorrow. It
crosses the threshold of 10000 objects after processing just a 100
files. While I can work with the developers on the third party team for
a long term solution, is there a quick fix for me to use right now? Is
there some-way I can make the Garbage collector destroy these GDI
objects once they cross a threshold?


I'd think GC.Collect is about all you can do.

Michael
Apr 22 '06 #2
ji*****@gmail.com wrote:
C# noob alert...

I am using a third party dll file to do some processing on rtf files.
This dll however leaks GDI objects like there is no tomorrow. It
crosses the threshold of 10000 objects after processing just a 100
files. While I can work with the developers on the third party team for
a long term solution, is there a quick fix for me to use right now? Is
there some-way I can make the Garbage collector destroy these GDI
objects once they cross a threshold?


I don't think there is any way to tell the GC to kill objects containing
GDI handles.
The only thing I could think of is to load the third party dll in its
own AppDomain and unload/reload that from time to time. I think the
operating system will automatically free all handles that are still in
use when the AppDomain gets unloaded. Though that's ugly as hell... I'd
just try to get them to fix that asap!

Max
Apr 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Hari Prasad | last post by:
I wrote an application where I am trying to kill a parent frame with out killing the child one. I have created a frame (F1) and if I click a button on F1 I am getting a new frame (F2). Now, if...
6
by: Colin Steadman | last post by:
I have created a function to kill all session variables that aren't in a safe list. This is the function - Sub PurgeSessionVariables For Each Item In Session.Contents Select Case Trim(Item)...
10
by: Jacek Popławski | last post by:
Hello. I am going to write python script which will read python command from socket, run it and return some values back to socket. My problem is, that I need some timeout. I need to say for...
1
by: krose | last post by:
Hi Using a couple of examples on CodeProject.com I've create a nice little shell extension (adds some custom menus for proprietary file types). Everything is working fine, except I can't get it...
8
by: Alvin | last post by:
Right. I`m using Dev-Cpp, and I`m working on a game at this time in SDL (http://libsdl.org), and I`ve come across this error: ------------------------------------------ main.c: In function...
5
by: =?Utf-8?B?QmFyZW4=?= | last post by:
Hi! All, I am using a ASP.NEt application, wherein i am automating Execl object. I am not able to destroy the instance, eve if I write this to destroy the instance of Excel. Please find the ...
11
by: Grzesiek | last post by:
Hi I have Main.cpp and Hello.cpp files in my Dev C++ project. Main.cpp #include "Hello.cpp" int main(){ return 0;
18
by: J.K. Baltzersen | last post by:
To whomever it may concern: I am using MS Visual C++ 6.0. I have a process A which instantiates an object C. At a later point the process A creates the thread B. The thread B has access...
6
by: Roger Heathcote | last post by:
sjdevnull@yahoo.com wrote: <snip> Fair point, but for sub processes that need to be in close contact with the original app, or very small functions that you'd like 100s or 1000s of it seems...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.