Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: SQL Server
Expertise: Beginner
Mar 18, 1997



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Win 3.x APIs Equivalent in Win 95

I'm trying to migrate an application I created in SQLWindows to Centura and it had some Windows API function calls in USER.EXE. Porting it to Centura, the "Cannot find library or one of its components error appears" so I changed USER.EXE to USER32.DLL and it compiled. Upon running the application, it GPFs in Centura. I have a Introductory Form patterned from the "Special Edition Using Gupta SQLWindows" that has this message handler in the form's message actions section.
	Call SetWindowLong( hWndForm, GWL_STYLE, 
			GetWindowLong( hWndForm, GWL_STYLE ) - 
This works fine in SQLWindows. Where are the Windows API Functions now in Windows 95? This might be causing the problem.

Please take a look at the URL www.centurasoft.com/support/tech_info/migwizrd.htm It is a utility, written on the Centura 1.0, which will do a first pass through an outline to try to change the function calls from the 16 bit SDK to the 32 bit SDK. The zip file referenced on the page not only contains the wizard, but also a database, 6.1 format, which maps the 16 to 32 bit function calls, C to Centura datatypes and parameters for each of the function calls. The wizard utilizes the database to build a mapping of the existing functions to call the correct 32 bit functions. The approach was not to change many lines of code, but to define a global function which in turn will call the external function. I should note the wizard is compiled with Centura 1.0 and will not run with Centura 1.1. I am waiting for the 1.1 version of the CDK to update the executable.

One of the reasons you may be getting the GPF may be that SetWindowLong is no longer a function in the 32 bit SDK, but a macro which can not be called directly. My guess is the export ordinal you have defined for it, changed and you are not calling the correct function. It would be best to set the ordinal to 0 and let Centura do a name search on the function. You should get an error which states the function is not defined. Typically the 16 bit functions now have an 'A' or 'W' appended to the name to signify Unicode platform. In the example you have provided, the function call would be SetWindowsLongA (... ).

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date