Help and Support
 

powered byLive Search

How To Speed Up Load Time of OLE Controls

Retired KB ArticleThis article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Article ID:148617
Last Review:November 21, 2006
Revision:2.2
This article was previously published under Q148617

SUMMARY

When bringing up a dialog template that contains one or more OLE Controls, the delay can be significant depending on the speed of the computer. You can use the AfxOleLockControl() function to speed up the loading of the dialog by preloading the control in the application.

Back to the top

MORE INFORMATION

You can load the OLE Control into the address space of the executable at any time by using the AfxOleLockControl() function. There are two versions of this function, one that takes a class id (CLSID) and one that takes a program id (ProgID).

You can unload the control at any time by calling AfxOleUnlockControl() or AfxOleUnlockAllControls(). There are two versions of AfxOleUnlockControl(), one takes a class id and the other taking a program id.

If a splash screen is used by the application, that might be a good time to load the controls. It can be done at any point after the call to AfxEnableControlContainer() in the CWinApp::InitInstance(), and the loaded controls can then be unloaded at any time.

Back to the top

REFERENCES

These functions were not documented in Visual C++ 4.0 Help. You can find the source code for these functions in Occlock.cpp in the \Msdev\Mfc\Src subdirectory.

Back to the top


APPLIES TO
Microsoft Foundation Class Library 4.2, when used with:
  Microsoft Visual C++ 4.0 Standard Edition

Back to the top

Keywords: 
kbarchitecture kbctrlcreate kbhowto kbprogramming KB148617

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by E-mail, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.