月份:三月 2007

Force Unload DLL

Posted on Updated on

Sympton:
After calling Freelibrary, the dll not unloaded by window immediatly.
Root Cause:
Because Windows Explorer cache DLLs in memory for a period of time.
Solution:
Add a new registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AlwaysUnloadDLL], set the default value to “1″ with type REG_SZ.

廣告

CString to char and BTSTR to char *

Posted on

Reference

  • CString and char *
  • How to get IWebBrowser2 from IHTMLDocuemnt interface

    Posted on Updated on

    assume you have an IHTMLDocument2 pointer spDoc2 already, then:

    CComPtr<IWebBrowser2> pWeb2 = NULL;
    CComQIPtr<IServiceProvider> isp = spDoc2;
    if ( isp != NULL)
        hr = isp->QueryService(IID_IWebBrowserApp,
            IID_IWebBrowser2,
            (void**)&pWeb2);

    受保護的文章:Hook IE mouse event

    Posted on Updated on

    該內容受密碼保護。如欲檢視請在下方輸入你的密碼:

    debugging information corrupt;

    Posted on

    Sympton:
    compile codes in VC6 debug mode, and platform SDK:

    uuid.lib(unknwn_i.obj) : fatal error LNK1103: debugging information corrupt; recompile module

    Root cause:
    uuid.lib debug version is build by VC7, but VC6 can’t get the debug information in it.

    Solution:
    1. change VC7
    2. backup Platform SDK’s uuid.lib, use VC98’s one.

    link error: IID_IHTMLDocument3

    Posted on

    When building the codes by VC6:

    CComPtr <IHTMLDocument3> spDoc3 ;
    hr = spDoc->QueryInterface( IID_IHTMLDocument3,(void**)&spDoc3);
    if ( FAILED(hr) ) return ;

    the error message appears:

    error LNK2001: unresolved external symbol _IID_IHTMLDocument3
    ..\Debug/abcd.dll : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

    Rootcause:
    wrong uuid.lib
    Solution:
    1. use Platform SDK and include the Platform SDK’s lib directory to the first lib search list.
    2. use VC7 or above.

    Can’t find DISPID_HTMLxxxxxxxxx_xxxxxx

    Posted on

    Sympton:
    error C2065: ‘DISPID_HTMLDOCUMENTEVENTS2_ONCLICK’ : undeclared identifier
    Solution:
    #include