VC++ to Visual.NET

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi everybody.

While migrating from VC6.0 to .NET I had been getting many
compilation errors. Some are easy enough to code and
change. But some are not. These are a few of those
examples.

My project when compiled with .NET7.0 gives a
"application folder..: error
C2664: 'CWnd::OnActivateApp' : cannot convert parameter 2
from 'HTASK' to 'DWORD'"

Has OnActivateApp parameters changed in 7.0? If so what do
i need to do in order to eliminate this?

Thanks a lot, i would really appreciate if someone is able
to help me.
 
Mike said:
Hi everybody.

While migrating from VC6.0 to .NET I had been getting many
compilation errors. Some are easy enough to code and
change. But some are not. These are a few of those
examples.

My project when compiled with .NET7.0 gives a
"application folder..: error
C2664: 'CWnd::OnActivateApp' : cannot convert parameter 2
from 'HTASK' to 'DWORD'"

Has OnActivateApp parameters changed in 7.0?

Seemingly so. From the MFC42 documentation...

http://msdn.microsoft.com/library/d...vcmfc98/html/_mfc_cwnd.3a3a.onactivateapp.asp

....to the MFC7 documentation...

http://msdn.microsoft.com/library/d...s/vclib/html/_mfc_cwnd.3a3a.onactivateapp.asp

....the move from HTASK to DWORD seems to conform to the WM_ACTIVATEAPP
documentation...

http://msdn.microsoft.com/library/d...owreference/windowmessages/wm_activateapp.asp

....and I could well be wrong, but I can't recall seeing or using an HTASK
since the days of 16bit Windows.
 
I recall a lot of problem when we moved from 6.0 to 7.0 with MFC message map code. All of it was due to our code using functions with different (wrong) prototypes then what the message map functions required. It seems MFC and/or the compiler now type checks these things better.

This was a good thing since this was often the source of mysterious release-mode-only type crashes.
 
Hi Jeff,
Thank you very much.
Yes you are right. This might be the problem. But do you
know of any methos to change the code to be compatible
with the latest MFC headers...or do we have to do it with
our hand-code?
I know that VB.NET has a conversion tool that gives
commented lines to tell us what we need to change. Do we
have anything like that in VC.NET!
Thanks.

Mike.
-----Original Message-----
Hi everybody.

While migrating from VC6.0 to .NET I had been getting many
compilation errors. Some are easy enough to code and
change. But some are not. These are a few of those
examples.

My project when compiled with .NET7.0 gives a
"application folder..: error
C2664: 'CWnd::OnActivateApp' : cannot convert parameter 2
from 'HTASK' to 'DWORD'"

Has OnActivateApp parameters changed in 7.0?

Seemingly so. From the MFC42 documentation...

http://msdn.microsoft.com/library/default.asp? url=/library/en-
us/vcmfc98/html/_mfc_cwnd.3a3a.onactivateapp.asp

....to the MFC7 documentation...

http://msdn.microsoft.com/library/default.asp? url=/library/en-
us/vclib/html/_mfc_cwnd.3a3a.onactivateapp.asp

....the move from HTASK to DWORD seems to conform to the WM_ACTIVATEAPP
url=/library/en-
us/winui/winui/windowsuserinterface/windowing/windows/windo
wreference/windowmessages/wm_activateapp.asp

....and I could well be wrong, but I can't recall seeing or using an HTASK
since the days of 16bit Windows.

--
Jeff Partch [VC++ MVP]



.
 
The changes are very minimal though. It's basically some message crackers
and some Create/CreateEx methods that changed

Mike said:
Hi Jeff,
Thank you very much.
Yes you are right. This might be the problem. But do you
know of any methos to change the code to be compatible
with the latest MFC headers...or do we have to do it with
our hand-code?
I know that VB.NET has a conversion tool that gives
commented lines to tell us what we need to change. Do we
have anything like that in VC.NET!
Thanks.

Mike.
-----Original Message-----
Hi everybody.

While migrating from VC6.0 to .NET I had been getting many
compilation errors. Some are easy enough to code and
change. But some are not. These are a few of those
examples.

My project when compiled with .NET7.0 gives a
"application folder..: error
C2664: 'CWnd::OnActivateApp' : cannot convert parameter 2
from 'HTASK' to 'DWORD'"

Has OnActivateApp parameters changed in 7.0?

Seemingly so. From the MFC42 documentation...

http://msdn.microsoft.com/library/default.asp? url=/library/en-
us/vcmfc98/html/_mfc_cwnd.3a3a.onactivateapp.asp

....to the MFC7 documentation...

http://msdn.microsoft.com/library/default.asp? url=/library/en-
us/vclib/html/_mfc_cwnd.3a3a.onactivateapp.asp

....the move from HTASK to DWORD seems to conform to the WM_ACTIVATEAPP
url=/library/en-
us/winui/winui/windowsuserinterface/windowing/windows/windo
wreference/windowmessages/wm_activateapp.asp

....and I could well be wrong, but I can't recall seeing or using an HTASK
since the days of 16bit Windows.

--
Jeff Partch [VC++ MVP]



.
 
Back
Top