views:

108

answers:

1

I'm working with SQL Native Client 9 in a C++ application that communicates with SQL Server 2000. I'm working on debugging things right now but something I've noticed that bothers me (mostly because it's creating significant clutter) is that sqlnclir.rll is being loaded and unloaded continuously and the following lines are being spammed to my debug output window.

'my_app.exe': Loaded 'C:\WINDOWS\system32\sqlnclir.rll', Binary was not built with debug information.
The thread 'Win32 Thread' (0x9f4) has exited with code 0 (0x0).
'my_app.exe': Unloaded 'C:\WINDOWS\system32\sqlnclir.rll'

The ID after "Win32 Thread" changes but the exit code is always 0.

Why is the .rll is being loaded and unloaded constantly like this and how can I prevent it from happening?

If the above isn't a feasible question to answer, how can I prevent the messages above from being spammed to the Debug Output window in MSVC 2005? Ideally, only for that particular set of messages?

+1  A: 

Typically this is due to the application (or in this case, a linked library) dynamically loading and unloading via LoadLibrary[Ex] etc. It is probably also creating/destroying a thread in the process.

I don't know of any way to suppress individual debug output messages. You may be able to prevent the specific repeated load/unload by loading the library yourself and holding a handle to it for the duration of the calls (which should prevent the OS from unloading it). However, this is not a good general solution (for example, the library might be [poorly] coded to rely on the DLL being uninitialized between each call, in which case the workaround might alter the behavior).

At a higher level, keeping a connection open to the database might accomplish the same thing, but that's dependent on the implementation of the SQL native client library. That's what I would probably try, though (or just ignore the debug trace output).

Nick