02-29-2012 10:27 AM
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
02-29-2012 11:56 PM
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.