Originally posted by joerghamster
I'm using the freeimage libary to open CMYK TIFF files. It works fine if the files i want to open are for shure CMYK files but if not the Programm runs in an error

"User Breakpoint called from code at 0x7789180c"

So how can i catch this error and tell the User that hi had chosen an wrong file format.

My first thought was an try catch block, but to catch something i have to throw it but cause it isn't my own function i coulndt throw anything.
Since this is not your own function that is opening the (possible) .tiff file, what documentation is there for this specific function? Does it specify what return values you can expect from it when it's called? Is the program exiting while inside this function or does it come back to your code and then cause an error somewhere?

If it doesn't have a return value to indicate it was successful, you may want to write a "pre-function" function to look at the header. If the "pre-function" indicates that the header is not valid, you would then tell the user the file isn't a valid .tiff and not call the provided function.

Hope this helps!

-jEssYcAt