LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

A question about InsertPanelAsTabPage( ) / DeleteTabPage( )

Solved!
Go to solution

I can't find a clear explanation in the documentation for these functions:

does the DeleteTabPage( ) free all the memory resources of a tab? Or should I free all these resources before calling it?

 

Let me explain with an example:

  1. I install a panel as a tab page calling InsertPanelAsTabPage( )
  2. I programatically create some controls in this tab
  3. I display an image ina picture control calling DisplayImageFile( )

then I want to discard this tab.

Should I call DiscardCtrl( ) and DeleteImage( ) before calling DeleteTabPage( ) to free the memory?

Or does DeleteTabPage( ) automatically do this?

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 1 of 2
(3,180 Views)
Solution
Accepted by topic author vix

DeleteTabPage() removes the tab page from the tab control and discards the tab page panel (where all the controls on the tab live). So you don't have to call DiscardCtrl() and DiscardImage()... DeleteTabPage() will take care of all this for you.

 

However, the help for InsertPanelAsTabPage() indicates that it makes a copy of the panel and inserts it as a tab page. Therefore, you still have to discard the panel that you passed to InsertPanelAsTabPage().

 

Hope this helps,

 

- jared

Message 2 of 2
(3,155 Views)