I try to use the common Windows dialog box for saving files. For this I'm using the ActiveX-class "MSComDlg.ICommonDialog" with the propertynode input "Filter" for the file types. It's the standard "SaveAsType.vi" (somewhere in the forum).
Everything works fine on a 32-bit Windows system. But when I run the code on a 64-bit system I can not save my file with the last file-extension in the box field. I always get a error-message: "The file name is invalid!" This happens only when the last box-element is selected. All other run normal.
So for example:
If may box array is
Matlab Files (*.mat)|*.mat
Text Files (*.txt)|*.txt
Excel Files (*.xls)|*.xls
and I select to save as *.xls and write as filename "Hello" in, I get on the 64-bit machine the error:
The file name is invalid"
When I change the order of the box array *.xls will go but the new last element will produce this error.
So, can someone help me?
P.S. I'm using Win 7 64bit with labview 9 32bit. exe tested on win7 64 bit and win xp 32 bit.
can you pleas attach the SaveAsType.vi?
I'm unable to find it "somewhere in the forum"
find attached the SaveAsType.vi!
So when you build the exe and call it in win 7 64bit it will work for all extensions fine expect for the last one in the list: "Calibration Files".
I testet it here on Win 64bit but the ActiveX control is not supportet and so the Common Dialog Class not found.
I tried to register the comdlg32.ocx but this did also not work.
Which ocx are you using? Are you able to register it?
Can you attach it?
On which Windows 64-bit System have you test it? XP, Vista or 7?
I haven't registered anything additional - it works with the standard setting from my Win7 installation. It's Win7 Professional. Could it be possible that it is working only with the professional version?
My comdlg32.ocx file from C:\Windows\SysWOW64 is attached.
comdlg32.ocx will be installed when you install the full version of LabView Runtime engine. It's in the Datasocket package.
I use the Library: "Microsoft Common Dialog Control 6.0 Version 1.2" and from there the object "CommonDialog (MSComDlg.CommonDialog.1)".
The last days it works fine, but now when I directly select the class I also get an error "97".
But my posted VI is still runing.
Here is one more example: http://zone.ni.com/devzone/cda/epd/p/id/818
NOTE: You must have one of the following programs installed to run this example:
Do you have one of them installed?