06-25-2007 11:30 AM
#include "toolbox.h"I have a numeric control on the MAIN panel and am duplicating it 80 times on the child TESTPANEL panel.
#include <cvirte.h>
#include <userint.h>
#include "ttmemleak.h"
static int hMain, hTestPanel;
void CreateIndicators(void);
int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpszCmdLine, int nCmdShow)
{
if (InitCVIRTE (hInstance, 0, 0) == 0)
return -1; /* out of memory */
if ((hMain = LoadPanel (0, "ttmemleak.uir", MAIN)) < 0)
return -1;
if ((hTestPanel = LoadPanel (hMain, "ttmemleak.uir", TESTPANEL)) < 0)
return -1;
DisplayPanel (hMain);
DisplayPanel(hTestPanel);
CreateIndicators();
RunUserInterface ();
DiscardPanel (hMain);
return 0;
}
int CVICALLBACK MainHandler (int panel, int event, void *callbackData,
int eventData1, int eventData2)
{
switch (event)
{
case EVENT_GOT_FOCUS:
break;
case EVENT_LOST_FOCUS:
break;
case EVENT_CLOSE:
QuitUserInterface (0);
break;
}
return 0;
}
void CreateIndicators(void)
{
int i, iTop = 10, iLeft = 50, iCtrlID;
char szBuff[40];
for(i=1; i<=80; i++){
iCtrlID = DuplicateCtrl (hMain, MAIN_NUMERIC, hTestPanel, "", iTop, iLeft);
sprintf(szBuff,"Tooltip #%d",i);
SetCtrlToolTipAttribute(hTestPanel,iCtrlID,CTRL_TOOLTIP_ATTR_TEXT,szBuff);
iTop+=20;
if(i%20==0){
iLeft+=100;
iTop = 10;
}
}
}
06-26-2007 11:44 AM
07-09-2008 04:56 AM
07-09-2008 05:05 AM
hello
it's me again. I found the answer this bug is fixed with CVI 8.5
http://zone.ni.com/devzone/cda/tut/p/id/6545#toc10
jp