Solved

CPen question

Posted on 2002-05-15
8
268 Views
Last Modified: 2013-11-20
Is it possible to create a CPen using the PS_USERSTYLE style under MS Windows 9.x? I tried it but nothing appeared n the screen.

Thanks.
0
Comment
Question by:Iraklis
  • 4
  • 3
8 Comments
 
LVL 8

Expert Comment

by:VinExpert
ID: 7011971
Hi,

PS_USERSTYLE is supported only on Windows NT/2000/XP. I dont think, u achive that on a 9x system.

Go to following link
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pens_6rse.asp

They have not listed the 9x as the supporting OS for that style.

So, better think of some other way to achive ur targets.

VinExpert
0
 
LVL 12

Expert Comment

by:migel
ID: 7013126
Hi!
Try LineDDA for Win95+
0
 

Author Comment

by:Iraklis
ID: 7014573
Interesting but I could not find too much information about this function. Does it work for curve lines? Could yo send a little example? I'll double the amount of points I offer.


Thank.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 12

Expert Comment

by:migel
ID: 7015606
Hi!
no it doesn`t work for curve
here is example how to draw true dotted line

struct LINEDDAPARAM
{
     HDC          hDC;
     bool     bSet;
};

static void __stdcall LineDDAProc( int x, int y, LPARAM lParam)
{
     LINEDDAPARAM *pParam = (LINEDDAPARAM*)lParam;
     if( pParam->bSet)
          SetPixelV( pParam->hDC, x, y, SYS_COLOR_LINES);
     pParam->bSet = !pParam->bSet;
}

// and how to use

{
// some drawing code...
     LINEDDAPARAM ddaParam;
     ddaParam.hDC = hDC;
     ddaParam.bSet = false;
     LineDDA(0, 0, 100, 100, LineDDAProc, (LPARAM)&ddaParam);
}
0
 

Author Comment

by:Iraklis
ID: 7018525
Hmm I think this code displays a pixel every time, right?
0
 
LVL 12

Accepted Solution

by:
migel earned 102 total points
ID: 7018565
no
this code draw 2pixels period line (i.e . . . . . . )
0
 
LVL 12

Expert Comment

by:migel
ID: 7019363
Why 'B' ????????????????
0
 

Author Comment

by:Iraklis
ID: 7019893
Because it does not work for curve lines. What's the matter?
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Show shut-down message as Windows 8 shuts down. 9 101
maxBlock challenge 30 142
Modbus - whats the maximum I can store in one register? 4 80
Increment column based of a FK 8 32
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question