Hi all,

My tools:
MS VS 2005
WM PPC 5.0
Windows Media Player 10 SDK

Code sample is downloaded from
http://www.microsoft.com/downloads/details.aspx?FamilyID=46ba698a-c00d-4b90-9177-460854f1b57c&DisplayLang=en#Overview

I compile PPCWmpHost workspace...

Compiling...
1>wmphost.cpp
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>WINVER was defined to be 0x0400, as it was either not set or set to a
lower value
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.
1>PopDlgs.cpp
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>WINVER was defined to be 0x0400, as it was either not set or set to a
lower value
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.
1>MediaLibraryDlg.cpp
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>WINVER was defined to be 0x0400, as it was either not set or set to a
lower value
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.
1>CWMPHost.cpp
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>WINVER was defined to be 0x0400, as it was either not set or set to a
lower value
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.
1>CWMPEventDispatch.cpp
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>WINVER was defined to be 0x0400, as it was either not set or set to a
lower value
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.

Any information will be appreciated.

Thanks in advance,
DM

Re: PPCWmpHost code sample compile errors. by Tom

Tom
Sun Jun 25 16:42:28 CDT 2006

DM wrote:
> Hi all,
>
> My tools:
> MS VS 2005
> WM PPC 5.0
> Windows Media Player 10 SDK
>
> Code sample is downloaded from
http://www.microsoft.com/downloads/details.aspx?FamilyID=46ba698a-c00d-4b90-9177-460854f1b57c&DisplayLang=en#Overview

You have mixed versions of Windows CE.
Pocket PC 2005 is basd on Windows CE 5.0.
The code sample you downloaded is for Pocket PC 2003 which is based on
Windows CE 4.2.
So the code sample expects CE 4.2 libraries and code.

Make sure you have downloaded "Windows Mobile Developer Resource
Kit.msi". (It's hard to miss as it is ~800 MB). I would suggest
installing everything in the Resource Kit.

> I compile PPCWmpHost workspace...
> Compiling...
> 1>wmphost.cpp
> 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.

Throw away that old project and create a new project in VS2005 (now
that you have installed the Dev Kit and restarted VS2005).
Here are some project instructions to help you get started:
----------------------------------------------------------------------------------
1. New Project
2. Visual C++ -> Smart Device -> ATL Smart Device Project
3. MyPpcProject (for example)
4. Include the "Pocket PC 2005" project.
5. OK.

VS2005 will generate a project for you.

6. Right-click the project "MyPpcProject" in the "Solution Explorer"
view.
7. C/C++ -> Preprocessor -> Preprocessor Definitions : add
_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;
8. C/C++ -> General -> Additional Include Directories : add
"C:\WMSDK\WMPSDK10\include;" (the directory where you installed the WMP
10 SDK)
9. Linker -> Input -> Additional Dependencies : add "Strmiids.lib
Ws2.lib" (I forget what these are for; if your project compiles then
remove them one at a time)
10. Linker -> Advanced -> Target Machine : set to "MachineTHUMB"
11. Linker -> Command Line -> Additional Options : add
"/subsystem:windowsce,5.01"
12. Cross your fingers and try compiling!
----------------------------------------------------------------------------------
You may need additional tweaks to your project configuration.
It's hard to predict the relationships between code for WMP 10, CE 5.0,
and PPC 2005 get confusing.
I can't remember why I added some of the above entries to my project so
some of them may be superfluous.


A great way to explore and learn is to see how configuration changes
affect the calls to the compiler and linker.
Or, said another way, all those configuration changes in the GUI simply
amount to a different environment and command line passed to the
compiler and linker.
1. C/C++ -> Command Line
2. Linker -> Command Line
3. Tools -> Visual Studio 2005 Command Prompt
cl /?
link /?

-J Tom Moon