EVC4 Migration to VS2005

Hello Experts,

I'm trying to migrate existingnative C++ EVC 4.0 (Targeting Pocket PC 2003) projects to VS 2005. After installing all required software and SDKs I opened the project in VS 2005 and compiled then errors started to evolve. All the errors I saw were related to classes that were dropped from MFC! Fortunately I was able to resolve most of the errors by using classes that are supported or by getting rid of the class completely whenever possible. My problem started when I tried to resolve the errors related internet and http classes, which are:

CInternetFile
CHttpFile
CLongBinary
CInternetSession
CInternetConnection
CHttpConnection

According to MSDN documentation, these classes were dropped from MFC. If I try to use any of these classes I get the following error message:

Fatal error C1189: #error : Internet Services classes not supported in this
library variant.

I traced the problem and found the following code in afxinet.h

#ifdef _AFX_NO_INET_SUPPORT
#error Internet Services classes not supported in this library variant.
#endif

My question is: Is there any replacement classes to the above ones? If no, then what is the easiest way to get rid of them and still provide the same functionality in my application?

Thanks in advance,
Khalid.

[1934 byte] By [KhalidOmar] at [2007-12-23]
# 1

In general, for working/functional classes from MFC4 the advice we've been giving people is to look at whether they can lift the source for the class from MFC4 and make it part of their project (or compile it into a static lib, and link that in, etc.). The classes above were probably cut for size reasons, or because the behaviour they wrapped was easily accessible in another way (yes, in many cases this turned out to be the wrong thing to do). In other cases, the cut classes never worked, or never really made sense on CE-based devices. I'm pretty sure you should be able to port these without any serious issues. Thanks,

Jeff

JeffAbraham at 2007-8-30 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...
# 2

I've faced the same problem too. Even i created new MFC smartdevice project and added "afxinet.h" in stdafx.h.

In VS2005 i've got this error.

"Internet Services classes not supported in this library variant."

But in EVC4 it does compile fine, no error.

Anyone can help?

Thanks

Modoko

Modoko at 2007-8-30 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...
# 3

It's likely that you'll need to take the class as implemented in MFC400 (which ships with eVC4) and link that directly into your application. Other than that, there isn't much help that I can give you. Sorry,

Jeff

JeffAbraham at 2007-8-30 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...
# 4

I have compiled steps to add missing MFC4.0 classes to projects into a document.The document is pretty raw and validation is not complete.It might take couple of weeks for me to publish this. How ever if you are critcally blocked, I would be willing to share the document "as is" with out warranty.pls write to me directly to the mail-id provided

thanks

Srikanth Bogadapati

sri_kant_b@microsoft_.com

(remove underscores for correct mail id)

SrikanthBogadapati at 2007-8-30 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...
# 5

me too!!

this is evc4's sample! But complied fail in vs2005!

