The information in this article applies to:
SYMPTOMSThe MFC Control Panel applet displays the ODBC icon on the Control Panel with the functionality of the ODBC data source setup Control Panel applet. The NTCPLAPP MSDN sample exhibits this behavior. CAUSEThe applet entry-point function, CPlApplet(), exported by the MFC control applet, is resolved to the function exported from ODBCCP32.LIB rather than the function exported from the project. RESOLUTION
If you are not using any of the functions exported by ODBCCP32.LIB, then
select the Input category in the Project Settings for the linker, and
specify "odbccp32.lib" in the "ignore libraries" field. This is equivalent
to adding /nodefaultlib:"odbccp32.lib" in the linker command line.
These lines are the linker dependency and command line. Each target has
these lines. Modify the last line as follows:
This ensures that functions exported by the ODBCCP32.LIB file are searched
last while linking. The CPlApplet is resolved to the one in your code
because the .OBJ files are searched prior to the import libraries. If there
are multiple targets, the modification needs to be made for all the
targets.
STATUSThis behavior is by design. MORE INFORMATION
Every Control Panel application must export the standard entry-point
function CPlApplet that is called by Control Panel in various situations.
When you include AFXDB.H in your project, MFC pulls in the ODBCCP32.LIB
file through a #pragma comment(). This is the import library for the ODBC
installation DLL that also exports CPlApplet. The linker resolves the
CPlApplet function from the ODBCCP32.LIB rather than from your object
files. Since CPlApplet resolves to the one in ODBCCP32.LIB, your Control
Panel applet acts as another ODBC Control Panel applet. REFERENCESVisual C++ Books Online and the Windows SDK documentation. Additional query words: 4.00 4.10 ODBCCP32 NTSERVCTRL
Keywords : kbnokeyword kbMFC kbVC |
Last Reviewed: July 30, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |