Click here to Skip to main content
15,891,810 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Routing Enter/Return key press to a Dialog Pin
Abhi Lahare15-Jun-11 4:51
Abhi Lahare15-Jun-11 4:51 
GeneralRe: Routing Enter/Return key press to a Dialog Pin
dipuks15-Jun-11 5:31
dipuks15-Jun-11 5:31 
GeneralRe: Routing Enter/Return key press to a Dialog Pin
Abhi Lahare15-Jun-11 7:01
Abhi Lahare15-Jun-11 7:01 
AnswerRe: Routing Enter/Return key press to a Dialog Pin
Albert Holguin15-Jun-11 5:12
professionalAlbert Holguin15-Jun-11 5:12 
QuestionRe: Routing Enter/Return key press to a Dialog Pin
David Crow15-Jun-11 5:57
David Crow15-Jun-11 5:57 
QuestionProblem in creating dsn using sqlconfigdatasource() Pin
shashankacharya15-Jun-11 0:58
shashankacharya15-Jun-11 0:58 
AnswerRe: Problem in creating dsn using sqlconfigdatasource() Pin
David Crow15-Jun-11 2:09
David Crow15-Jun-11 2:09 
AnswerRe: Problem in creating dsn using sqlconfigdatasource() Pin
gaspher17-Jun-11 13:06
gaspher17-Jun-11 13:06 
QuestionVPN Server and Client Pin
dwk0014-Jun-11 22:34
dwk0014-Jun-11 22:34 
QuestionEquation for a straight line Pin
Cyclone_S14-Jun-11 13:48
Cyclone_S14-Jun-11 13:48 
AnswerRe: Equation for a straight line Pin
tolw14-Jun-11 19:27
tolw14-Jun-11 19:27 
GeneralRe: Equation for a straight line Pin
Cyclone_S15-Jun-11 10:31
Cyclone_S15-Jun-11 10:31 
GeneralRe: Equation for a straight line Pin
tolw15-Jun-11 18:56
tolw15-Jun-11 18:56 
GeneralRe: Equation for a straight line Pin
Stefan_Lang15-Jun-11 23:48
Stefan_Lang15-Jun-11 23:48 
This is what's called the explicit function for a straight line, meaning that you calculate one coordinate based on the value of the other coordinate. The explicit representation comes with a few shortcomings that can be confusing at times when you deal with 2D geometrical elements. For example you wouldn't be able to draw a vertical line with an equation like what you posted! Also, for near vertical lines you'd have to take care what values of x would produce a valid y - you'll find that most values of x that lie well within the screen corrdinate range will produce y values that are way outside the screen.

The implicit representation avoids this confusion, but it is often much easier to use the parametric representation: In this case, you have two points, A and B. The parametric representation of a line through these two points is:
P(t) = A + t*(B-A)
. This equation is in fact a set of equations, referring to the two coordinates, x and y:
P(t).x = A.x + t*(B.x-A.x)
P(t).y = A.y + t*(B.y-A.y)

If you implement a function to calculate P(t), using the formulas above, each value of t will yield a point P(t) somewhere on this line. For t==0 you will find that P(0)==A, and for t==1 you will find that P(1)==B.

Of course, you have to be careful with these calculations when dealing with pixel coordinates: you have to convert these coordinates to float values first, or else the rounding effects may lead to some unexpected results.
GeneralRe: Equation for a straight line Pin
Cyclone_S17-Jun-11 15:13
Cyclone_S17-Jun-11 15:13 
QuestionWhy is there no cfind() in the std containers? Pin
Craig Longman14-Jun-11 12:15
Craig Longman14-Jun-11 12:15 
AnswerRe: Why is there no cfind() in the std containers? Pin
Stefan_Lang15-Jun-11 23:19
Stefan_Lang15-Jun-11 23:19 
GeneralRe: Why is there no cfind() in the std containers? Pin
Craig Longman20-Jun-11 12:59
Craig Longman20-Jun-11 12:59 
Question[SOLVED]CWebBrowser2 not getting displayed on a dialog in a dll. [modified] Pin
chandu00414-Jun-11 11:26
chandu00414-Jun-11 11:26 
AnswerRe: CWebBrowser2 not getting displayed on a dialog in a dll. Pin
chandu00414-Jun-11 12:19
chandu00414-Jun-11 12:19 
AnswerRe: CWebBrowser2 not getting displayed on a dialog in a dll. Pin
pix_programmer14-Jun-11 21:08
pix_programmer14-Jun-11 21:08 
General[SOLUTION] Pin
chandu00417-Jun-11 11:19
chandu00417-Jun-11 11:19 
Questionconvert short to Cstring... Pin
spalanivel14-Jun-11 2:27
spalanivel14-Jun-11 2:27 
AnswerRe: convert short to Cstring... Pin
వేంకటనారాయణ(venkatmakam)14-Jun-11 2:37
వేంకటనారాయణ(venkatmakam)14-Jun-11 2:37 
GeneralRe: convert short to Cstring... Pin
Albert Holguin14-Jun-11 3:29
professionalAlbert Holguin14-Jun-11 3:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.