|
Qadddd wrote:
But the question remains the same : how do I print a graphical object ( or a metafile or directly a MSChart) ?
A graphical object can be selected into a DC. Just blit it to the printer DC.
A metafile can be played back to a DC using PlayEnhMetaFile .
|
|
|
|
|
hello,
to be clear in my mind, do you have any code example that perform this kind of operation.
I have to say that I am not a specialist in VC++ and that playing with printers (apart some easy prints in text mode) is quite new for me.
I looked on the web and found no example for metafile play on a printer DC, they are all destinated to a rect, so a screen so it seems that I can't use this solution.
No solution for the screen capture in a rect object that could be printed ?
Thanks in advance
DD
|
|
|
|
|
Qadddd wrote:
I have to say that I am not a specialist in VC++
You don't have to be. This is basic Win32 API programming.
I looked on the web and found no example
You looked in the wrong place (or with the wrong search phrase(s)). Try looking at MSDN and the samples there.
|
|
|
|
|
>>You don't have to be. This is basic Win32 API programming.
there are so many other things more interesting than printing ...
I am just learning and coding in VC++ by myself, the night at home, and loos e so much time on a single problem like this one ... and have some many other things to do ...
>>You looked in the wrong place (or with the wrong search phrase(s)).
I am not a specialist from the web neither, i use google and then jump in the thousands links or post some question on forums after having searched for a solution in already existing posts. What's the right phrase to print in vc++ an chart produced by an activeX Mschart? Try by yourself and we'll see if you are more lucky or efficient than me
>>Try looking at MSDN and the samples there.
there so many articles, the one more complicated than the other. It is simple, when I want to find something in MSDN, I never find it. Print for example, there is no simple doc explaining the right way to do it with a good significative example (at least when you search with their "search for"). another thing, I am coding in vc++, I don't give a damn about article talking of VB or other . Try to find out how to print chart produced by using a MsChart activeX, the only info I found is for VB. Try to search in the newsgroup, this question appear several times for at least 2 years, but there is no answer neither from students nor from microsoft ...
Frankly, I don't understand why there is no "Print" method as there is an "EditCopy" method ... or at least the explanation to do it.
DD
|
|
|
|
|
the only command I know if is itoa and that requires a second or third convesion before I end up with a MFC useable CString. I read a post saying something about using the Format command but I have been unable to get it to work.
Can anyone help?
Thanks
Eric
|
|
|
|
|
CString str;
int i = 100;
str.Format("%d", i);
that's it. it's just like printf/sprintf.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
|
hello,
I use the Format method of class CString.
MyCstring.Format("%d",MyInt);
Can be used with several formats and justification.
Idem for dates presentation as CString:
MyDate.Format("%.2d/%.2d/%.4d",MyDAy,MyMonth,MyYear);
DD
|
|
|
|
|
|
Hi...
I want to add text in a CEdit control.
NOT ReplaceSel or SetWindowText... Only Add in the end of the current text...
Thanks world !!!
Hello World!!!
from Raphaël
|
|
|
|
|
As stupidly it sounds, but Read old text, add your String to it, and write String back. For example
CString s;
MyEdit.GetWindowText(s);
s+='abcd';
MyEdit.SetWindowText(s);
It is a unique way. If you want to save caret position, do it manually. The better way is to write own heritable controls as CEditEx, CListBoxEx, and to place all needed routines like that into them. You will make it once and will be happy many years.
|
|
|
|
|
I think that's a good idea... CEditEx... Yes... I'll do that...
But I'll use (Nevertheless) this method:
MyEdit.SetSel(-2, -1);
MyEdit.Replace(MyText);
Thank you very much
Hello World!!!
from Raphaël
|
|
|
|
|
Please Help, very little experience with MDI apps!!
I'm looking for information regarding opening, closing, initializing data, etc.. in an MDI application. I want to be able to open a child window and initialize the fields with data from other apps. I can currently open the MDI application and initialize it with the information in shared memory, but I would like to be able to keep the MDI app open and just open different child frames with the data that I send over from other apps. The opening my already defined view part is throwing me. I found and example on creating a new view but nothing on an already defined view.
Again I am new at MDI apps and looking for good information on dealing with the different child frames.
Thanks in advance for any help that you can provide.
Steve
|
|
|
|
|
Hi, l am writing a GUI using MFC, and l need to include some graphical features in it. Does anyone know how to plot graphs using MFC? All l need is something that plots points from a table of data, not from a function. It also doesn't need to be interactive -- basically l need just the most simple kind.
Any suggestions will be appreciated.
Thanks!!
|
|
|
|
|
Type in search: "PGL" It's wonderfull
P.G.L. = Plot Graphic Library
Or go there : Plot Graphic Library
(it's the same result)
Hello World!!!
from Raphaël
|
|
|
|
|
I would like to write a routine to copy registry entries into an INI file then back into the registry, but the only functions I can find in CWinApp are WriteProfile and GetProfile. Does anybody know if there is anything built-in for this task or if it must be done manually??
Any suggestions are appriciated.
Thanks!
Is it football season yet... GO GATORS!!!
|
|
|
|
|
unfortunately, there is no any appropriate functions in MFC for your task.
Moreover, MFC does not include any routines for INI-support (as far as i know). You must do it manually, by WinAPI functions.
See in MSDN: RegOpenKey[Ex], RegCloseKey and so on for Registry operation
AND
GetProfileInt, GetProfileSection, GetProfileString etc. for INI-operations
|
|
|
|
|
I was afraid of that. Oh well, doesnt seem all that difficult to do manually so thats what ill do!
Thanks.
|
|
|
|
|
There is an another way to solve your problem. You may use regedit with command-line params for saving and loading your data from reg-file. Like that
regedit /e My.reg HKEY_CURRENT_USER\Software\My Data //From registry to file
regedit -s My.reg //From file to registry
You can use WINAPI - CreateProcess function to make this job silent
|
|
|
|
|
This is exactly what I was looking for! Thanks!
|
|
|
|
|
Hi again,
i call SetCursor(LoadCursor(NULL, IDC_WAIT)) in a (ListCtrl) Subroutine,
but the Cursor doesn't change.
How can i make it the right way ?
Win2000 Prof, VS 6.0, SP2
Marco
|
|
|
|
|
to change the cursor, you need to handle the WM_SETCURSOR message. this will give you a OnSetCursor function.
like this:
BOOL CPickAxeView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
if (pWnd==(CWnd *)this)
{
if (nHitTest==HTCLIENT)
{
if (message==WM_MOUSEMOVE)
{
SetCursor(AfxGetApp()->LoadStandardCursor(m_cursor));
return TRUE;
}
}
}
return CView::OnSetCursor(pWnd, nHitTest, message);
}
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Thanxs,
i needed for the header of a listcontrol. If the cursor is over the header,
then the standard cursor is shown.
How can i catch the Listcontrol->Header->OnSetCursor routine ?
Marco
|
|
|
|
|
you'll need to create a class derived from CHeaderCtrl, override OnSetCursor there, then use that class on your list control.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Hi,
sorry for my stupid question, but how can i
"use that class on your list control" ?
i have a created a new Class with modified OnSetCursor(), and then... ?
Marco
|
|
|
|