httpdlg.obj : error LNK2019: 无法解析的外部符号 "public: __cdecl CInternetSession::CInternetSession(wchar_t const *,unsigned long,unsigned long,wchar_t const *,wchar_t const *,unsigned long)" (?0CInternetSession@@QAA@PB_WKK00K@Z),该符号在函数 "public: __cdecl CMyHttpSession::CMyHttpSession(wchar_t const *,unsigned long,int)" (?0CMyHttpSession@@QAA@PB_WKH@Z) 中被引用
httpdlg.obj : error LNK2001: 无法解析的外部符号 "public: virtual struct CRuntimeClass * __cdecl CInternetSession::GetRuntimeClass(void)const " (?GetRuntimeClass@CInternetSession@@UBAPAUCRuntimeClass@@XZ)
httpdlg.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __cdecl CInternetSession::Close(void)" (?Close@CInternetSession@@UAAXXZ)
httpdlg.obj : error LNK2019: 无法解析的外部符号 "public: virtual __cdecl CInternetSession::~CInternetSession(void)" (?1CInternetSession@@UAA@XZ),该符号在函数 "public: virtual __cdecl CMyHttpSession::~CMyHttpSession(void)" (?1CMyHttpSession@@UAA@XZ) 中被引用
httpdlg.obj : error LNK2019: 无法解析的外部符号 "public: __cdecl CInternetException::CInternetException(unsigned long)" (?0CInternetException@@QAA@K@Z),该符号在函数 "void __cdecl ThrowHttpException(int)" (?ThrowHttpException@@YAXH@Z) 中被引用
httpdlg.obj : error LNK2019: 无法解析的外部符号 "wchar_t * __cdecl wce_AsciiToWide(wchar_t *,char const *)" (?wce_AsciiToWide@@YAPA_WPA_WPBD@Z),该符号在函数 "protected: int __cdecl CHttpDlg::DownloadPage(wchar_t *)" (?DownloadPage@CHttpDlg@@IAAHPA_W@Z) 中被引用
httpdlg.obj : error LNK2019: 无法解析的外部符号 "public: int __cdecl CInternetFile::SetReadBufferSize(unsigned int)" (?SetReadBufferSize@CInternetFile@@QAAHI@Z),该符号在函数 "protected: int __cdecl CHttpDlg::DownloadPage(wchar_t *)" (?DownloadPage@CHttpDlg@@IAAHPA_W@Z) 中被引用
httpdlg.obj : error LNK2019: 无法解析的外部符号 "public: int __cdecl CHttpFile::QueryInfo(unsigned long,class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsOS<wchar_t> > > &,unsigned long *)const " (?QueryInfo@CHttpFile@@QBAHKAAV?$CStringT@_WV?$StrTraitMFC@_WV?$ChTraitsOS@_W@ATL@@@@@ATL@@PAK@Z),该符号在函数 "protected: int __cdecl CHttpDlg::DownloadPage(wchar_t *)" (?DownloadPage@CHttpDlg@@IAAHPA_W@Z) 中被引用
httpdlg.obj : error LNK2019: 无法解析的外部符号 "public: int __cdecl CHttpFile::QueryInfoStatusCode(unsigned long &)const " (?QueryInfoStatusCode@CHttpFile@@QBAHAAK@Z),该符号在函数 "protected: int __cdecl CHttpDlg::DownloadPage(wchar_t *)" (?DownloadPage@CHttpDlg@@IAAHPA_W@Z) 中被引用
httpdlg.obj : error LNK2019: 无法解析的外部符号 "public: int __cdecl CHttpFile::SendRequest(wchar_t const *,unsigned long,void *,unsigned long)" (?SendRequest@CHttpFile@@QAAHPB_WKPAXK@Z),该符号在函数 "protected: int __cdecl CHttpDlg::DownloadPage(wchar_t *)" (?DownloadPage@CHttpDlg@@IAAHPA_W@Z) 中被引用
httpdlg.obj : error LNK2019: 无法解析的外部符号 "public: int __cdecl CHttpFile::AddRequestHeaders(wchar_t const *,unsigned long,int)" (?AddRequestHeaders@CHttpFile@@QAAHPB_WKH@Z),该符号在函数 "protected: int __cdecl CHttpDlg::DownloadPage(wchar_t *)" (?DownloadPage@CHttpDlg@@IAAHPA_W@Z) 中被引用
httpdlg.obj : error LNK2019: 无法解析的外部符号 "public: class CHttpFile * __cdecl CHttpConnection::OpenRequest(int,wchar_t const *,wchar_t const *,unsigned long,wchar_t const * *,wchar_t const *,unsigned long)" (?OpenRequest@CHttpConnection@@QAAPAVCHttpFile@@HPB_W0KPAPB_W0K@Z),该符号在函数 "protected: int __cdecl CHttpDlg::DownloadPage(wchar_t *)" (?DownloadPage@CHttpDlg@@IAAHPA_W@Z) 中被引用
httpdlg.obj : error LNK2019: 无法解析的外部符号 "public: class CHttpConnection * __cdecl CInternetSession::GetHttpConnection(wchar_t const *,unsigned short,wchar_t const *,wchar_t const *)" (?GetHttpConnection@CInternetSession@@QAAPAVCHttpConnection@@PB_WG00@Z),该符号在函数 "protected: int __cdecl CHttpDlg::DownloadPage(wchar_t *)" (?DownloadPage@CHttpDlg@@IAAHPA_W@Z) 中被引用
httpdlg.obj : error LNK2019: 无法解析的外部符号 "public: int __cdecl CInternetSession::EnableStatusCallback(int)" (?EnableStatusCallback@CInternetSession@@QAAHH@Z),该符号在函数 "protected: int __cdecl CHttpDlg::DownloadPage(wchar_t *)" (?DownloadPage@CHttpDlg@@IAAHPA_W@Z) 中被引用
httpdlg.obj : error LNK2019: 无法解析的外部符号 "int __cdecl AfxParseURL(wchar_t const *,unsigned long &,class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsOS<wchar_t> > > &,class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsOS<wchar_t> > > &,unsigned short &)" (?AfxParseURL@@YAHPB_WAAKAAV?$CStringT@_WV?$StrTraitMFC@_WV?$ChTraitsOS@_W@ATL@@@@@ATL@@2AAG@Z),该符号在函数 "protected: int __cdecl CHttpDlg::DownloadPage(wchar_t *)" (?DownloadPage@CHttpDlg@@IAAHPA_W@Z) 中被引用
corelibc.lib(wwinmain.obj) : error LNK2019: 无法解析的外部符号 wWinMain,该符号在函数 wWinMainCRTStartup 中被引用
Pocket PC 2003 (ARMV4)\Release/Http.exe : fatal error LNK1120: 16 个无法解析的外部命令

zcwhgj at 2007-8-30 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...
# 6

HI all

In last few months , I have got quite a few mails on this forum post.

We are planning to enhance eVC-VS2005 migration expereince with Whidbey SP1. We intend to solve all your migration problems with these enhancements. I would soon make a follow up post on our plans.

Thanks

Srikanth Bogadapati

SrikanthBogadapati at 2007-8-30 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...
# 7
Hi Srikant,

I am a newbie to WM5.0 programming.
While porting a desktop application to WM5.0,
I faced the same error:
"include\afxinet.h(15) : fatal error C1189: #error :
Internet Services classes not supported in this library variant".

Can u please share me the document which says about how to add missing MFC4.0
classes to projects? My email id : pl_ram2003@yahoo.com

I was searching for this a long time and could not find a solution.
Except this link/thread there is nothing in the internet.

Please help.

Thanks n Regards,
Ram.

ramsarvan at 2007-8-30 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...