Error creatin window handle
-
Hi In recent times I often get an application error that it is impossible to create a new control object, because there are no more window handles left. The application is written in C# (.Net 1.1) and is used to create extensive content specific dialogues. At the moment I’m not quite sure how to identify the source of error. Within my object model, I use every time dispose() to destroy any existing graphical object. But it seems that this process doesn’t work correct. It is possible to retrieve the number of window handles that are currently used by an application? Last week I read a thread that states to locate the application process and then use the MainWindowHandle property in relation with EnumWindows to get the total count of all window handles. Unfortunately, I’ have no idea how to implement this procedure (especially how shall I use EnumWindows). Does anyone knows how to perform this task or does anyone have another idea to determine the total count of used window handles? Thanks in advance Erik
-
Hi In recent times I often get an application error that it is impossible to create a new control object, because there are no more window handles left. The application is written in C# (.Net 1.1) and is used to create extensive content specific dialogues. At the moment I’m not quite sure how to identify the source of error. Within my object model, I use every time dispose() to destroy any existing graphical object. But it seems that this process doesn’t work correct. It is possible to retrieve the number of window handles that are currently used by an application? Last week I read a thread that states to locate the application process and then use the MainWindowHandle property in relation with EnumWindows to get the total count of all window handles. Unfortunately, I’ have no idea how to implement this procedure (especially how shall I use EnumWindows). Does anyone knows how to perform this task or does anyone have another idea to determine the total count of used window handles? Thanks in advance Erik
Let's first understand the problem. You can't create new controls because you've used up all 10,000 window handles allocated to your process[^]? Is that what's happening?
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Sound The Great Shofar! The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
-
Hi In recent times I often get an application error that it is impossible to create a new control object, because there are no more window handles left. The application is written in C# (.Net 1.1) and is used to create extensive content specific dialogues. At the moment I’m not quite sure how to identify the source of error. Within my object model, I use every time dispose() to destroy any existing graphical object. But it seems that this process doesn’t work correct. It is possible to retrieve the number of window handles that are currently used by an application? Last week I read a thread that states to locate the application process and then use the MainWindowHandle property in relation with EnumWindows to get the total count of all window handles. Unfortunately, I’ have no idea how to implement this procedure (especially how shall I use EnumWindows). Does anyone knows how to perform this task or does anyone have another idea to determine the total count of used window handles? Thanks in advance Erik
Hi! There's a thread on this topic a few entries down the page: here
Regards, mav -- Black holes are the places where God divided by 0...
-
Let's first understand the problem. You can't create new controls because you've used up all 10,000 window handles allocated to your process[^]? Is that what's happening?
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Sound The Great Shofar! The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
-
Hi! There's a thread on this topic a few entries down the page: here
Regards, mav -- Black holes are the places where God divided by 0...
Hi, thanks for the excellent link. This is exactly what I was looking for. Using GetGuiResources shows that even if I dispose (or I think that I dispose them) the gui objects, not all used window handles were disposed. Just to give a small example: Before opening an order : 204 / 375 After opening an order : 370 / 1988 After closing an order : 267 / 699 I guess that if everything would work correct the total numbers of available gui handles after closing an order should be the same as before opening the order. Is there any way to detect this memory leak? Regards Erik
-
Hi, thanks for the excellent link. This is exactly what I was looking for. Using GetGuiResources shows that even if I dispose (or I think that I dispose them) the gui objects, not all used window handles were disposed. Just to give a small example: Before opening an order : 204 / 375 After opening an order : 370 / 1988 After closing an order : 267 / 699 I guess that if everything would work correct the total numbers of available gui handles after closing an order should be the same as before opening the order. Is there any way to detect this memory leak? Regards Erik
Microsoft has a free tool called the CLR Profiler that can alert you to memory leaks. Commercial apps such as Ants Profiler also can alert you to memory leaks.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Sound The Great Shofar! The apostle Paul, modernly speaking: Epistles of Paul Judah Himango