|
VC++ 6, SDI project
I've had a user recently encounter a problem using the "Number of Copies" feature in the Print dialog box.
When he sets the value to print multiple copies, he says it works fine with one printer, yet on another (Canon BJC 240) it only prints one copy. I made a simple test program that did nothing more than print a single line on a page and had him try it out. The results were the same.
Someone in the newsgroups suggested a bad printer driver might be the cause. Strange thing is, the user says the Canon's multiple copies feature works fine in other programs. (i.e. Word)
Any ideas?
Jack
|
|
|
|
|
You may send me the simple test program so I could take a look on it (mail@BartoszBien.com). I developed a custom print dialog some time ago, so DEVMODEs, CPrintInfos and such stuff are quite familiar to me.
Regards,
BB
|
|
|
|
|
Please help me with this
I have created SDI application in MFC.
Main View is RichEditView.
I have added menu item FORMAT as ID_FORMAT.
I have created CFontFormat class which is delivered from CFontDialog as base class.
In class view (ctrl+w) i have added "COMMAND" to ID_FORMAT, then edit code:
//CODE HERE
{
CFontFormat aCD;
aCD.DoModal();
}
//ENDS
In source file i have added #include "FontFormat.h" then execute.
OK, great programm is executed, i have rich edit text view, i can type in (but always in that ugly bold default font). I select FORMAT from the menu, and Font selection dialog appears. I select font and then----nothing, font is the same as it would be if i just created sdi application with richeditview.
I am begginer (stupid female ), i am willing to learn, but i need good soul who can reply and step-by-step point me to somwhere.
Thanx in advance,
*Marriana*
|
|
|
|
|
Anonymous wrote:
I am begginer (stupid female)
Marriana, don't belittle yourself for being a beginner. We are all beginners at one time or another.
It sounds like you have the rich edit control working, and the font dialog working. What you need to do is connect the two. The basic idea is that, where you invoke the font dialog, retrieve the values that the user selected from the font dialog. CFontDialog includes methods for each value the user can select. These values can then be applied to the current selection in the rich edit control. The rich edit control has methods for setting the 'character format' (which the font is part of).
Look further in the MSDN (or at msdn.microsoft.com[^]) for CFontDialog and CRichEditCtrl .
Good luck.
Software Zen: delete this;
|
|
|
|
|
how can i disable a an active x's right click event..?????
[.1]
|
|
|
|
|
Hi All!..
I'm trying to create dll which include dialog in it.
here what I did
1) create new MFC AppWizard dll project with regular dll share MFC dll, named testingDlg
2) insert new dialog IDD_DIALOG1 with ok and cancel buttons
3) right click, choose classwizard. that's make me create of dlg1 class for the dialog1
4) I add function ONOK,
void dlg1::OnOK() <br />
{<br />
AfxMessageBox("hello ");<br />
CDialog::OnOK();<br />
}
5) insert new class, dlgA, to testingDlg
6) add new function call showDlg(bool true) and insert the following code
<br />
void dlgA::showDlg(bool show)<br />
{<br />
if (show)<br />
{<br />
if(d1.DoModal()==IDOK)<br />
{<br />
AfxMessageBox("you did it");<br />
}<br />
}<br />
}<br />
7) i compile testingDlg and without any error, testingDlg.dll and testingDlg.lib get created
but when I called showDlg(true); from another application, I got the following error
<br />
testingDlg\dlg1.h(23) : error C2065: 'IDD_DIALOG1' : undeclared identifier<br />
testingDlg\dlg1.h(23) : error C2057: expected constant expression<br />
Generating Code...<br />
<br />
Error executing cl.exe.<br />
<br />
TestingDll.exe - 2 error(s), 0 warning(s)<br />
can anybody tell me why I got errors??
Thank you
|
|
|
|
|
Here is one good reference on MFC DLL.
http://www.mindcracker.com/mindcracker/c_cafe/dll.asp
Kuphryn
|
|
|
|
|
I was just going over all my old disks and found snip9707.zip. This is a collection of over 700 files and I am glad I found it. I did a quick search via google and found that it is still available for download. Be carefull though, the copy that I have is not infected but apparently there were some infected copies out there. So be sure to scan it. Now go search for snip9707 and enjoy.
If any one knows I can find other archive like this please let me know.
If you don't use it you lose it. Fight senility use you brain.
|
|
|
|
|
Hi, I have a flicker in my program when it calls onPaint(), so I was wondering how to double buffer my graphics. All I'm calling are some simple FillRect functions. Thanks.
Robert
|
|
|
|
|
Flicker Free Drawing In MFC[^]
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Check out
http://www.codeproject.com/bitmap/bitmapdc.asp?target=cbitmapdc&df=100&forumid=160&select=49439#xx49439xx
It works great for a the applications I've been working on.
|
|
|
|
|
Is there any function which returns number of decimals in the integer,
or can sombody help me with fast algorithm to do this. thanks
|
|
|
|
|
int digits = log10(integer) + 1; Only works with positive numbers.
HTH
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
pepevejlupek wrote:
Is there any function which returns number of decimals in the integer
Trick questions should probably be directed to the lounge.
The number of decimals in an integer is always zero.
|
|
|
|
|
Subtle, dude .
Software Zen: delete this;
|
|
|
|
|
int CountDigits(int value)
{
int digit_count = 0;
do {
digit_count++;
value /= 10;
} while (value != 0) {
return digit_count;
}
or, even faster:
int CountDigitsFaster(int value)
{
int digit_count = 1;
if (value < 0) value = -value;
if (value > 9) digit_count++;
if (value > 99) digit_count++;
if (value > 999) digit_count++;
if (value > 9999) digit_count++;
if (value > 99999) digit_count++;
if (value > 999999) digit_count++;
if (value > 9999999) digit_count++;
if (value > 99999999) digit_count++;
if (value > 999999999) digit_count++;
return digit_count;
}
Note that CountDigitsFaster assumes that int 's are 32-bit signed values. Both functions assume that the minus sign in negative values is not considered a 'digit'. If you're actually trying to compute the number of characters required to display the value, then you would have to take that into account as well. CountDigitsFaster looks like dumb code, but is significantly faster than any alternative I can think of. It requires 10 compares, 10 jumps, possibly a negation, and up to 9 increments. My original CountDigits , while it may exit with an early out for small values, requires an increment and a division per iteration, for up to 9 iterations.
Software Zen: delete this;
|
|
|
|
|
I would like to see examples in VC6 about performance counter ( creating new performance counter)
Thanks
Luis Ricardo
|
|
|
|
|
|
|
The link u hv provided is not working. Do u know any other links?
|
|
|
|
|
MFC Print Preview - help urgently
Helpp!!! I printed a few pages using CView::OnDraw override, hence, did not take into consideration the current page being printed. So the problem is that I do not print taking into consideration the current page being printed. As a result, the output gets slower when the data to be printed increases and even overlapped. Please Help!!!!
|
|
|
|
|
Hello,
how can I open another FormView in a MDI-Appl. from a FormView ? Not from the Main-Menu !
Example:
There is a Button in CFormView1. With this Button, I
want to open/create the CFormView2. How can I do that ?
Is there a axample application/source?
Thanks, jr
|
|
|
|
|
// Get the correct document template
CDocTemplate* pDocTemplate;
POSITION pos = pApp->GetFirstDocTemplatePosition();
pDocTemplate = pApp->GetNextDocTemplate(pos);
ASSERT(pDocTemplate);
// Create the new frame
CFrameWnd* pNewFrame = pDocTemplate->CreateNewFrame(GetDocument(),
(CFrameWnd*)AfxGetMainWnd());
ASSERT(pNewFrame);
// Activate the frame and set its active view
pDocTemplate->InitialUpdateFrame(pNewFrame, NULL);
|
|
|
|
|
How can I open the CFormView2 , which have no Doc-Class ?
Thanks, jr
|
|
|
|
|
I'm making a program where i need the hWnd of the control that is currently under the cursor, but i'm in doubt of which API's i should use. I've tried checking around but i can't seem to find the answer.
Thanks in advance
|
|
|
|