none
Hosting the Windows Media Player Control in a PocketPC Application written in C++ RRS feed

  • Question

  • I use VS2005 to generate a ATL Smart Device Project and follow the sample posted on http://msdn2.microsoft.com/en-us/library/bb262335.aspx using VS2005

     

    // stdafx.h : include file for standard system include files,

    // or project specific include files that are used frequently,

    // but are changed infrequently

    #pragma once

    #pragma comment(linker, "/nodefaultlib:libc.lib")

    #pragma comment(linker, "/nodefaultlib:libcd.lib")

    // NOTE - this is value is not strongly correlated to the Windows CE OS version being targeted

    #define WINVER _WIN32_WCE

    #ifndef VC_EXTRALEAN

    #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers

    #endif

    #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit

    //#ifdef _CE_DCOM

    //#define _ATL_APARTMENT_THREADED

    //#endif

    // turns off MFC's hiding of some common and often safely ignored warning messages

    #define _AFX_ALL_WARNINGS

    #include <ceconfig.h>

    #if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)

    #define SHELL_AYGSHELL

    #endif

    #include <afxwin.h> // MFC core and standard components

    #include <afxext.h> // MFC extensions

    #ifndef _AFX_NO_OLE_SUPPORT

    #include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls

    #endif

     

    #include <afxdisp.h> // MFC Automation classes

    #ifndef _AFX_NO_AFXCMN_SUPPORT

    #include <afxcmn.h> // MFC support for Windows Common Controls

    #endif // _AFX_NO_AFXCMN_SUPPORT

    #include <afxsock.h> // MFC socket extensions

     

    #if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)

    #ifndef _DEVICE_RESOLUTION_AWARE

    #define _DEVICE_RESOLUTION_AWARE

    #endif

    #endif

    #ifdef _DEVICE_RESOLUTION_AWARE

    #include "DeviceResolutionAware.h"

    #endif

    #ifdef SHELL_AYGSHELL

    #include <aygshell.h>

    #pragma comment(lib, "aygshell.lib")

    #endif // SHELL_AYGSHELL

    #if (_WIN32_WCE < 0x500) && ( defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) )

    #pragma comment(lib, "ccrtrtti.lib")

    #ifdef _X86_

    #if defined(_DEBUG)

    #pragma comment(lib, "libcmtx86d.lib")

    #else

    #pragma comment(lib, "libcmtx86.lib")

    #endif

    #endif

    #endif

    #include <altcecrt.h>

    //#define _ATL_APARTMENT_THREADED

    #if 0

    #include <atlbase.h>

    extern CComModule _Module;

    #include <atlcom.h>

    #include <atlhost.h>

    #include <atlctl.h>

    #include <afxres.h>

    #else

    #include <atlbase.h>

    extern CComModule _Module;

    #include <atlcom.h>

    // AtlAxWinInit is implemented in atlce400.dll

    // #pragma comment(lib, "atl.lib")

    #include <atldef.h>

    #define _ATL_DLL_IMPL

    #include <atliface.h>

    #include <atlhost.h>

    #endif

     

    When I include atlhost.h,  I get the following error

    1>_CE_ACTIVEX was not defined because this Windows CE SDK does not have DCOM.

    1> _CE_ACTIVEX could be caused to be defined by defining _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA, but it is recommended that this be done only for single-threaded apps.

    1>_ATL_NO_HOSTING was defined because _CE_ACTIVEX was not defined.

    1>C:\Program Files\Microsoft Visual Studio 8\VC\ce\atlmfc\include\atlhost.h(43) : fatal error C1189: #error : atlhost.h requires Hosting support (_ATL_NO_HOSTING is defined). For Windows CE platforms without DCOM support, _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA needs to be defined.

     

    Is there anyone running into this problem?

    Thanks

     

    Jacob

     

    Tuesday, June 26, 2007 2:44 PM

Answers

All replies