thunking from 16bit to 32bit dll

This is a discussion on thunking from 16bit to 32bit dll within the Windows Programming forums, part of the Platform Specific Boards category; Hello, I have an old application which is windows 3.1 based. Therefore the application is 16bits and is build in ...

  1. #1
    Registered User
    Join Date
    Feb 2012
    Location
    Netherlands
    Posts
    3

    thunking from 16bit to 32bit dll

    Hello, I have an old application which is windows 3.1 based. Therefore the application is 16bits and is build in plain C. The frontend-part of the application cannot be changed (in terms of rebuild or redesign), but the backend must change. This new backend is a 32bit application. The documentation on thunking is very minimal. It allready costs me a lot of time just to gather the tools needed.
    Has anyone a working sample for me.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,497
    > It allready costs me a lot of time just to gather the tools needed.
    And how much more is it likely to cost before rewriting the front-end seems like a good idea?

    Win3.1 is only a few years LESS obsolete than DOS.

    Q1: How many bugs does your Win3.1 app have that no one dare fix because the toolchain is all broken.
    Q2: How many features do you wish you had, but no one dare add because the toolchain is all broken.

    Are you going to be running this "edifice" on a true win32 operating system (with the Win3.1 fossil running in a VM) or are you going to be using Win3.1 and something like the Win32s kludge to take care of the new 32-bit module?

    Also, can you explain why you "must" do one thing and "cannot" do the other?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Feb 2012
    Location
    Netherlands
    Posts
    3
    In fact the frontend is a very old legacy tool written in ObjectView, with lots and lots of functionality. As it works now, it prepairs and builds up calls to the 16bit dll. This dll then calls the bespoke "backend"-dll to do the arithmetic. Long before my time, there has been an upgrade to a 32bits environment. So yes, it is all running on win32.
    The backend is changed, because the customer will use standard-software to do the calculations. The frontend will be replaced in the next few years. It will be replaced by a completely new to build bespoke application. Till then the old front-end stays in place. A thunk as an interface will be a way to overcome these years.

  4. #4
    Registered User ledow's Avatar
    Join Date
    Dec 2011
    Posts
    435
    Seems the MS article on it assumes you use their tools, but the only vaguely-useful reference I can find is this:

    How To Call 32-bit Code from 16-bit Code Under Windows 95, Windows 98, or Windows Millennium Edition

    You have to ask yourself - how many hours it will be before you give up and just say that the whole thing has to be rewritten. If you can't find documentation on what you want to do, chances are that NOBODY has done this in a seriously long time.

    - Compiler warnings are like "Bridge Out Ahead" warnings. DON'T just ignore them.
    - A compiler error is something SO stupid that the compiler genuinely can't carry on with its job. A compiler warning is the compiler saying "Well, that's bloody stupid but if you WANT to ignore me..." and carrying on.
    - The best debugging tool in the world is a bunch of printf()'s for everything important around the bits you think might be wrong.

  5. #5
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,239
    Suggesting a rewrite of what sounds like a large working system is maybe a bit much to ask of one developer.

    This link may be more helpful: Calling 32-bit Code From 16-bit Apps
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  6. #6
    Registered User
    Join Date
    Feb 2012
    Location
    Netherlands
    Posts
    3
    Yes, I have seen that link while searching for a solution. I think I have to go on trial and error. Thanks for the suggestions

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 04-14-2010, 07:00 AM
  2. Return 16bit structure or 16bit word?
    By nenpa8lo in forum C Programming
    Replies: 7
    Last Post: 06-25-2009, 05:16 PM
  3. 16Bit and Signed Charactors?
    By Zoiked in forum C++ Programming
    Replies: 7
    Last Post: 08-27-2007, 10:21 AM
  4. 32bit 16bit compilers
    By Benzakhar in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 03-02-2004, 03:43 PM
  5. 32bit -> 16bit color problems
    By Hubas in forum Windows Programming
    Replies: 2
    Last Post: 03-30-2003, 09:14 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21