|
I have a single doc multiple views app in a tabbed view type mainframe. I have printing working nicely for each view on its own, but I need to print all views in one 'report'. I started by adding a "Print All" command in CMainFrame , and then traversing all document views (as CView pointers), but it gets very messy for a few reasons:
- each view must be cast to its RUNTIME_CLASS and checked to find which it is, so that its OnPrint function can be called
- each view has different scaling, so a single CPrintInfo won't suffice
- its not known in advance how many pages to set, but this can be overcome with m_bContinue checks.
Any suggestions on how to print a single document multiple views please?
Thanks!
|
|
|
|
|
.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
modified 20-Nov-15 8:46am.
|
|
|
|
|
|
Brisingr Aerowing wrote: WHY ON EARTH IS IT MISSING IN THE FIRST PLACE?!? That is the proper question.
Could you please report the exact error message (and any accessory, useful info)?
|
|
|
|
|
Brisingr Aerowing wrote: the ~ operator (bitwise not) not being implemented That would break a lot of software, I suspect something else is the actual issue. A sample of the code and the error details would help.
[edit]
Are you sure this is MSVC 14? no such version referenced on MSDN[^] as far as I can see.
[/edit]
|
|
|
|
|
Richard MacCutchan wrote: Are you sure this is MSVC 14? That is the compiler version: Microsoft Visual C/C++ Compiler version 14. That version is part of Visual Studio 2015.
|
|
|
|
|
MSVC is the IDE not the compiler.
|
|
|
|
|
You are right, it is not only the compiler but the complete C/C++ development environment.
But version 14 is those from VS 2015. See for example the Wikipedia[^].
|
|
|
|
|
I have VS 2013 express and the C compiler is:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC>cl -v
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
|
|
|
|
|
The 18 is the RTM number from my above link.
What a mess with all these different numbers for a single product 
|
|
|
|
|
OP deleted his question; I can guess why.
|
|
|
|
|
void assign(size_type n, el const T& el = T())
This function is a member function of the STL list class and I do not understand the bolded part. I understand the const T& el is a reference to a constant parameter which means I cannot change the value/content of the passed argument + I understand that el = T() means a default parameter so if there is no argument passed in the calling function the el will use the no-argument constructor of the T() type OK. But what make me confused the el at the beginning before the const?!!! so if someone can fill the blank gaps for me I will be grateful . Thanks in advance.
|
|
|
|
|
|
I read it in a book called "Data Structures and Algorithms in C++, 4th Edition by Adam Drozdek" it was in chapter 3 "Linked Lists" at the beginning of page 110 . It made me had the feeling of this when read it, and after searching and find nothing I become like this ;P;P (i.e., psycho). Thanks by the way for reply 
|
|
|
|
|
Looks like a typo, to me.
|
|
|
|
|
I have wrote a method that load and rescale a CBitmap:
CBitmap* CMyDlg::LoadPicture(CString strFile)
{
int m_nPictureSize = 170;
CBitmap* pBitmap = NULL;
HBITMAP hBitmap = (HBITMAP)::LoadImage(NULL, strFile, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
if(NULL != hBitmap)
{
CBitmap Bitmap, MemBitmap;
Bitmap.Attach((HBITMAP)hBitmap);
CBitmap* pFinalBitmap = MemDC.SelectObject(pOldBitmap);
SourceDC.SelectObject(pOldBmp);
pBitmap = new CBitmap;
pBitmap->Attach((HBITMAP)pFinalBitmap->GetSafeHandle());
BITMAP bm3;
pBitmap->GetBitmap(&bm3);
TRACE("Width and height INSIDE if condition: %d|%d\n", bm3.bmWidth, bm3.bmHeight);
}
BITMAP bm4;
pBitmap->GetBitmap(&bm4);
TRACE("Width and height OUTSIDE if condition: %d|%d\n", bm4.bmWidth, bm4.bmHeight);
return pBitmap;
}
I want to use this method in order to add this created CBitmap pointer to add them into CTypedCBitmapList:
CBitmap* pImage = LoadPicture(strPath);
if(NULL == pImage->GetSafeHandle())
return 0;
m_PtrArrayBitmap.Add(pImage);
Ok, but the strange thing is that pBitmap from inside of LoadPicture method has correct size inside of 'if' condition, and wrong size outside of 'if' condition:
Width and height INSIDE if condition: 170|170
Width and height OUTSIDE if condition: -858993460|-858993460
Why ? It is not the same pBitmap object ? Could you help me ? Kindly thank for any further help !
|
|
|
|
|
It appears that the bitmap you are pointing to is a temporary object whose scope is only within the if block. In the following block of code where do pOldBitmap and pOldBmp come from?
CBitmap* pFinalBitmap = MemDC.SelectObject(pOldBitmap);
SourceDC.SelectObject(pOldBmp);
pBitmap = new CBitmap;
pBitmap->Attach((HBITMAP)pFinalBitmap->GetSafeHandle());
|
|
|
|
|
I think I figure out why it doesn't work ... pOldBitmap and pOldBmp are decalred inside of 'if' statement:
if(NULL != hBitmap)
{
CBitmap* pOldBitmap = MemDC.SelectObject(&MemBitmap);
CDC SourceDC;
SourceDC.CreateCompatibleDC(&cdc);
CBitmap* pOldBmp = SourceDC.SelectObject(&Bitmap);
CBitmap* pFinalBitmap = MemDC.SelectObject(pOldBitmap);
SourceDC.SelectObject(pOldBmp);
pBitmap = new CBitmap;
pBitmap->Attach((HBITMAP)pFinalBitmap->GetSafeHandle());
BITMAP bm3;
pBitmap->GetBitmap(&bm3);
TRACE("Width and height INSIDE if condition: %d|%d\n", bm3.bmWidth, bm3.bmHeight);
}
BITMAP bm4;
pBitmap->GetBitmap(&bm4);
TRACE("Width and height OUTSIDE if condition: %d|%d\n", bm4.bmWidth, bm4.bmHeight);
return pBitmap;
|
|
|
|
|
Well, that is quite different from the code in your original question.
|
|
|
|
|
If a, b and c are variable of type int. without changing the types write a program to display
C = 1.5 if a is 3 and b is 2
|
|
|
|
|
We don't do your homework.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
sorry...didnt mean to be rude its just a test i saw somewhere and i dont know how to do it...all i want is for you guys to tell me what its under or explain what im supposed to do not to write the program. I'm a beginner in C++...Pls guys
|
|
|
|
|
#include <stdio.h>
int main()
{
int a,b,c;
if (a==3 && b==2) printf("C=1.5\n");
return 0;
}

|
|
|
|
|
For a precision of one-tenth:
printf("C = %d.%d\n", a / b, abs(((10 * a) / b) % 10));
|
|
|
|
|
I guess the question is hinting type casting[^].
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|