Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#5525 closed defect (fixed)

Error message box pops up when loading drivers

Reported by: alon Owned by: warmerdam
Priority: normal Milestone: 1.11.1
Component: default Version: unspecified
Severity: normal Keywords:


this is a windows only. when loading the ogr_oci.dll driver that depends oci.dll library I get an error saying:

The program can't start because OCI.dll is missing from your computer. Try reinstalling the program to fix this problem.

the error does exist in 1.11.0 the error did not exist on 1.9.2

suggested fix: in source file port/cplgetsymbol.cpp in function CPLGetSymbol in one of the recent releases someone added a call to SetErrorMode?(SEM_NOOPENFILEERRORBOX); to prevent error boxes. however, in my case ogr_oci.dll depends on oci.dll. so this is a system error.

the default windows error mode is: ( when a program starts up) NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS

option 1: (I prefer this) use SetErrorMode?( NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS ); option 2: use SetErrorMode?( NOOPENFILEERRORBOX | GetErrorMode?());

Change History (6)

comment:1 Changed 7 years ago by Even Rouault

Indeed there was a change due to #5211 and the code inspired from . So if I understand well adding SEM_FAILCRITICALERRORS is necessaary when there's a dependency problem ?

I'm not sure about what you meant by "the error does exist in 1.11.0 the error did not exist on 1.9.2". The change in 1.11 is an attempt of suppressiong error dialog boxes (that may have been insufficient), but it shouldn't cause more issues to plugin loading when everything is correctly setup.

comment:2 Changed 7 years ago by alon

from what I tested, SEM_FAILCRITICALERRORS should be added to suppress dependency problems. I did not write in the bug description, but the caption of the message box I got was: <my_executable> - System Error

I understand this was a attempt to fix. in my case, it caused a severe problem.

the comment in the code says bug 5122 but the bug was actually 5211. so please fix thi as well.

comment:3 Changed 7 years ago by Even Rouault

Sorry for my good understanding, could explain more clearly what your problem is ? I'm a bit confused by your above explanations.

If you have ogr_oci.dll, and oci.dll is in your PATH, does it work with 1.11 ? Or is it only if oci.dll which is missing that there's an issue. And what is the issue : the program terminates with a console message, or there is a dialog box ?

comment:4 Changed 7 years ago by alon


sorry for the confusion.

the problem is when I have gdal.dll and ogr_oci.dll in the directory of my application, but oci.dll is not (you must have oracle client installed, not just one dll file) in this case I see the message box, and the application works as normal (unless you try to use oracle)

if oracle client is installed, there is no problem.

comment:5 Changed 7 years ago by Even Rouault

Priority: highnormal
Resolution: fixed
Severity: criticalnormal
Status: newclosed

ok thanks for the explanation. So the situation after #5211 wasn't worse than before. The fix just didn't work

trunk r27460, branches/1.11 r27461 "Windows plugin: complementary fix to #5211 to avoid error dialog box when there are dependency problems (#5525)"

comment:6 Changed 7 years ago by alon


it may or may not be worse than before: If the error mode was set to NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS ( 0x8001) than the original fix made the situation worse. for the documentation I learn that this is not the default, but I did not set it myself, and the error code of my program was 0x8001.

if the error code was 0, the original code did not made the situation worse.

many thanks for the quick fix!!

Note: See TracTickets for help on using tickets.