PC Review


Reply
Thread Tools Rate Thread

Converting from VS.net 2003 to VS.net 2005

 
 
=?Utf-8?B?QWRpc2ggU29sYW5raQ==?=
Guest
Posts: n/a
 
      11th Jul 2006
We have a MFC win32 desktop application written in Visual C++. We were using
Visula studio 2003 as the editor and everything was compiling, linking and
working fine. Since we want to move to .Net world, we are in process of using
Visual Studio 2005 instead of Visual studio 2003. During the conversion
process we have the following two issues:
1. We have included the afx.h before the afxwin.h in our source code files.
When we compile our code, we get the following ewrror message:

fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll
version) requires MFC shared dll version. Please #define _AFXDLL or do not
use /MD[d] c:\program files\microsoft visual studio
8\vc\atlmfc\include\afx.h 24

As a fix we tried to make a seperate header file afxdlldef.h which said the
following:

#ifndef _AFXDLL
#define _AFXDLL
#endif

If we include this header file in our source code files, it compiles without
any error. But this approach requires changing every source code file to
include this new header file which we don't wish to do. So we would like to
know if there is some other better approach to resolve this problem

2. MSDN help says that defining _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES as 1
will eliminate the warning by changing the strcpy call to strcpy_s. But when
we tried using this, we still get warnings for strcpy.

-Adish
 
Reply With Quote
 
 
 
 
Ted
Guest
Posts: n/a
 
      11th Jul 2006
you also need to define

_CRT_SECURE_NO_DEPRECATE
_CRT_NONSTDC_NO_DEPRECATE

See:

http://msdn2.microsoft.com/en-us/library/8ef0s5kh.aspx

Ted.

"Adish Solanki" <(E-Mail Removed)> wrote in message
news:16152EFA-0C89-4CB2-A5F1-(E-Mail Removed)...
> We have a MFC win32 desktop application written in Visual C++. We were
> using
> Visula studio 2003 as the editor and everything was compiling, linking and
> working fine. Since we want to move to .Net world, we are in process of
> using
> Visual Studio 2005 instead of Visual studio 2003. During the conversion
> process we have the following two issues:
> 1. We have included the afx.h before the afxwin.h in our source code
> files.
> When we compile our code, we get the following ewrror message:
>
> fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll
> version) requires MFC shared dll version. Please #define _AFXDLL or do not
> use /MD[d] c:\program files\microsoft visual studio
> 8\vc\atlmfc\include\afx.h 24
>
> As a fix we tried to make a seperate header file afxdlldef.h which said
> the
> following:
>
> #ifndef _AFXDLL
> #define _AFXDLL
> #endif
>
> If we include this header file in our source code files, it compiles
> without
> any error. But this approach requires changing every source code file to
> include this new header file which we don't wish to do. So we would like
> to
> know if there is some other better approach to resolve this problem
>
> 2. MSDN help says that defining _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES as
> 1
> will eliminate the warning by changing the strcpy call to strcpy_s. But
> when
> we tried using this, we still get warnings for strcpy.
>
> -Adish



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting VB 2003 to VB 2005 cmdolcet69 Microsoft VB .NET 4 9th Sep 2007 12:13 PM
Converting from VS 2003 to 2005 =?Utf-8?B?U3VzYW4=?= Microsoft C# .NET 0 6th Sep 2007 08:08 PM
Converting from .Net 2003 to .Net 2005 using a dll? Coleen Microsoft Dot NET 0 27th Sep 2006 06:47 PM
Converting .Net 2003 to .Net 2005 Coleen Microsoft Dot NET 7 20th Sep 2006 07:06 PM
Converting from VS.NET 2005 to VS.NET 2003 William Foster Microsoft Dot NET Framework Forms 2 20th Jul 2006 11:25 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:46 AM.