Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

pre-load cnigraph dlls

Hi,

I have a meas studio C++ app. One of the dialogs it displays contains 33 seperate CNiGraphs. The dialog also creates a CNiTask with 33 analog channels, but does not start the task until a button on the dialog is pressed.  The first time this dialog loads it takes several seconds to load. On my development laptop it doesn't take too long, but its real platform is a fairly slow machine running Win2K with 256meg memory and there it takes around 6 seconds to load. Subsequent displays of the dialog come up quickly. I suspect that the time taken is in loading libraries. Can I pre load / link in any libraries to speed up displaying the dialog?

Thanks
Phil reaston
0 Kudos
Message 1 of 3
(3,372 Views)

Greetings

First thing I would do is verify which part exactly takes the longest. The 33 Graphs or the task? It's probably the task.

If its the task, one thing you can do is create the task when your application is loading and verify that task using task.Control(DAQmxTaskVerify). This way, you will get the delay hit during application load time (maybe add a loading dialog box or something). This can be problematic ofcourse if you do not have enough information about the type of task at that point. In which case, you can try creating a fake task and disposing of it to load some of the basic runtime libraries. So this way, when you load the task the second time, the delay won't be that bad. We load alot of the dll's at task load time since we don't know what kind of task will be used and it makes no sense to load all the stuff in the memory for all cases.

If its the graph (I'm doubtful whether this is the case), try creating the dialog with the graphs and hide it at load time.

I hope this helps.


Bilal Durrani
NI
0 Kudos
Message 2 of 3
(3,364 Views)
Bilal, Thanks. I created and deleted a task in the app initinstance and that worked just fine. Now I just need to add a splash screen to cover  that task load and I'm set.
Phil reaston
0 Kudos
Message 3 of 3
(3,357 Views)