LabWindows/CVI

取消
显示结果 
搜索替代 
您的意思是: 

How do I load a panel, Run User Interface, and continue running more code?

I have a dll that I have written, and I want one of the function calls to load a panel, have the RunUserInterface running to handle that panels events, and then continue with more code.

function()
{
LoadPanel()
RunUserInterface();
code();
code();
etc();
}

I know the example wont work, but how do I achieve the same result.

Ive tried calling RunUserInterface as another thread, but this doesnt seem to work either.

Regards

Alex.
1 条消息(共 4 条)
4,080 次查看
Hello

RunUserInterface() starts a message loop which does not return until you call QuitUserInterface(). So Any code placed after RunUserInterface() will only run after after the message loop is completed.
Calling RunUserInterface() in another will only create a message loop in that thread. In which case, the UI in the main thread will not do anything, since you wont have a message loop in the main thread.
If all you need is to run some function after your message loop has initialized, Use one of the thread pool functions to schedule your code() in another thread. You can use CmtScheduleThreadPoolFunction() for that.

If you code() has some panel initialization, you can create callbacks for the panel and call code() there instead of scheduling it in a threa
dpool.

Hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 项奖励
2 条消息(共 4 条)
4,080 次查看
Thanks,

Sorta helped, I couldn't quite do what you suggested as I need the funtion to exit but keep RunUserInterface running. What I ended up doing was to call a thread that loaded the panel and ran the RunUserInterface, and then continued my code after the thread call.

Regards

Alex.
0 项奖励
3 条消息(共 4 条)
4,080 次查看

hi alex,

 

sorry for the unconventionally way to get in contact regarding FTDI. but I thought I'll meet you here. I cant get running your FT2XX_demo-Example  inside CVI 2009. should it or are there problems ?

 

best regards

 

Simon

0 项奖励
4 条消息(共 4 条)
3,690 次查看