PRB: Plug-in Fails to Load in Internet Explorer If It Is Compiled with UNICODE Flag (293100)
The information in this article applies to:
- Microsoft Internet Explorer (Programming) 5.5
This article was previously published under Q293100 SYMPTOMS
When you use the Netscape Plug-in Software Development Kit (SDK) to implement a plug-in, if you compile the plug-in with the _UNICODE flag for globalization purposes, you receive the following error message in Internet Explorer:
An error occurred in this plugin.
This problem does not occur when you compile the plug-in normally (or with the _MBCS flag).
CAUSE
The sample plug-in code that Netscape provides does not use the CallWindowProc function to call the default WNDPROC for the plug-in window; the sample code just calls the function pointer that the SetWindowLong function returns directly. This causes an exception (which Internet Explorer handles) because, in a Unicode build, SetWindowLong does not return a function pointer but returns a special handle that CallWindowProc translates into a WNDPROC address.
This is a bug in the Netscape Plug-in SDK sample code.
RESOLUTION
The following code is incorrect in the Plug-in WNDPROC code:
This->fDefaultWindowProc(hWnd, Msg, wParam, lParam);
To resolve this problem, modify the code as follows:
CallWindowProc(This->fDefaultWindowProc, hWnd, Msg, wParam, lParam);
This problem may not apply to all versions of the samples from Netscape. Because the sample is from a third-party Web site, it may change, and you may encounter problems that this article does not resolve. The sample inside winNPSDK.zip (2.25MB, last modified October 21, 1997) does not exhibit this problem.
Modification Type: | Major | Last Reviewed: | 11/5/2003 |
---|
Keywords: | kbprb KB293100 |
---|
|