[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

16- vs 32-bit Winsocks

I'm writing an Internet card game (16-bit in C) that can also be played "standalone," so I'm using LoadLibrary to load Winsock.dll.  To be sure I load the correct Winsock, I use GetModuleHandle and GetModuleFileName.  However, when I connect to the Internet using America Online for Win95 (32-bit), my app cannot find the Winsock.

Can my 16-bit app connect via a 32-bit Winsock?  If so, how do I find and hook into it?  (Or is this just an AOL thing?)  If not, what will I need to do to hook into the user's Winsock (besides doing a 32-bit build of my app)?

In short, how can I be certain to always find and connect through any user's Winsock, yet maintain the game's ability to be played by non-internet users?

Thanks!

Terry
0
sixstring
Asked:
sixstring
  • 2
1 Solution
 
chensuCommented:
Generic Thunks allow a 16-bit Windows-based application to load and call a Win32-based DLL on Windows NT and Windows 95. See MSDN or Visual C++ 32-bit Version documentations for more information.

The following generic thunking functions can be called by 16-bit Windows-based applications.
CallProc32W
CallProcEx32W
FreeLibrary32W
GetProcAddress32W
GetVDMPointer32W
LoadLibraryEx32W

0
 
sixstringAuthor Commented:
Chensu,

But how do I determine if they even have a Winsock loaded and which one it is?  

For example, I have multiple ISPs, plus AOL (16 and 32 bit) and Compuserve.  When I load a 16-bit Winsock, it shows up in the process list.  AOL32's does not.  How do I determine that AOL (or Dial-up Networking) is loaded and where its Winsock resides (since AOL's Winsock is not in the PATH, and GetModuleHandle can't find it)?

Thanks.
0
 
chensuCommented:
You can use Remote Access Service function RasEnumConnections to determine if Dial-up Networking is loaded. But for AOL or Compuserve, I am not sure if there is a standard way to do so. You have to search the directories for AOL's Winsock probably.
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.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now