DiscardCtrl() after MakeMovableCtrl() brings to an error

I found a problem involving DiscrdCtrl() and MakeMovableCtrl() functions.
Now I've been able to reproduce it in the simple example I attached: you can see it following these steps
press "Duplicate "Roundness factor"" button and this control is duplicated
press "Discard "Roundness factor"" button and the duplicated control is discarded
for the second time press "Duplicate "Roundness factor"" button and this control is duplicated
for the second time press "Duplicate "Roundness factor"" button and you will see the error "Attempt to free pointer to memory not allocated by malloc() or calloc()"
after I found this kind of errors in my large application, they produced a FATAL error in other parts of my code.
I see this issue both with CVI 2009SP1 and CVI 2010.
Could you help me finding a way to fix this?
Vix
In claris non fit interpretatio
Using LV 2013 SP1 on Win 7 64bit
Using LV 8.2.1 on WinXP SP3
Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
Using CVI 6.0 on Win2k, WinXP and WinXP Embedded
Attachments:
movectrl.zip ‏13 KB

Hi Vix,
The function InsertPanelAsTabPage makes a copy of the panel, and of all the controls in it. Therefore, what I said before about DuplicateCtrl and DuplicatePanel also applies to InsertPanelAsTabPage: you must recreate the custom control after you copy it. I modified both instances in your code where you were calling InsertPanelAsTabPage:
int main (int argc, char *argv[])
    DeleteTabPage (movableCtrlPanel, MOVABLE_TAB, 0, 1);
    InsertPanelAsTabPage (movableCtrlPanel, MOVABLE_TAB, 0, panelTOinsert);
    GetPanelHandleFromTabPage (movableCtrlPanel, MOVABLE_TAB, 0, &TabViHndl);
    InstallCtrlCallback (TabViHndl, TOINS_NUMERIC, NULL, 0);
    MakeMovableCtrl (TabViHndl, TOINS_NUMERIC, "", 1, 1, 1, 0);
    SetMovableCtrlAttribute (TabViHndl, TOINS_NUMERIC, MOVECTRL_ATTR_CTRL_MOVABLE, 1);
    SetCtrlAttribute (movableCtrlPanel, MOVABLE_TAB, ATTR_CTRL_INDEX, 0);
int CVICALLBACK Discard (int panel, int control, int event,
        void *callbackData, int eventData1, int eventData2)
    int TabViHndl;
    switch (event)
        case EVENT_COMMIT:
            DeleteTabPage (movableCtrlPanel, MOVABLE_TAB, 0, 1);
            SetCtrlAttribute (panel, MOVABLE_DUPL, ATTR_DIMMED, 0);
            SetCtrlAttribute (panel, MOVABLE_DISC, ATTR_DIMMED, 1);
            InsertPanelAsTabPage (movableCtrlPanel, MOVABLE_TAB, 0, panelTOinsert);
            GetPanelHandleFromTabPage (movableCtrlPanel, MOVABLE_TAB, 0, &TabViHndl);
            InstallCtrlCallback (TabViHndl, TOINS_NUMERIC, NULL, 0);
            MakeMovableCtrl (TabViHndl, TOINS_NUMERIC, "", 1, 1, 1, 0);
            SetCtrlAttribute (panel, MOVABLE_TAB,    ATTR_CTRL_INDEX, 0);
            break;
    return 0;

