Marshaler Warnings - Visual Studio

When using Visual Studio to compile some of our samples or your applications, you may receive these warnings:

warning : At least one of the arguments for '_ISftBoxEventsIE.OLEDragDrop' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.

These warning messages can be safely ignored. The interfaces _ISft????EventsIE are only used with the Internet Explorer version of the control (hence the "IE" as part of the interface name). For example, the Internet Explorer version of SftBox/OCX has an interface named ISftBoxEventsIE with the OLEDragDrop event. This definition has a type that requires unsafe code. But the "regular" control, which you would use with .NET, has a similar interface ISftBoxEvents (no trailing IE) with the OLEDragDrop event. This interface uses a type that can be safely marshaled, so no warnings are issued.

Because our OCX files contain multiple controls (the "regular" control and the Internet Explorer version), Visual Studio .NET cannot distinguish between the different controls, blindly assuming they are all used.

Unfortunately, there does not appear to be a mechanism to disable these warnings. Actually, they are not compile warnings, so the final total of warnings and errors does not even reflect these warnings.

The intention of these warnings seems to be to alert you to the fact that you may need to enable unsafe code (in the project settings), otherwise the events won't work. Keep in mind that you are NOT using the Internet Explorer control, so these events are NOT used and you do not have to allow unsafe code for our products.

Affected products are SftBox/OCX, SftDirectory, SftPrintPreview/OCX.