Solved

CPen question

Posted on 2002-05-15
8
252 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
 
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now