
Calling 32-bit DLLs from 16-bit-Applications
Quote:
> my problem is following:
> I must use a 32bit-DLL from Visual Basic 3.0 (a 16bit-application)
> under WfW (the DLL also runs with Win32s) and Win95.
[snip]
Quote:
> ) Writing a 32bit-OLE-Server? (I could use VC++ 4.0)
This is probably your easiest way to get things done. Write the OLE
server with automation exports, and call the automation calls in the
16-bit application. The advantage here is that the OLE libraries will
automatically "marshall" the calls across 16- and 32-bit, regardless
of the operating system in use.
Thunking is also an option, but it's specific to the operating system,
so Win32s thunking would _only_ work under WfW. For what it's worth,
though, the Win32s thunking is extremely easy to do.
See the Win32s documentation for information on thunking.
Quote:
> Is it true, that OLE-container and OLE-server can be written
> for different APIs (16,32bit)?
OLE will automatically marshall across the bit boundary, as long as
both are executables. In-process servers (DLLs) do not have the benefit
of the automatic marshalling.
--
class CBradWilson : public CWorldWatchProgrammingTeam {
public:
void GetE164Addr ( CString& s ) { s = "+1 (810) 620-9803"; }
void GetURL ( CString& s ) { s = "http://www.exptech.com"; }
void GetDisclaimer( CString& s ) { s = "All I say is fact :-p"; }
Quote:
};
// QOTW: "Don't think of yourself as the least intelligent creature in this
// room ... if you consider the entire planet, you're smarter than
// literally hundreds of people." - Dogbert to Dilbert