LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DisplayImageFile does not work properly within a DLL

Hello,

 

I am developing an application that loads come pictures into a picture control using the DisplayImageFile. I have the pics within the same folder than the executable and the DLL and I would like to use relative paths.

 

When i compile my project as exe, is working fine and the pictures are loaded correctly. however, when I copile it as a DLL and I call the dll from TestStand, I get an error "file not found"

 

If I change the path to an absolute path, the pictures are displayed again correctly...

 

I tried adding "../Name of the file.jpg" but it does not work. Also adding the path to the Include paths getting the same result...

 

Anybody can help me to find a solution?

 

Thank you very much

0 Kudos
Message 1 of 2
(2,408 Views)

Never tested it in a DLL, but you can try using GetProjectDir to get the application directory and build up an absolute pathname from that.

"..\" prefix instructs the program to go one level upward in the relative path when searching the file so it won't help you since the app appears to have a different current directory from its own one. Possibly calling GetDir can help you unsderstand where the app is looking for for files.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(2,401 Views)