Hi!
Use your function in dll in thread.
Like...
void _stdcall _export (n,m...)
{
int threadID;
CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE, ThreadFunction, NULL, &threadID);
CmtWaitForThreadPoolFunctionCompletion (DEFAULT_THREAD_POOL_HANDLE, threadID, OPT_TP_PROCESS_EVENTS_WHILE_WAITING);
}
int CVICALLBACK ThreadFunction (void *functionData)
{
.
.
.
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
.
.
.
status = hPanel_1 = NewActiveXCtrlFromPersistence (hPanel, "", 0, 0,
"{E9A5593C-CAB0-11D1-8C0B-0000F8754DA1}", 1, dataPtr, 0);
.
.
.
CoUninitialize();
}