LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicated comboboxes cause unexpected behavior

Hello,
 
When I create a combo box by taking the duplicate of an existing one (using the DuplicateCtrl function) I cannot operate this control in a decent way. It seems that the string control, attached to the combo box, appears as an indicator (grey background instead of white and I cannot enter text). When I select an Item from the ring control, the string control becomes editable, but after entering a few characters my application crashes, displaying the error 'Dynamic memory is corrupt'.
A possible workaround is creating a new string and converting it into a combo box, instead of duplicating an existing combo box, but I was hoping that there is a better solution...
 
Thanks for all hints and tips,
Wim
0 Kudos
Message 1 of 5
(3,632 Views)
Hello Wim,
 
Here is a link on the NI website where you can find an explication of your error "Dynamic memory is corrupt".
 
 
I hope it will help you.
 
 
Julien Roland
Application Engineer
NI Belgium
Julien Roland - District Sales Manager
NI Belgium - Technical Support

Don't forget to rate a good answer
Message 2 of 5
(3,567 Views)

Hello Julien,

Thanks for the info. I still don't know what goes wrong but now at least I understand the meaning of the error message.

0 Kudos
Message 3 of 5
(3,557 Views)
You cannot duplicate a combo box using DuplicateCtrl. The combo box is a custom control that creates a ring to go along with the string control and uses the callback functions of both controls to operate as a combo box control. DuplicateCtrl doesn't know anything about the combo box custom control, it only knows about the string control that the combo box is based on. The source for the combo box custom control is located in \toolslib\custctrl\combobox.*, so if you really wanted to add a Combo_DuplicateComboBox function that does the right thing, you could.
 
However, the easiest thing would probably be to create a new string control and create a new combo box from that using Combo_NewComboBox.
 
Hope this helps.
 
- jared
Message 4 of 5
(3,532 Views)

Hello Jared,

OK, I understand the problem. Creating a new string would indeed be the best solution for me. Thanks a lot.

 

Wim

0 Kudos
Message 5 of 5
(3,528 Views)