Microsoft KB Archive/98586

{|
 * width="100%"|

INFO: Using a VBX Control in an AFXDLL Dialog Box

 * }

Q98586

-- The information in this article applies to: - The Microsoft Foundation Classes (MFC) included with: - Microsoft Visual C++ for Windows, versions 1.0 and 1.5 -- SUMMARY ======= An AFXDLL dynamic-link library cannot include a VBX control in one of its dialog box templates (such as those created by AppStudio). When the application that calls the DLL calls the EnableVBX function, it registers the VBControl window class with Microsoft Windows. The VBControl class is registered as a local window class, not as a global window class. A local window class is available only to the module in which the class is registered. Because a DLL has its own module that is different from the calling application, the VBControl class is not available to the DLL. To work around this behavior, the application can call the Create member function of the CVBControl class to create the VBX control. Call Create in the OnInitDialog function (for a modal dialog box) or in the OnCreate function (for a modeless dialog box).

Keywords : kbprogramming kb16bitonly kbMFC kbVBX kbVC

Issue type :

Technology : kbAudDeveloper kbMFC