ID: Q117777
1.00 1.50 WINDOWS kbprg
The information in this article applies to:
- Microsoft Visual C++ for Windows, versions 1.0 and 1.5
The MFC class library provides support for using VBX controls in a 16-bit Windows-based application. You can call CWinApp::EnableVBX to enable use of VBX controls. You can also determine whether VBX support has been enabled in an MFC program as it is running. This article presents two possible methods of determining whether VBX support has been enabled in applications on MFC, versions 2.0 and 2.5.
NOTE: Both of these methods rely on the use of implementation-specific details of MFC, versions 2.0 and 2.5. The techniques presented here are not guaranteed to function correctly in future versions of MFC.
Use one of the following methods to determine whether VBX support has been loaded:
BOOL IsVBXEnabled()
{
WNDCLASS ClsInfo;
memset(&ClsInfo,0,sizeof(WNDCLASS));
return ::GetClassInfo(AfxGetInstanceHandle(),"VBControl",
&ClsInfo);
}
-or-
BOOL CMyApp::IsVBXEnabled()
{
return m_lpfnCleanupVBXFiles != NULL;
}
This function can be called in any part of your program by including
the header file for your CWinApp-derived class and using the following:
((CMyApp*)AfxGetApp())->IsVBXEnabled();
Last Reviewed: July 23, 1997