Re: Geometric pens compiler error

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi,

"ruleren" <-> wrote in message news:479876bb$0$99022$157c6196@xxxxxxxxxxxxxxxxxxxxxxxx
I'm trying to get drawing with custom pens to work. The code below compiles and runs fine under VC6 in XP, but I get compiler errors in EVC4.

error C2065: 'PS_GEOMETRIC' : undeclared identifier
error C2065: 'PS_USERSTYLE' : undeclared identifier

Windows CE provides a subset of the Win32 APIs found on a desktop PC, not all features are supported.

In the case of the GDI implementation many of the more flexable pen styles are not available. In part this is because the ExtCreatePen API (http://msdn2.microsoft.com/en-us/library/ms535223(VS.85).aspx) is not available.

Since the OS doesn't provide this support the MFC CPen class can't provide an object orientated wrapper around the functionality, and this is why the documentation you referenced explictly mentions the additional contructor overload isn't available on Windows CE.

In effect you only get the capabilities of the CreatePen API function (documentation available at http://msdn2.microsoft.com/en-us/library/ms908180.aspx).

On a Windows Mobile 5.0 or above device you could investigate the GDI+ APIs. Since they provide for this kind of functionality, along with custom end caps etc.

Another option if you only have a few lines is to draw the individual line segements individually according to your desired dash pattern.

Hope this helps,
Christopher Fairbairn

.



Relevant Pages

  • Re: Polygon tessellation
    ... don't see a problem with "mixing" APIs. ... You're not running OGL, you're just ... using an auxiliary functionality that doesn't even require an OGL context. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Enterprise Library Application Blocks question...
    ... Yes, the APIs have changed from the first incarnation to now, to be more ... in line with the current best practices using .NET 2.0. ... The functionality provided by the originals is still there, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Can there be any doubt at this point that queries were a bad idea?
    ... quirks many years ago and it would be dead by now. ... delivery of high-level functionality, not smoothing over browser ... DOM 3 Events and other DOM specifications are controlled by the w3c. ... The authors of the w3c specifications will continue to produce the same quality APIs that we are all sorely familiar with, and as such, dom adapters will be necessary. ...
    (comp.lang.javascript)
  • Re: Polygon tessellation
    ... I guess this is just par for the course -- everything in Direct3D is always ... don't see a problem with "mixing" APIs. ... just using an auxiliary functionality that doesn't even require an OGL ... you could look at the source code for the mesa glu to learn how to write ...
    (microsoft.public.win32.programmer.directx.graphics)