Board index » cppbuilder » BC 4.52 to BCB4 (16Bit Win to 32 Bit win)

BC 4.52 to BCB4 (16Bit Win to 32 Bit win)

Hi,

I must convert my project from the 16bit to 32 bit.

At first:

So I convert the ide with IDETOBPR in a bpr file and change a little
things(comment it off).

But at linking I get the error "c0wl.obj" , "import.lib" and "crtdll.lib"
not found
I replaced this 16bit libs with "c0w32.obj", import32.lib
But then I get the error
"Unresolved external '__setargv__' referenced from root" and "Unresolved
external '__turboFloat__' referenced from root"
Has everyone an idea what are the rigth libs?

2.) I create a new win32 application and included all cpp,h and res -files;
And replace the WinMain with the old 16bit Version.

But then the function
int DialogBox(
HINSTANCE hInstance, // handle to application instance
LPCTSTR lpTemplate, // identifies dialog box template
HWND hWndParent, // handle to owner window
DLGPROC lpDialogFunc // pointer to dialog box procedure
);
get crazy!

the 4th parameter is the init. function for the box
the help of BCB says this function must have this form:

BOOL CALLBACK DialogProc(
HWND hwndDlg, // handle to dialog box
UINT uMsg, // message
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);

but the compiler mean this: BOOL CALLBACK DialogProc();
but this is a little bit senseless

And the best is: in the convertet(see above) 16bit version it works!

The error is: convert from int (__stdcall *)( void*, unsigned int, unsigned
int,long ) to int (__stdcall *)( ) impossibly

Can everyone help ME??

Thank you,
 Fred

PS: this are the header from the 16bit version:

#include <windows.h>
#include <bwcc.h>

//dos header
#include <stdio.h>
#include <mem.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <fcntl.h>
#include <io.h>
#include <sys\stat.h>
#include <dos.h>

 

Re:BC 4.52 to BCB4 (16Bit Win to 32 Bit win)


Quote
"Rainer Beuth" <rainer.be...@von-berg-medizingeraete.de> wrote in message

news:3d186981_2@dnews...

Quote
> Hi,

> I must convert my project from the 16bit to 32 bit.

> At first:

> So I convert the ide with IDETOBPR in a bpr file and change a little
> things(comment it off).

> But at linking I get the error "c0wl.obj" , "import.lib" and "crtdll.lib"
> not found
> I replaced this 16bit libs with "c0w32.obj", import32.lib
> But then I get the error
> "Unresolved external '__setargv__' referenced from root" and "Unresolved
> external '__turboFloat__' referenced from root"
> Has everyone an idea what are the rigth libs?

> 2.) I create a new win32 application and included all cpp,h and
res -files;
> And replace the WinMain with the old 16bit Version.

> But then the function
> int DialogBox(
> HINSTANCE hInstance, // handle to application instance
> LPCTSTR lpTemplate, // identifies dialog box template
> HWND hWndParent, // handle to owner window
> DLGPROC lpDialogFunc // pointer to dialog box procedure
> );
> get crazy!

> the 4th parameter is the init. function for the box
> the help of BCB says this function must have this form:

> BOOL CALLBACK DialogProc(
> HWND hwndDlg, // handle to dialog box
> UINT uMsg, // message
> WPARAM wParam, // first message parameter
> LPARAM lParam // second message parameter
> );

> but the compiler mean this: BOOL CALLBACK DialogProc();
> but this is a little bit senseless

> And the best is: in the convertet(see above) 16bit version it works!

> The error is: convert from int (__stdcall *)( void*, unsigned int,
unsigned
> int,long ) to int (__stdcall *)( ) impossibly

One problem with your code is that Microsoft tightened up many function
prototypes in Win32. This means that your code may not compile under Win32.
In order to convert to Win32, I would suggest doing the following:

16-bit code:

1. Ensure that all callback procedures are defined as CALLBACK with the
appropriate signatures.
2. Ensure that all handles are of the appropriate type for the function that
you are calling. Don't pass a generic HANDLE to a function that expects a
HDC, and don't mix handle types!
3. Define STRICT in your 16-bit code, compile it with BC 4.52, and correct
any problems. Ensure that the program runs properly.
4. Replace obsolete functions with their more modern equivalents added in
Windows 3.1.
5. Replace calls to Escape() with calls to the appropriate functions.
6. Use the message crackers provided in <windowsx.h> to disassemble
messages!

32-bit code:

1. Remove all calls to MakeProcInstance() and FreeProcInstance(). Use the
function's address wherever the proc. instance was used.
2. Convert 'far' and 'near' pointers to plain old pointers.
3. Replace calls to local and global memory management (e.g. LocaAlloc() and
GlobalAlloc()) with calls to the Heap...() or Virtual...() memory management
APIs.
4. Replace calls to any C/C++ 'near' and 'far' memory management functions
with calls to the standard memory management functions.
5. Examine your logic for any size-related issues. Pay specific attention to
'int' and pointer declarations - they are 32 bits now, which affects
structure sizes, etc.

You should now have a working 32-bit program.

HTH
Daniel Pfeffer

Other Threads