Thread View: comp.os.ms-windows.programmer.win32
17 messages
17 total messages
Started by Wolfgang Steiner
Wed, 31 Jan 1996 14:23
Calling 32-bit DLLs from 16-bit-Applications
Author: Wolfgang Steiner
Date: Wed, 31 Jan 1996 14:23
Date: Wed, 31 Jan 1996 14:23
30 lines
1465 bytes
1465 bytes
Hi, 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. Calling the DLL directly doesn't work. Which possibilities exist to solve this problem? ) Writing an own DLL for conversion between 16bit and 32bit? If yes, from where can I get more information about that? Do such DLL's exist anywhere? ) Writing a 32bit-OLE-Server? (I could use VC++ 4.0) Are there any examples of such servers, that also run under Win32s? Is it true, that OLE-container and OLE-server can be written for different APIs (16,32bit)? ) Any other suggestions? Thanks Wolfgang -------------------------------------------------------------------- Wolfgang Steiner; MA 14 - ADV; Rathausstr.1; A-1082 Vienna; Austria phone: +43-1-4000/98601 fax: +43-1-4000/7141 eMail: stw@adv.magwien.gv.at --------------------------------------------------------------------
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: Mark J. Hogan
Date: Wed, 31 Jan 1996 22:31
Date: Wed, 31 Jan 1996 22:31
12 lines
1014 bytes
1014 bytes
You need the 32 Windows Knowledge Base from Microsoft. ftp://ftp.microsoft.com/Softlib/MSLFiles/WIN32KB.EXE It has information on what you need, "Thunking". You may also want to check previous issues of Microsoft Journal. The Miscrosoft Developer Network CD's have more information along with VB examples and a DLL used to call the 32 bit functions. Hope this helps. Mark
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: Bryce Abbott
Date: Thu, 01 Feb 1996 04:15
Date: Thu, 01 Feb 1996 04:15
3 lines
653 bytes
653 bytes
Try http://198.105.232.5:80/kb/developr/vb/q141939.htm Bryce Abbott
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: Brad Wilson
Date: Thu, 01 Feb 1996 15:33
Date: Thu, 01 Feb 1996 15:33
41 lines
2312 bytes
2312 bytes
Wolfgang Steiner wrote:
> 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]
> ) 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.
> 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 GetInetAddr ( CString& s ) { s = "bradw@exptech.com"; }
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"; }
};
// 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
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: Filipe Custódio
Date: Thu, 01 Feb 1996 15:59
Date: Thu, 01 Feb 1996 15:59
13 lines
1078 bytes
1078 bytes
Wolfgang Steiner wrote: > I must use a 32bit-DLL from Visual Basic 3.0 (a 16bit-application) > under WfW (the DLL also runs with Win32s) and Win95. You must use universal Thunks. However, your program will not run under NT or Win32s. -- --------------------------------------- Filipe Custódio - fmc@novabase.pt ---------------------------------------
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: Wolfgang Steiner
Date: Fri, 02 Feb 1996 06:35
Date: Fri, 02 Feb 1996 06:35
31 lines
1804 bytes
1804 bytes
In article <3110DD3B.455D@exptech.com>, Brad Wilson <bradw@exptech.com> wrote:
>> ) 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.
>
I've tried this way. Under Win95 it works without problems, within
my Visual Basic program I can also start the OLE server with
Set MyObj = CreateObject("MyServer.xyz")
Under WfW it seems that it isn't possible to start a 32bit-OLE server from
a 16bit-application. I got an error message.
After starting the OLE-server from a 32bit-application, the VB3-application
could work together with the OLE-server
Set MyObj = GetObject(,"MyServer.xyz")
Regards
Wolfgang
--------------------------------------------------------------------
Wolfgang Steiner; MA 14 - ADV; Rathausstr.1; A-1082 Vienna; Austria
phone: +43-1-4000/98601
fax: +43-1-4000/7141
eMail: stw@adv.magwien.gv.at
--------------------------------------------------------------------
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: Chris Marriott
Date: Fri, 02 Feb 1996 18:34
Date: Fri, 02 Feb 1996 18:34
25 lines
1674 bytes
1674 bytes
In article <3110E37C.352C@novabase.pt>
fmc@novabase.pt "Filipe Cust=?iso-8859-1?Q?=F3dio" writes:
>Wolfgang Steiner wrote:
>> I must use a 32bit-DLL from Visual Basic 3.0 (a 16bit-application)
>> under WfW (the DLL also runs with Win32s) and Win95.
>
>You must use universal Thunks. However, your program will not run under =
>
>NT or Win32s.
Wrong. Universal thunks are ONLY available on Win32s. What's needed here
are "generic thunks"; these are available under Win95 and NT, but NOT
Win32s.
There is no thunking mechanism which works under all 3 Win32 platforms :-<
Chris
--
--------------------------------------------------------------------------
Chris Marriott, Warrington, UK | Author of SkyMap v3 award-winning
chris@chrism.demon.co.uk | shareware Win31/Win95 planetarium.
For full info, see http://www.execpc.com/~skymap
Author member of Association of Shareware Professionals (ASP)
--------------------------------------------------------------------------
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: dbirdman
Date: Fri, 02 Feb 1996 19:52
Date: Fri, 02 Feb 1996 19:52
31 lines
1660 bytes
1660 bytes
stw@adv.magwien.gv.at (Wolfgang Steiner) wrote: >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. >Calling the DLL directly doesn't work. >Which possibilities exist to solve this problem? >) Writing an own DLL for conversion between 16bit and 32bit? > If yes, from where can I get more information about that? > Do such DLL's exist anywhere? There is a public domain thunking .DLL called CALL32.DLL. I have a copy available from one of my pages: http://www.redshift.com/~arcatpet/vb.html There are also a couple of VB3 program source code samples there that use the .DLL, one for Win95 taskbar tray usage, and another for Win95/NT registry reading/writing. Note that internal documentation for CALL32.DLL says it will only work on NT, but it was written before the WOW in Win95 became compliant with the NT version. No problems experienced with Win95 - haven't tested with Win32s. -- Don Bradner dbirdman@redshift.com author of WWPlus, ImgViewer/16, and BirdData http://www.redshift.com/~arcatpet
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: miklk
Date: Fri, 02 Feb 1996 20:52
Date: Fri, 02 Feb 1996 20:52
3 lines
772 bytes
772 bytes
If you use a 16 bit VB4 written OLE file and read the public properties from a 32 bit VB program, Does that mean that the user of your program will need to have both vb40016.dll and vb40032.dll files?
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: Troy Barlow
Date: Fri, 02 Feb 1996 22:25
Date: Fri, 02 Feb 1996 22:25
9 lines
950 bytes
950 bytes
Filipe Cust=?iso-8859-1?Q?=F3dio ?= wrote: > > You must use universal Thunks. However, your program will not run under > NT or Win32s. > Not true. In fact Universal Thunk only works under Win32s. Under Win 95 he needs to use the thunk compiler to generate thunk code. Under Win NT no thunking is possible.
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: Troy Barlow
Date: Sat, 03 Feb 1996 17:14
Date: Sat, 03 Feb 1996 17:14
23 lines
1683 bytes
1683 bytes
Chris Marriott wrote: > Wrong. Universal thunks are ONLY available on Win32s. What's needed here > are "generic thunks"; these are available under Win95 and NT, but NOT > Win32s. > > There is no thunking mechanism which works under all 3 Win32 platforms :-< > > Chris > -- > -------------------------------------------------------------------------- I just finished a device driver VXD for some non-linear video hardware we made. Under Win32s it uses "Universal Thunks" to thunk from a 32bit dll to a 16bit dll, at this point the 16 bit dll calls directly into the VXD. It's almost the same for Win95, but it uses "Flat Thunks" and a thunk compiler to create the thunk obj files. After MANY calls to Microsofts DDK support, and tons of docs, there is NO WAY to thunk and call a VXD under WinNT. Thunking don't exist in WinNT! If you could prove me wrong I'd be happy! Soon I might have to port the VXD code to WinNT. My understanding is I will have to do some reading on HAL ;-)
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: Kevin Hazzard
Date: Sat, 03 Feb 1996 22:04
Date: Sat, 03 Feb 1996 22:04
11 lines
973 bytes
973 bytes
Chris Marriott wrote: > Wrong. Universal thunks are ONLY available on Win32s. What's needed here > are "generic thunks"; these are available under Win95 and NT, but NOT > Win32s. Chris: Have you found a way to thunk between 16 and 32 bits under NT? -- Kevin
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: Bernie Wieser
Date: Sun, 04 Feb 1996 05:42
Date: Sun, 04 Feb 1996 05:42
11 lines
1000 bytes
1000 bytes
Hopefully thunking will be a thing of the past. Left to philosophers anyway :-) 32bit flat memory models are good, and most tools now support 32bit. (overhead schmoverhead) B. (Actually this brings up a question. How long will 16bit be with us?)
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: Wolfgang Steiner
Date: Tue, 06 Feb 1996 06:19
Date: Tue, 06 Feb 1996 06:19
31 lines
1823 bytes
1823 bytes
In article <4etq1s$7fc@news.wco.com>, dbirdman@tidepool.com wrote: > >There is a public domain thunking .DLL called CALL32.DLL. I have a >copy available from one of my pages: >http://www.redshift.com/~arcatpet/vb.html > >There are also a couple of VB3 program source code samples there that >use the .DLL, one for Win95 taskbar tray usage, and another for >Win95/NT registry reading/writing. Note that internal documentation >for CALL32.DLL says it will only work on NT, but it was written before >the WOW in Win95 became compliant with the NT version. No problems >experienced with Win95 - haven't tested with Win32s. > It works with Win95, but unfortunately it doesn't work with Win32s because Win32s only supports Universal Thunks (and the DLL is using Generic Thunks). Do you know whether there exists a DLL like CALL32.DLL for Win32s? Do you know the EMail address from the author of CALL32.DLL (Peter Golde)? Regards Wolfgang -------------------------------------------------------------------- Wolfgang Steiner; MA 14 - ADV; Rathausstr.1; A-1082 Vienna; Austria phone: +43-1-4000/98601 fax: +43-1-4000/7141 eMail: stw@adv.magwien.gv.at --------------------------------------------------------------------
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: Jerry Coffin
Date: Tue, 06 Feb 1996 20:38
Date: Tue, 06 Feb 1996 20:38
15 lines
1073 bytes
1073 bytes
Troy Barlow <tbarlow@skypoint.com> wrote: >Filipe Cust=?iso-8859-1?Q?=F3dio ?= wrote: >> >> You must use universal Thunks. However, your program will not run under >> NT or Win32s. >> > Not true. In fact Universal Thunk only works under Win32s. Under >Win 95 he needs to use the thunk compiler to generate thunk code. Under >Win NT no thunking is possible. Actually, thunking is possible on NT, but only in one direction: you can call a 32 bit DLL from 16 bit code, but you can't call a 16 bit DLL from 32 bit code.
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: dbirdman
Date: Thu, 08 Feb 1996 20:42
Date: Thu, 08 Feb 1996 20:42
15 lines
1139 bytes
1139 bytes
stw@adv.magwien.gv.at (Wolfgang Steiner) wrote: >Do you know whether there exists a DLL like CALL32.DLL for Win32s? >Do you know the EMail address from the author of CALL32.DLL (Peter Golde)? I have never worked with Win32s, so I haven't specifically looked, but I know I haven't seen any reference to one. Karl Peterson introduced me to Call32, and I recall at one point he said Peter prefers to remain somewhat anonymous. -- Don Bradner dbirdman@redshift.com author of WWPlus, ImgViewer/16, and BirdData http://www.redshift.com/~arcatpet
Re: Calling 32-bit DLLs from 16-bit-Applications
Author: Kevin Cheng
Date: Thu, 08 Feb 1996 21:30
Date: Thu, 08 Feb 1996 21:30
7 lines
935 bytes
935 bytes
>Actually, thunking is possible on NT, but only in one direction: you can >call a 32 bit DLL from 16 bit code, but you can't call a 16 bit DLL from >32 bit code. I've been successfully doing thunking from both direction on NT last year. Kevin
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads