HELP: porting 16 bit mfc program to 32 bit (mfc v5) 
Author Message
 HELP: porting 16 bit mfc program to 32 bit (mfc v5)

I have come across a problem porting my software to MFC v5 from an earlier
16 bit version.
The problem involves the following lines which dynamically subclass my own
edit box (which has user defined characteristics) to the edit box of a
combo box.

'pInputCombo' is a pointer to the combo box, and m_Edit is the edit box to
be subclassed.

Here is the code:

POINT tmpPoint = {1,1};
m_Edit.SubclassWindow(pInputCombo->ChildWindowFromPoint(tmpPoint)->GetSafeHw
nd());

This works perfectly in the 16 bit version, but in the 32 bit version I
have traced the problem to this code in Wincore.cpp:

////////////////////////////////////////////////////////////////////////////
/
// Extra CWnd support for dynamic subclassing of controls

BOOL CWnd::SubclassWindow(HWND hWnd)
{
        if (!Attach(hWnd)) <<<<<<<<<<============= PROBLEM HERE
                return FALSE;

The 'Attach()' function is called, like this:

BOOL CWnd::Attach(HWND hWndNew)
{
        ASSERT(m_hWnd == NULL);     // only attach once, detach on destroy
        ASSERT(FromHandlePermanent(hWndNew) == NULL); <<<==== PROBLEM HERE
                // must not already be in permanent map

In the 16 bit version, 'FromHandlePermanent' returns NULL, but not in the
32 bit version.

Any ideas???????
(If not I suppose Mr Gates will just have to get a bit richer.)

B.V.



Fri, 01 Dec 2000 03:00:00 GMT  
 HELP: porting 16 bit mfc program to 32 bit (mfc v5)



Quote:
> I have come across a problem porting my software to mfc v5 from an
earlier
> 16 bit version.

Figured it out!! Forget it!


Sun, 03 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. help porting 16 bit to 32 bit (partly assembly) application

2. Building 16 bit dll for my mfc 32 bit application for win 95

3. porting 16-bit int to 32-bit int with asm code

4. Porting 16-bit to 32-bit code and the use of the LOWORD and HIWORD macros

5. Q: How to port a 16-bit application to 32-bit

6. Porting from 16-bit to 32-bit

7. Porting 16 bit code to 32 bit : Resource file with RCDATA

8. porting __segment from 16-bit DLL to 32-bit

9. Porting 16-bit to 32-bit

10. Porting 16-bit app to 32-bit

11. Porting code from 16-bit to 32-bit compiler

12. Porting from 16-bit to 32-bit

 

 
Powered by phpBB® Forum Software