Similar Messages

  • I just tried to update my iPhone4 to iOS7 and after downloading, I got an error "4005" message; Now my iPhone is completely wiped out and I can't even get my pc to read it (just has a picture of the USB and the iTunes icon). HELP!!

    I tried updating my Iphone4 from iOS 6.1.4 to 7 via iTunes. After downloading, I got an error 4005 message during installation and now my phone is completely wiped out; is not being recognized by my PC; and all I get on the phone is a photo of a USB plug and the iTunes symbol! Can anyone, PLEASE, help?!?

    The phones in recovery mode so if yu connect it to itunes it should ask to restore it back to the last back up you have done.
    that should solve it for you...

  • I have tried to update my iPod Touch 4G to the latest update. After the 4 hours an error message appears saying iTunes had lost connection even when I am fully connected to the internet. I have repeated the update 4 times now with not luck. Any ideas?

    I have tried to update my iPod Touch 4G to the latest update, I currently have iOS 4.1. After the 4 hours an error message appears saying iTunes had lost connection even when I am fully connected to the internet. I have repeated the update 4 times now with not luck. Any ideas?
    Thanks in advance
    Adam

    If you get a network timed out error, try disabling the security software on the computer during the download and install.
    You can also try a direct download andinstall by:
    iPod, iPhone and iPad Firmware Download
    Nera the top of the page aretheinstructions for selecing the download for the install.

  • Exporting from bridge brings up an error

    I am trying to export from bridge, this takes about 10 minutes but then brings up an error saying " Contact Sheet Processed. Generate PDF failed due to unknown reason."
    Not a very helpful message. any ideas what i can try?
    This is CS5 and is running on Windows XP SP3

    I'm getting the same message when I have security features turned on, but not when turned off.

  • The boot camp manager keeps quitting after re-start with an error message, why? I've installed the latest updates for XP 32bit

    The boot camp manager keeps quitting after re-starts with an error message, why? I've installed the latest updates for XP 32bit

    Alveto wrote:
    The boot camp manager keeps quitting after re-starts with an error message, why? I've installed the latest updates for XP 32bit
    Are we supposed to guess what the error message is?

  • Trying to download CS6 on my mac pro. when i click on Download, under my orders, it brings up an error page: JRun Servlet error, 413 Header Length to Large. It's been doing this each time I've tried that last few days. What can I do to download this?

    Trying to download CS6 on my mac pro. when i click on Download, under my orders, it brings up an error page: JRun Servlet error, 413 Header Length to Large. It's been doing this each time I've tried that last few days. What can I do to download this?

    clear your adobe.com cookies or use a different browser.

  • I am trying to generate purchase order and i create a BAPI also which is active. But when i call the BAPI from SYbase Mobile Object RFC then after calling it gives an Error "Conflict when calling a Function Module (Field Length)".

    i am trying to generate purchase order and i create a BAPI also which is active.
    But when i call the BAPI from SYbase Mobile Object RFC then after calling it gives an Error "Conflict when calling a Function Module (Field Length)".

    Hi,
    Yeah i tried my Z_BAPI in R3 and then giving some ERROR.
    This is my CODE-
    FUNCTION ZBAPIPOTV2.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(POHD) TYPE  ZPOHD OPTIONAL
    *"     VALUE(POITEM) TYPE  ZPOITEM OPTIONAL
    *"  TABLES
    *"      RETURN STRUCTURE  BAPIRET1 OPTIONAL
    data: ls_pohd type bapimepoheader,
             ls_pohdx TYPE bapimepoheaderx,
             lt_poit TYPE TABLE OF bapimepoitem,
             lt_poitx TYPE TABLE OF bapimepoitemx,
             ls_poit TYPE bapimepoitem,
             ls_poitx TYPE bapimepoitemx.
       MOVE-CORRESPONDING pohd to ls_pohd.
       MOVE-CORRESPONDING poitem to ls_poit.
       ls_pohdx-comp_code = 'x'.
       ls_pohdx-doc_type = 'x'.
       ls_pohdx-vendor = 'x'.
       ls_pohdx-purch_org = 'x'.
       ls_pohdx-pur_group = 'x'.
       ls_poit-po_item = '00010'.
       APPEND ls_poit to lt_poit.
       ls_poitx-po_item = '00010'.
       ls_poitx-po_itemx = 'x'.
       ls_poitx-material = 'x'.
       ls_poitx-plant = 'x'.
       ls_poitx-quantity = 'x'.
       APPEND ls_poitx to lt_poitx.
    CALL FUNCTION 'BAPI_PO_CREATE1'
       EXPORTING
         POHEADER                     = ls_pohd
        POHEADERX                    =  ls_pohdx
    *   POADDRVENDOR                 =
    *   TESTRUN                      =
    *   MEMORY_UNCOMPLETE            =
    *   MEMORY_COMPLETE              =
    *   POEXPIMPHEADER               =
    *   POEXPIMPHEADERX              =
    *   VERSIONS                     =
    *   NO_MESSAGING                 =
    *   NO_MESSAGE_REQ               =
    *   NO_AUTHORITY                 =
    *   NO_PRICE_FROM_PO             =
    *   PARK_COMPLETE                =
    *   PARK_UNCOMPLETE              =
    * IMPORTING
    *   EXPPURCHASEORDER             =
    *   EXPHEADER                    =
    *   EXPPOEXPIMPHEADER            =
      TABLES
        RETURN                       = return
        POITEM                       = lt_poit
        POITEMX                      = lt_poitx
    *   POADDRDELIVERY               =
    *   POSCHEDULE                   =
    *   POSCHEDULEX                  =
    *   POACCOUNT                    =
    *   POACCOUNTPROFITSEGMENT       =
    *   POACCOUNTX                   =
    *   POCONDHEADER                 =
    *   POCONDHEADERX                =
    *   POCOND                       =
    *   POCONDX                      =
    *   POLIMITS                     =
    *   POCONTRACTLIMITS             =
    *   POSERVICES                   =
    *   POSRVACCESSVALUES            =
    *   POSERVICESTEXT               =
    *   EXTENSIONIN                  =
    *   EXTENSIONOUT                 =
    *   POEXPIMPITEM                 =
    *   POEXPIMPITEMX                =
    *   POTEXTHEADER                 =
    *   POTEXTITEM                   =
    *   ALLVERSIONS                  =
    *   POPARTNER                    =
    *   POCOMPONENTS                 =
    *   POCOMPONENTSX                =
    *   POSHIPPING                   =
    *   POSHIPPINGX                  =
    *   POSHIPPINGEXP                =
    *   SERIALNUMBER                 =
    *   SERIALNUMBERX                =
    *   INVPLANHEADER                =
    *   INVPLANHEADERX               =
    *   INVPLANITEM                  =
    *   INVPLANITEMX                 =
    ENDFUNCTION.
    i am trying to generate purchase order and i create a BAPI also which is active. But when i call the BAPI from SYbase Mobile Object RFC then after calling it gives an Error "Conflict when calling a Function Module (Field Length)". 

  • After 9.3 update getting error printing to Adobe PDF while converting from Powerpoint to PDF

    That happened after upgrading Acrobat Pro 9.1.2 to 9.2->9.3 on Windows XP sp2 platform. Converting from other Microsoft Office 2003 products is totally normal(Excel, Word) Did anyone came accross and know how to fix that?? We have many users with exactly same issue.

    thanks...figured out my problem!
    Date: Wed, 3 Feb 2010 12:24:29 -0700
    From: [email protected]
    To: [email protected]
    Subject: Re: After 9.3 update getting error printing to Adobe PDF while converting from Powerpoint to PDF
    What happens if you try to print to the Adobe PDF printer?
    >

  • Usage of back button in shopping screen brings up the error in the screen,

    Hi All,
    Usage of back button in shopping screen brings up the error in the screen,
    In SRM shopping screen, when we use the "back" button on the Internet Explorer toolbar, it does not work, it brings up the error screen. Using the "back" button within the SRM window only occasionally works and if used near the end of an order it gives errors and all information inputted until you press back button is lost.
    So, to resolve this issue, I mean when you press back button it should go to previous screen and should not give any error and also should not loose data in the screen.
    Any suggestions in resolving this issue is very much apppreciable.
    Thanks
    Ravi

    Hi Ravi,
    Internet explorer back button is not supported for the application, instead you can use  back to status/back button in  SRM shopping cart application, you should be good to go with this button.
    SAP recommends not to use internet explorer back button which stops the functoning of application.
    regards,
    IGA.

  • Error 1669 after updating to ios 7, Error 1669 after updating to ios 7

    Error 1669 after updating to ios 7, Error 1669 after updating to ios 7

    how to solve error 1669
    STEP 1: Delete iTunes from your computer. Also make sure you remove the cache(open itunes then press edit wich is located on the tool bar and then click on preferences and then go to advanced and click on reset warrnings and reset cache).
    then go to your hard disk and go to program files and delete folder named itunes.
    Note: If you have any libraries or locally cached data that you want to keep, temporarily store them somewhere until you get the situation fixed.
    STEP 2: Once it is completely deleted, download iTunes 11.1 from Apple servers.
    STEP 3: Download iTunes 11.1 from here.
    STEP 4: Now connect your iPhone, iPad or iPod touch to computer.
    STEP 5: Click “restore”, it should present you with a notification saying a new version is available.
    STEP 6: Simply Click download and install, and sit back and relax.
    The process should be completed and your error 1669 should be fixed.

  • Problem with connecting ipad 2 with crestron cp2e...help plss its urgent... I hv a ipad 2 with mobile pro g connected with cp2e. when i pressed any button in ipad its connet with cp2e but after 4-5 sec one error comes (warning wifi was powered off while t

    problem with connecting ipad 2 with crestron cp2e...help plss its urgent...
    I hv a ipad 2 with mobile pro g connected with cp2e. when i pressed any button in ipad its connet with cp2e but after 4-5 sec one error comes (warning wifi was powered off while the device was in auto -lock(sleep)press connect to reconnect) when i pressed again its connected with cp2e. i am using netgear wireless access point . i also has been changed access point as well as updated ipad firmware bt problem is as it is .. pls help.

    Hi have you solved the issue ?
    Cause I have the same problem.
    Tnx

  • I am using apple configerator. I am unable to prepare or supervise 1 ipad. After preparing, I get an error that says "refresh completed but with an error, unable to verify supervision state" . I have erased all content and set up as a new ipad.

    I am using apple configerator. I am unable to prepare or supervise 1 ipad. After preparing, I get an error that says "refresh completed but with an error, unable to verify supervision state" . I have erased all content and set up as a new ipad and tried again with no success. Any help would be appreciated

    Hello jaybearden,
    Thanks for the question. After reviewing your post, it sounds like you are not able to restore the iOS device since you get an error 9. I would recommend that you read this article, it may be able to help the issue.
    Resolve iOS update and restore errors - Apple Support
    Check your security software
    Related errors: 2, 4, 6, 9, 1000, 1611, 9006. Sometimes security software can prevent your device from communicating with either the Apple update server or with your device.
    Check your security software and settings to make sure that they aren't preventing a connection to the Apple servers.
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • During the final step of installing after download, I get an error - The Installer encountered an error that caused installation to fail.

    During the final step of installing after download, I get an error - The Installer encountered an error that caused installation to fail.

    Nobody can tell you anything. You have not provided any proper system information or even told us what you are actually downloading.
    Mylenium

  • I am unable to view source or bring up the error console in firefox 4

    I just upgraded from Firefox 3.6.15 to Firefox 4 on my Mac running Snow Leopard. I am unable to view the source of websites and I am unable to bring up the error console. When I try to do any of these tasks nothing happens.

    Same here, on Firefox 5.0

  • Everytime I come to purchase neverwinter nights 2 it won't let me, and brings the following error message up; 'There was an error in the App Store. Please try again later (100). It is later, days later, and still nothing is working. Help!?!

    Everytime I come to purchase neverwinter nights 2 it won't let me, and brings the following error message up; 'There was an error in the App Store. Please try again later (100). It is later, days later, and still nothing is working. Help!?!
    Thanks

    Try here >  Mac App Store: "An unknown error occurred (100)" when purchasing

Maybe you are looking for

  • How to access purchased iTunes movies/TV episodes without loading large amounts of data on devices

    II have a quick question and I apologize if it has already been addressed in another forum & I had not found it yet (if so please link me to that forum) but I was looking for a way to stream movies and TV episodes that I have purchased on our iTunes

  • How do I retrieve my Mail files from a Time Machine backup?

    I reformatted my iMac hard rive because I was having all kinds of problems with speed and crashing.  I did a Time Machine backup and then reformatted the hard drive and reinstalled Yosemite.  I then reinstalled fresh apps and all my files.  I just do

  • How do I take iweb files online and fix it on a new iweb software

    my computer crashed and had to get a new harddrive and lost everything. I'm trying to fix my website with the new iweb application that I had to reinstall. Is that possible? If not, how can I edit my website?

  • HTML formatted properly? Images too large?

    I am very interested in iWeb but I am seeing some small problems. Websites created with iWeb seem to have format issues. When I submit the pages to Doctor html I get: There were xxxx unset image command tags that you should set to improve your overal

  • Reading Multiple Structures

    Hi, Could anyone tell me how to read multiple structures in a single BPEL process? I have a requirement to read multiple files with different structures to be read in a single BPEL process. All these files will be ftped and read from a single source