Click here to Skip to main content
15,922,007 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to split the CString variable in MFC?(Very Urgent..............) Pin
Gustavo Ferreira23-Feb-09 6:20
Gustavo Ferreira23-Feb-09 6:20 
QuestionUsing DC in added class (outside CView class) Pin
AglaiaMasaki23-Feb-09 1:57
AglaiaMasaki23-Feb-09 1:57 
Hello.

I can use CClientDC and its TextOut function in C~~View class.
It's quite simple like this:
void C~~View::OnLButtonDown(UINT nFlags, CPoint point)
{
CClientDC dc(this);
dc.TextOut(x, y, "..");
}

Yet when I use this function in my 'added' class, which is not derived class of CView,
an error occurs.
like this:
void CMyclass::memfunc()
{
CClientDC dc(this);
dc.TextOut(x, y, "..");
}

So I changed the code like this:
  [C~~View.cpp]
void C~~View::OnLButtonDown(UINT nFlags, CPoint point)
{
CClientDC dc(this);
CMyclass myclass;
myclass.memfunc(dc);
}
  [CMyclass.cpp]
void CMyclass::memfunc(CClientDC dc)
{
dc.TextOut(x, y, "..");
}

And errors still occur.
Of course, I linked the header file of my class to C~~View.cpp.
I want to display Text or Images on window with code in 'my class'.
Please give me advice or ideas. Thank you.

May the sky bring you a full measure of health and prosperity.

AnswerRe: Using DC in added class (outside CView class) Pin
CPallini23-Feb-09 2:15
mveCPallini23-Feb-09 2:15 
GeneralRe: Thank you so much! Pin
AglaiaMasaki23-Feb-09 3:42
AglaiaMasaki23-Feb-09 3:42 
GeneralRe: Thank you so much! Pin
CPallini23-Feb-09 7:06
mveCPallini23-Feb-09 7:06 
AnswerRe: Using DC in added class (outside CView class) [modified] Pin
Code-o-mat23-Feb-09 2:17
Code-o-mat23-Feb-09 2:17 
AnswerRe: Using DC in added class (outside CView class) Pin
AglaiaMasaki23-Feb-09 18:01
AglaiaMasaki23-Feb-09 18:01 
GeneralRe: Using DC in added class (outside CView class) Pin
Code-o-mat23-Feb-09 21:32
Code-o-mat23-Feb-09 21:32 
QuestionEcecution SQL into Visual C++ STUDIO 2008 Pin
durban223-Feb-09 1:29
durban223-Feb-09 1:29 
QuestionCComboBox and control Modeless [modified] Pin
durban223-Feb-09 1:26
durban223-Feb-09 1:26 
QuestionRe: CComboBox and control Modeless Pin
David Crow23-Feb-09 3:13
David Crow23-Feb-09 3:13 
JokeRe: CComboBox and control Modeless Pin
CPallini23-Feb-09 3:19
mveCPallini23-Feb-09 3:19 
QuestionHow to convert color EMF spool file to grayscale or Black /white spool file? Pin
GAJERA23-Feb-09 0:26
GAJERA23-Feb-09 0:26 
QuestionHow to get a value (in C++ code) returned by a Stored procedure? Pin
PankajB22-Feb-09 23:58
PankajB22-Feb-09 23:58 
QuestionRe: How to get a value (in C++ code) returned by a Stored procedure? Pin
CPallini23-Feb-09 0:14
mveCPallini23-Feb-09 0:14 
AnswerRe: How to get a value (in C++ code) returned by a Stored procedure? Pin
PankajB23-Feb-09 0:23
PankajB23-Feb-09 0:23 
GeneralRe: How to get a value (in C++ code) returned by a Stored procedure? Pin
PankajB23-Feb-09 0:35
PankajB23-Feb-09 0:35 
QuestionI have a problem with Cyrillic Characters in C++ MFC (Visual Studio 6) Pin
micutzu22-Feb-09 23:49
micutzu22-Feb-09 23:49 
AnswerRe: I have a problem with Cyrillic Characters in C++ MFC (Visual Studio 6) Pin
Code-o-mat23-Feb-09 0:31
Code-o-mat23-Feb-09 0:31 
QuestionSetfont not working properly in Wizard Mode property Sheet. Pin
Le@rner22-Feb-09 23:35
Le@rner22-Feb-09 23:35 
AnswerRe: Setfont not working properly in Wizard Mode property Sheet. Pin
Iain Clarke, Warrior Programmer23-Feb-09 4:31
Iain Clarke, Warrior Programmer23-Feb-09 4:31 
QuestionHow to make the buttons as high as the toolbar control? Pin
kcynic22-Feb-09 22:37
kcynic22-Feb-09 22:37 
QuestionDifference between MS C++ and "normal" C++? Pin
Megidolaon22-Feb-09 22:32
Megidolaon22-Feb-09 22:32 
AnswerRe: Difference between MS C++ and "normal" C++? Pin
«_Superman_»22-Feb-09 22:37
professional«_Superman_»22-Feb-09 22:37 
AnswerRe: Difference between MS C++ and "normal" C++? Pin
CPallini22-Feb-09 22:45
mveCPallini22-Feb-09 22:45 

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.