LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
DavidWahedi

Display a popup when Application builder recognizes that the projects contains more than 10000 GDI objects

Status: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.

Hello everyone,

 

I have a costumer which had the idea to popup a dialog when compiling code in the application builder when it recognizes that the projects contains more than 10000 gdi objects instead of just crashing. We don't know if this is possible to implement since gdi objects also could created dynamically during execution but I would help if this could be checked when compiling.

 

Regards 

David

6 Comments
AristosQueue (NI)
NI Employee (retired)

I do not believe this can be checked, but I passed the idea along to appbuilder team, just in case. Microsoft lists a workaround for the GDI issue that can raise the ceiling for GDI object count. I do not know if it will help you, but here it is:

https://msdn.microsoft.com/en-us/library/ms724291.aspx?f=255&MSPPError=-2147217396

dgdgomez
Member

Why do you need LabVIEW to recognize the GDI number? It is possible to increase the limit in windows.

 

Windows 7 - To change this limit, set the following registry value:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\GDIProcessHandleQuota

 

Windows 10 - To change this limit, set the following registry values:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\GDIProcessHandleQuota

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\Windows\GDIProcessHandleQuota

 

Check the following articles: 

DAbort in image.cpp or drawmgr.cpp

Creating User Interface

 

 

DavidWahedi
Member

Thank you for your comments,

 

we already now that we can increase the limit of gdi objects in the registry. 

The problem is when building an application with more than 10000 gdi objects without knowing that labview just crashes without giving the user any information. My costumer had to analyze the logs were he could found entrys of image.cpp and drawmgs.cpp thats why he searched for this keywords and found out that he exceeded the limitations. Better would be if labview recognizes when compiling that this limitation was reached and give the user information about it and not just crashing the application.

 

Thanks

David

dgdgomez
Member

Have you considered using Packed Library to simplify the code?

Look at the following link: Plug-in Architecture using Packed Project Libraries (lvlibp)

 

Regards.

wiebe@CARYA
Knight of NI

This will get you the GDI count. You can make the popup yourself (if you have enough GDI resources left):

 

GetGuiResources.png

 

Change the 0 to 2 to get the peak count.

 

I've run this for my application. It's very graphical (lots of windows, buttons with icons, graphs, picture controls, etc.) I get 954 GID objects. Peak count 1645.

 

Just wondering how to get to 10000, let alone 65535. Are there GDI hungry objects?

 

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.