Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

ni-daqmx Base framework hijacks open document event from Finder on Mac OS X

Here is another unexpected nasty surprise with mxBase on OS X. I wrote an application (in RealBasic, but it probably doesn't matter) which uses plugins written in C and built using Xcode, the latter linked to NI's nidaqmxbase.framework & nidaqmxbaselv.framework frameworks (the latest v2.1).

Turns out that as soon as I call any of my C plugins (even if they don't access any of NI mxBase API calls), double-clicking one of my application's documents from the Finder (which passes an open document event to my app) fails to open my own doc. Instead I get a mysterious message box that says "The file myHD:Users...:myOwnFile.wtx is not a valid LabVIEW file". Of course it's not, it's my own file type, but why on earth would the nidaqmxbase framework intercept this open doc event and kill the file open process???

This message box must definitely be coming from within NI's frameworks as there is nowhere I wrote such code to display such a dialog box.

So I'm now stuck yet again, not being able to double-click my documents from the Finder to open them, because nidaqmxbase insists on a LabVIEW doc and refuses to allow anything else to open.

Has anyone seen this and is there a workaround?

Peter.
0 Kudos
Message 1 of 4
(3,283 Views)
Hi Peter,

I'm not sure why OS X decided to associate the wtx extension with LabVIEW since that is not an extension that we should recgonize, but you can set OS X to use a specific application when doubl clicking on that file or files with that extension.  Here are the steps to do that:

Click on the file and the press apple + i.  (you can also right click or ctrl + click on the file and select file info)
A window should pop up with a selection that says "open with"
Once you click on "open with" you can select the application that you want to open the file with.
You can then change all of the files with that extension to use the application by clicking on change all


If you have any questions about these steps, please let me know.
Thank You,

Nick F.
Applications Engineer
0 Kudos
Message 2 of 4
(3,257 Views)

Thanks for your reply Nick, but it's more complicated than you think.

The .wtx extension recognizes and launches my app, no problem.  The problem is after my app launches, and the open doc event propagates thru the event queue (which should normally result in my .wtx document being opened by my app), your framework intercepts this event and puts up its own dialog box saying that the .wtx file is not a valid LV file, and kills the open doc event.  So my  document never opens in my app, which means I now have an app whose documents can't be double-clicked from the Finder, hardly an elegant program.

If I prevent any calls to your framework (and by so doing I assume I prevent initialization of all the vi's etc...), .wtx files work flawlessly from the Finder, my app launches, the doc opens, etc...

So your framework for some reason kills the document open events as soon as it's initialized, preventing all but LV docs from being recognized by the host app.

Peter.

0 Kudos
Message 3 of 4
(3,247 Views)
Hi Peter,

I've been trying to recreate your issue here and have currently been unsuccessful. 

Is it possible for you to send your .wtx file and your application to the applications engineer that you are in contact with and we will continue to try and reproduce your issue.
Thank You,

Nick F.
Applications Engineer
0 Kudos
Message 4 of 4
(3,208 Views)