Solved

WinNT and Generic Thunks

Posted on 1997-12-02
3
312 Views
Last Modified: 2013-12-03
I am using Generic Thunks in order to have a 16 bit App use a 32 bit DLL. First, from the 16 bit App I call GetVersion() to verify it is running in a 32 bit OS (Jeff Richter in his book 'Advanced WIndows' claims both Win95 & WinNT are hard coded to return 3.95, pgs 30, 31). Second, I use LoadLibraryEx32W() to load the 32 bit DLL, etc.
This has all been coded and debuged in Win95 and all works as expected. I have recently ported it to WinNT (ver 4.0) and this is where everything breaks down. First of all, the 16 bit GetVersion() call returns 3.1, then the LoadLibraryEx32W() fails (returns NULL).
What is going on here? It appears WinNT is simulating a 16 bit 'Win3.1' enviornment for the 16 bit App. According to all the documentation I have read this should have behaved exactly as in Win95. Also, I cannot find a way to determine why LoadLibraryEx32W() failed because I have not found a 16 bit API equivalent to the Win32 GetLastError() function.

Thanks for any help.
Jeff Reich
0
Comment
Question by:reichj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
alexo earned 150 total points
ID: 1409045
Check articles Q125710 and Q104009 from the MS knowledge base.

0
 

Author Comment

by:reichj
ID: 1409046
Been there, done that.

Actually, forget the Generic Thunks, Do you know why the 16 bit App's GetVersion() function is not returning 3.95 when running under WinNT (it returns 3.1)?

Thanks.

0
 
LVL 11

Expert Comment

by:alexo
ID: 1409047
No.  But you can check the "OS" environment variable.
On NT should be: OS=Windows_NT

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question