A stupid printing question

I need to do this
GoView::PrintDocumentPage *pd=goView1->PrintDocumentPage;

and obviously I am not alowed
Workflow2.h(723): error C2248: ‘Northwoods::Go::GoView::PrintDocumentPage’ : cannot access protected member declared in class 'Northwoods::Go::GoView’

So far i have used GoDiagram genericaly and have not had to Inherit and modify behaviour of any of your classes (i hate doing this - pesonal madness)

Do i how have to make my own “myGoView” Class modify the protectivness of PrintDocumentPage then delete the design time GoView from my program and replace the old GoView in all my code with a runtime created “myGoView” class.

or is there a god out there:¬)
The reason for this stupidity is that i need to print using my own PprintDocument as that is linked to my own print prieview dialog etc etc.
All the best (excuse my ignorance)

There is a god out there, but she’s too busy to be reading this forum.
So we’re on our own, and unless you want to reimplement all of the printing support that GoView provides, you’ll need to inherit from GoView.
Although this isn’t exactly what you’re doing, sometimes people ask about how to customize printing, such as printing multiple documents in one job. Here’s one way of doing that:

How can I do that and keep designtime control over my GoView window
I tried to make my own class MyView from GoView and then edit all the initialisation code to use MyView instead of GoView but it trashes my project and i no longer have design time access to the GoView control.
On purpose I try to never do anything clever with c++ which means when I am faced with something like this I am out of my depth :¬(

You may need to put that class that inherits from GoView in a separate project/assembly. You might even need to take it out of your solution, but I don’t know for sure (or for sure I don’t know).

hi thansk for the idea :¬)
Ok seems you are right it all has to be in a separate file
Also seems its bye bye to designtime if i do this, i have to create my views dynamicaly as no way am i going to make a 5 line assembly dll just to override one function.
These are the sort of reasons I stay away from Inheriting from classes if i can
Do you think you would ever consider exposing a few things from the printing side of GoView so we can use our own printDocuments and printPreviews, in the future?
Mac :¬)

Ok I now have MyView instead of GoView and i can see the print document in infragistics print previewer
I am still a bit sad about loosing design time functionality and ease of use just to get at the print document function but… I guess ya cant have everything ya want. :¬)
It just means i have to remember to dynamicaly set so many things like all the many event callbacks and properties etc.
One more thing - printing does not seem to fit the page by default - is there any reason for this?

Do i have to do this myself somehow?
Thanks again

Well, I don’t know about MC++, but certainly for C#, you should be able to design Forms if your GoView subclass is in its own assembly that is not part of the solution that you are building/debugging.
Regarding print-to-fit, check out the FAQ.

Thanks once again

Hi :¬)
My Print To Fit Solution
I found the FAQ code did not take into consideration the user selecting Landscape mode etc.
So here is some C++ code that uses the PrintPageEventArgs and so the landscape mode is automagicaly taken care off

void printDocument1_PrintPage(System::Object * sender, System::Drawing::Printing::PrintPageEventArgs * e)
SizeF docsize=goView->PrintDocumentSize;
float w=(float)(e->MarginBounds.Right-e->MarginBounds.Left);
float h=(float)(e->MarginBounds.Bottom-e->MarginBounds.Top);
goView->PrintScale=Math::Min(w/docsize.Width,h/docsize.He ight);

All the best

dam i got it wrong heheh