Click here to Skip to main content
15,910,234 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: typdef struct MFC Pin
Eugen Podsypalnikov31-Aug-10 21:02
Eugen Podsypalnikov31-Aug-10 21:02 
GeneralRe: typdef struct MFC Pin
mesajflaviu31-Aug-10 21:15
mesajflaviu31-Aug-10 21:15 
GeneralRe: typdef struct MFC Pin
CPallini31-Aug-10 21:26
mveCPallini31-Aug-10 21:26 
AnswerRe: typdef struct MFC Pin
Cedric Moonen31-Aug-10 21:02
Cedric Moonen31-Aug-10 21:02 
GeneralRe: typdef struct MFC Pin
mesajflaviu31-Aug-10 22:53
mesajflaviu31-Aug-10 22:53 
GeneralRe: typdef struct MFC Pin
mesajflaviu31-Aug-10 22:59
mesajflaviu31-Aug-10 22:59 
GeneralRe: typdef struct MFC Pin
Cedric Moonen31-Aug-10 23:06
Cedric Moonen31-Aug-10 23:06 
GeneralRe: typdef struct MFC Pin
Cedric Moonen31-Aug-10 23:02
Cedric Moonen31-Aug-10 23:02 
The AddLineStruct method is correct and is what you have to do in order to hide the implementation details from classes which are using CMyView (encapsulation).

Now you should do something similar as that for retrieving a line. I don't know based on which information you would like to retrieve a specific line but I guess this is based on the mouse location (the point variable) ?
So, you could create a method GetLine(const CPoint* point) which is retrieving a line (or an array of line) which are close to the point. This way, you also hide the internals about how your lines are managed by the CMyView class.

Just to clarify your doubts: you seem to be very confused about how to declare your variable (because in all cases it was wrong). So, if your structure is globally defined, you just have to do this:
Line newLine = ....;
and if your structure is defined inside your CMyView class, then you should simply do this:
CMyView newLine = ....;


It doesn't make any sense to have to use an instance of CMyView in order to instanciate a variable (pView->Line).
Cédric Moonen
Software developer

Charting control [v3.0]
OpenGL game tutorial in C++

QuestionRe: typdef struct MFC Pin
CPallini31-Aug-10 23:06
mveCPallini31-Aug-10 23:06 
AnswerRe: typdef struct MFC Pin
mesajflaviu1-Sep-10 0:33
mesajflaviu1-Sep-10 0:33 
GeneralRe: typdef struct MFC Pin
CPallini1-Sep-10 2:03
mveCPallini1-Sep-10 2:03 
Questionre: winsock multiplexed server using select() Pin
Alan Kurlansky31-Aug-10 9:50
Alan Kurlansky31-Aug-10 9:50 
AnswerRe: re: winsock multiplexed server using select() Pin
Moak31-Aug-10 10:36
Moak31-Aug-10 10:36 
QuestionCrash ribbon when PC enter in sleep/standby mode Pin
Dansveen31-Aug-10 2:47
Dansveen31-Aug-10 2:47 
AnswerRe: Crash ribbon when PC enter in sleep/standby mode Pin
Eugen Podsypalnikov31-Aug-10 9:27
Eugen Podsypalnikov31-Aug-10 9:27 
GeneralRe: Crash ribbon when PC enter in sleep/standby mode Pin
Dansveen1-Sep-10 10:52
Dansveen1-Sep-10 10:52 
GeneralRe: Crash ribbon when PC enter in sleep/standby mode Pin
Eugen Podsypalnikov1-Sep-10 22:34
Eugen Podsypalnikov1-Sep-10 22:34 
GeneralRe: Crash ribbon when PC enter in sleep/standby mode Pin
Dansveen2-Sep-10 3:09
Dansveen2-Sep-10 3:09 
GeneralRe: Crash ribbon when PC enter in sleep/standby mode Pin
Eugen Podsypalnikov2-Sep-10 3:22
Eugen Podsypalnikov2-Sep-10 3:22 
GeneralRe: Crash ribbon when PC enter in sleep/standby mode Pin
Dansveen2-Sep-10 9:11
Dansveen2-Sep-10 9:11 
GeneralRe: Crash ribbon when PC enter in sleep/standby mode Pin
Eugen Podsypalnikov2-Sep-10 20:55
Eugen Podsypalnikov2-Sep-10 20:55 
QuestionCan we create DSN name and set a path through Install shield Pin
raju_shiva30-Aug-10 20:48
raju_shiva30-Aug-10 20:48 
QuestionRe: Can we create DSN name and set a path through Install shield Pin
David Crow31-Aug-10 5:45
David Crow31-Aug-10 5:45 
QuestionCustomized BEGIN_TEMPLATE_MESSAGE_MAP with 2 template arguments for VS2005 Pin
funwithdolphin30-Aug-10 19:50
funwithdolphin30-Aug-10 19:50 
AnswerRe: Customized BEGIN_TEMPLATE_MESSAGE_MAP with 2 template arguments for VS2005 Pin
Code-o-mat30-Aug-10 22:29
Code-o-mat30-Aug-10 22: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.