|
Thanks for that insight. I sort of suspected that most modern monitors and operating systems would be compliant. It is going to be the end user's responsibility to have their system certified, and then do the regular checks that are required.
There is the software for conversion of the xyl values, and there is also software for the performing the color test on a CRT monitor. At the time I purchased my current version of the Presentation Library (2008) they had not yet developed tests for a LCD display. The latest version of the Presentation Library is in transit to me now, and I'm curious to see what changes have been made to the specifications since my 2008 version; and whether they will now have some sort of testing procedure for the LCD monitor. In 2008 it was still under consideration.
The way I see it, I just have to meet the specs; but even that going to be daunting. I don't expect to have this ECDIS system ready for another two years. I have had a navigation program out since 2003 - but it is not ECDIS. There are no electronic navigation charts in my existing system; but it does have background maps (world wide coverage). My latest (as yet unreleased) version is also NMEA 2000 compatible and features extensive networking capabilities. The system also has it's own "line tracking" autopilot built into it; which is great for oceanographic survey work - I hate driving lines day in and day out - it's mind numbing.
I have only recently decided that it was time to take my nav program to the next level; and make it ECDIS compliant.
Again, thanks for checking that out
Cheers!
|
|
|
|
|
Hi Leon,
I have finally found a solution for my problem; and have edited my original post to reflect this. It's not a mathematical solution, but it works well enough.
I just thought I'd give you a heads up since you took an interest
Thanks again for your input!
Keith
|
|
|
|
|
 Quote: After unsuccessfully trying to solve for a mathematical solution for a week I had to try some other way to derive the Gamma Ramp Settings directly from the GetDeviceGammaRamp call.
One early attempt involved a simple iteration of all possible settings. This gave correct results, but it took more than 20 minutes to complete the operation. My application needs to be able to do this in under a second.
I finally found a better, more efficient way to perform the iterations, and it meets my requirements. It may be an imperfect solution; but a win is a win.
I shaved a little more time off of this operation by testing for a positive or a negative curve in the Gamma setting (or no curve at all = neutral setting 10). This saves a few iterations going in. To do this I created two additional functions: PtToPtRngBrg and GetPtFromPt.
If you like, you can skip these; and simply iterate through all possible Gamma settings (2 to 50). This would greatly simplify the code.
Here is my C++ solution...
#define DEG_RAD 0.017453292519943295769236907684886
struct RngBrg{
double rng;
double brg;
};
void __fastcall TForm1::GetGammaRampSettings(void){
double i,j,k,m,m4;
double s1,s2,s3,s4;
double gamma,bright,cntrst,level;
double value;
int d;
int x1,x2,x3,x4;
bool isFound=false;
RngBrg rb;
WORD GammaArray[3][256];
WORD CompArray[256];
double DArray[256];
HDC GammaDC = GetDC( NULL );
GetDeviceGammaRamp( GammaDC, GammaArray );
ReleaseDC( NULL, GammaDC );
for( x1 = 0; x1 < 256; x1++ ){
if( GammaArray[0][x1] > 0){break;}
}
for( x2 = 0; x2 < 256; x2++ ){
if( GammaArray[0][x2] == 65535){isFound=true; break;}
}
if( !isFound ){ x2--; }
s1 = ( (double) GammaArray[0][x1] + 1 ) / 256.0;
s2 = ( (double) GammaArray[0][x2] + 1 ) / 256.0;
x3 = x1 + ( ( x2 - x1 ) / 2 );
s3 = ( (double) GammaArray[0][x3] + 1 ) / 256.0;
Memo1->Lines->Add( "x1 = " + IntToStr(x1) + " s1 = " + AnsiString(s1));
Memo1->Lines->Add( "x2 = " + IntToStr(x2) + " s2 = " + AnsiString(s2));
Memo1->Lines->Add( "x3 = " + IntToStr(x3) + " s3 = " + AnsiString(s3));
PtToPtRngBrg( &rb, x1, s1, x2, s2 );
Memo1->Lines->Add( "rng = " + AnsiString( rb.rng ) +
" brg = " + AnsiString( rb.brg ));
GetPtFromPt(x1, s1, rb.rng / 2.0, rb.brg, &m4, &s4);
Memo1->Lines->Add("m4 = " + IntToStr( Round(m4) ) + " s4=" + AnsiString(s4));
Memo1->Lines->Add("s3 - s4 = " + AnsiString( s3-s4 ));
x4 = Round(m4);
if(( s4 - s3 ) > 1 ){
Memo1->Lines->Add("Negative Gamma Curve");
for( i = 9; i > 1; i-- ){
gamma=i/10;
for( d = 0; d < 256; d++ ){
DArray[d] = ( pow( (double)(d * 256) / 65535, 1 / gamma) * 65535) + 0.5;
}
for( j = 2; j < 101 ; j++ ){
level = 1 + ((j - 50) / 100);
for( k = 0; k < 101; k++ ){
bright = 1 + (((k - 50) / 100) * 65535);
for( m = 0; m < 101; m++ ){
cntrst = 1 + ((m - 50) / 100);
value = (((( DArray[x4] / 65535 ) - 0.5) * cntrst) + 0.5) * 65535;
value = value += bright;
value *= level;
if( value > 65535){ value = 65535; }
if( value < 0 ){ value = 0; }
if( (WORD) value == GammaArray[0][x4] ){
for( d = 0; d < 256; d++ ){
value = ((( (DArray[d] / 65535) - 0.5) * cntrst) + 0.5) * 65535;
value = value += bright;
value *= level;
if( value > 65535 ){ value = 65535;}
if( value < 0 ){ value = 0;}
CompArray[d] = (WORD) value;
}
if(memcmp( &CompArray[0], &GammaArray[0][0], 2*256) == 0){
goto ENDIT;
}
}
}
}
}
}
}else if((s3-s4)>1){
Memo1->Lines->Add("Positive Gamma Curve");
for( i = 11; i < 51; i++ ){
gamma=i/10;
for( d = 0; d < 256; d++ ){
DArray[d] = ( pow( (double)(d * 256) / 65535, 1 / gamma) * 65535) + 0.5;
}
for( j = 2; j < 101 ; j++ ){
level = 1 + ((j - 50) / 100);
for( k = 0; k < 101; k++ ){
bright = 1 + (((k - 50) / 100) * 65535);
for( m = 0; m < 101; m++ ){
cntrst = 1 + ((m - 50) / 100);
value = (((( DArray[x4] / 65535 ) - 0.5) * cntrst) + 0.5) * 65535;
value = value += bright;
value *= level;
if( value > 65535){ value = 65535; }
if( value < 0 ){ value = 0; }
if( (WORD) value == GammaArray[0][x4] ){
for( d = 0; d < 256; d++ ){
value = ((( (DArray[d] / 65535) - 0.5) * cntrst) + 0.5) * 65535;
value = value += bright;
value *= level;
if( value > 65535 ){ value = 65535;}
if( value < 0 ){ value = 0;}
CompArray[d] = (WORD) value;
}
if(memcmp( &CompArray[0], &GammaArray[0][0], 2*256) == 0){
goto ENDIT;
}
}
}
}
}
}
}else{
Memo1->Lines->Add("No Gamma Curve");
i=10;
gamma=1;
for( d = 0; d < 256; d++ ){
DArray[d] = ( pow( (double)(d * 256) / 65535, 1 / gamma) * 65535) + 0.5;
}
for( j = 2; j < 101 ; j++ ){
level = 1 + ((j - 50) / 100);
for( k = 0; k < 101; k++ ){
bright = 1 + (((k - 50) / 100) * 65535);
for( m = 0; m < 101; m++ ){
cntrst = 1 + ((m - 50) / 100);
value = (((( DArray[x4] / 65535 ) - 0.5) * cntrst) + 0.5) * 65535;
value = value += bright;
value *= level;
if( value > 65535){ value = 65535; }
if( value < 0 ){ value = 0; }
if( (WORD) value == GammaArray[0][x4] ){
for( d = 0; d < 256; d++ ){
value = ((( (DArray[d] / 65535) - 0.5) * cntrst) + 0.5) * 65535;
value = value += bright;
value *= level;
if( value > 65535 ){ value = 65535;}
if( value < 0 ){ value = 0;}
CompArray[d] = (WORD)value;
}
if(memcmp( &CompArray[0], &GammaArray[0][0], 2*256) == 0){
goto ENDIT;
}
}
}
}
}
}
Memo1->Lines->Add("Values NOT Discovered - Checking All Values...");
for(i=2;i<51;i++){
gamma=i/10;
for( d = 0; d < 256; d++ ){
DArray[d] = ( pow( (double)(d * 256) / 65535, 1 / gamma) * 65535) + 0.5;
}
for( j = 2; j < 101 ; j++ ){
level = 1 + ((j - 50) / 100);
for( k = 0; k < 101; k++ ){
bright = 1 + (((k - 50) / 100) * 65535);
for( m = 0; m < 101; m++ ){
cntrst = 1 + ((m - 50) / 100);
value = (((( DArray[x4] / 65535 ) - 0.5) * cntrst) + 0.5) * 65535;
value = value += bright;
value *= level;
if( value > 65535){ value = 65535; }
if( value < 0 ){ value = 0; }
if( (WORD) value == GammaArray[0][x4] ){
for( d = 0; d < 256; d++ ){
value = ((( (DArray[d] / 65535) - 0.5) * cntrst) + 0.5) * 65535;
value = value += bright;
value *= level;
if( value > 65535 ){ value = 65535;}
if( value < 0 ){ value = 0;}
CompArray[d] = (WORD) value;
}
if(memcmp( &CompArray[0], &GammaArray[0][0], 2*256) == 0){
goto ENDIT;
}
}
}
}
}
}
Memo1->Lines->Add("Values Still NOT Discovered!!!");
Memo1->Lines->Add("Discovery Operation Failed.");
return;
ENDIT:
Memo1->Lines->Add("Bright = " + IntToStr((int)k));
Memo1->Lines->Add("Cntrst = " + IntToStr((int)m));
Memo1->Lines->Add("Level = " + IntToStr((int)j));
Memo1->Lines->Add("Gamma = " + IntToStr((int)i));
}
short __fastcall TForm1::Round(double flt){
short num=(short)flt;
if(flt>=0){
if(flt-num>=.5){num++;}
}else{
if(flt-num<=-.5){num--;}
}
return(num);
}
bool __fastcall TForm1::PtToPtRngBrg(RngBrg *rb,double x1,double y1,double x2,double y2){
rb->rng=0;rb->brg=0;
double diffx,diffy,dangle;
if(x1>=x2){
if(x1>=0&&x2<0){diffx=x1+fabs(x2);}else{diffx=x1-x2;}
}else{
if(x2>=0&&x1<0){diffx=x2+fabs(x1);}else{diffx=x2-x1;}
}
if(y1>=y2){
if(y1>=0&&y2<0){diffy=y1+fabs(y2);}else{diffy=y1-y2;}
}else{
if(y2>=0&&y1<0){diffy=y2+fabs(y1);}else{diffy=y2-y1;}
}
if(diffx==0){
rb->brg=0;rb->rng=y2-y1;
return true;
}
if(diffy==0){
rb->brg=90;rb->rng=x2-x1;
return true;
}
dangle=atan(diffy/diffx);
rb->rng=diffx/cos(dangle);
dangle=dangle/DEG_RAD;
rb->brg=90-dangle;
return true;
}
void __fastcall TForm1::GetPtFromPt(double x, double y,double rng,double brg,double *x2,double *y2){
if(brg>=360){brg-=360;}
if(brg<0){brg+=360;}
if(brg==360||brg==0){*x2=x;*y2=y+rng;return;}
if(brg==270){*y2=y;*x2=x-rng;return;}
if(brg==90){*y2=y;*x2=x+rng;return;}
if(brg==180){*x2=x;*y2=y-rng;return;}
if(brg<90){
*x2=x+(rng*cos((90-brg)*DEG_RAD));
*y2=y+(rng*sin((90-brg)*DEG_RAD));
return;
}
}
|
|
|
|
|
Hi,
I am getting around to using a printer direct. It is a Steep Learning Curve! Prior to this, I produced Text Files, which could be Printed via Notepad.
Grabbed the Bull by the Horns, Want to print Straight from the Program.
I am using MFC42. The Target Machines are Win XP-SP1. (None are Internet Enabled, The System is Outside the Internet)
The Second Hand Win 8 computer I use to write on, has a Device Driver for an HP Printer. All goes well, until I hit the Print button in the Print Dlg. Then everything crashes.
End up After the Crash with a Dlg to tell me in very many words that the printer device could not be found!
Now, I know that there is no physical printer attached to my machine, but, there should be a more graceful idea of notifying me about that fact, other than crashing.
For Instance, Can I query the CDC about a Printer being Plugged In, etc.
Kind Regards,
Bram van Kampen
|
|
|
|
|
Are you using CPrintDialog Class[^] to get the details of the printer? If you do not have a physical printer attached you can use the MS XPS writer, or if you have a PDF print application installed you can use that.
|
|
|
|
|
Well, Thanks Richard.
I worked the sample given by Chris Mauder on the MFC Forum about Printing without the Document-View Architecture. I use the CPrintDialog to obtain a pointer to a device Context, presumably in my case pointing to a HP Printer,(Apparently Installed by the Previous Owner of the Laptop) and all appears to work well. I retrieve a (pointer to) a CDC from the CPrintDialog, and the Pointer is Not NULL.
The Only thing is that there is no HP, (or, any) Printer Plugged In. (It is my Coding Laptop) My experience with say 'MS Office' is, that when the printer is not actually plugged in at the time, that the job gets spun off to the print spooler where it remains until that printer becomes available.
Is this a Feature of the Windows Print Spooler, or, a Feature of 'MS Office'?
The result in my case is a very major Foul Up, and, Minutes Later, a Message from the HP Driver that the Device cannot be found, complete with Major Advice to check Cable Connections, and a Range of Other Things.
Now, on Further Reflection, (time for quiet reflection is something that we are unlikely (and Unwisely) allow to afford ourselves when hunting for Bugs.)
It may well be that the HP Printer Driver is corrupted. My Coding Laptop is not on the Internet for obvious reasons.(Installation of the "Ms Dev Studio97" on a Win7 Computer gives an Immediate alarm under 'IsGenuine' for the OS)
I'll try to install another printer driver, (from a CD), and see how it goes.
I am ashamed to say that I have avoided Printing for the last 25 years, actually, since my Dos Days.
I have decided to bite the bullet on this Application.
I Dealt with printing in the past by sending things to a Text File, and to use NotePad, when a Printout was needed.
Also, seeing that I only need to print only a few pages, mostly One A4, sometimes 2 or 3, I did not go to the complication of doing this in a Worker Thread. I want to learn how to Crawl, before trying to learn how to Run.
Would this have an Impact. Chris Mauder's example did not mention threads.
The thing is, when things go wrong, and, especially in a for me a New and crucial Field, is: Am 'I' doing something Wrong, or Misunderstanding Something.
Once Again, thanks for your response, Richard.
I'll keep you posted on how I get on.
Bram van Kampen
|
|
|
|
|
Bram van Kampen wrote: Is this a Feature of the Windows Print Spooler, or, a Feature of 'MS Office'? That's the spooler, which will try to send the file to the print driver. The driver may then pop up a dialog to say the printer is offline. In all my experience the file will remain in the spooler until it gets printed, or the user cancels it. What you call a major Foul Up sounds like normal behaviour. As I said before, you should have the Windows XPS print driver (creates an XPS file) installed so you can test with that.
|
|
|
|
|
He is using XP SP1. That does not has the XPS driver and installing it requires probably a higher SP version.
But using a PDF driver as already suggested by you should do the trick.
|
|
|
|
|
But using Win 8 for development.
|
|
|
|
|
You are right. I missed that.
|
|
|
|
|
That's OK, I missed the XP bit. 
|
|
|
|
|
|
Bram van Kampen wrote: The XPS File I got was,in Binary. As you would expect, since it also includes formatting information about the content. I have used this to test printing in my applications, and never had a problem. I guess you need to look at your actual printing code.
|
|
|
|
|
Well,
The Binary I get refuses to open.
Here is my Printing Code:-
void CConfirmOrdersStep1Dlg::OnPrint()
{
if(CreateViewForPrinting()==false){
AfxMessageBox("No Orders have been Marked for Printing");
return;
}
CDC dc;
CPrintDialog printDlg(FALSE);
<pre>
if (printDlg.DoModal() == IDCANCEL) return;
dc.Attach(printDlg.GetPrinterDC()); dc.m_bPrinting = TRUE;
CString strTitle="Old Orders";
// strTitle.Format("Date:Confirming Old Orders By:- %s-%s", UserName,Date);
DOCINFO di;
memset(&di, 0,sizeof (DOCINFO));
di.cbSize = sizeof (DOCINFO);
di.lpszDocName = strTitle;
BOOL bPrintingOK = dc.StartDoc(&di);
CPrintInfo Info;
Info.m_rectDraw.SetRect(0,0,
dc.GetDeviceCaps(HORZRES),
dc.GetDeviceCaps(VERTRES));
OnBeginPrinting(&dc, &Info);
UINT page;
for (page=Info.GetMinPage(); page <= Info.GetMaxPage() && bPrintingOK;page++){
dc.StartPage();
Info.m_nCurPage = page;
PrintPage(&dc, &Info);
bPrintingOK = (dc.EndPage() > 0);
}
OnEndPrinting(&dc, &Info);
if (bPrintingOK)
dc.EndDoc();
else
dc.AbortDoc();
dc.DeleteDC();
}
// As from Chris Mauder.
// Instead of Global I made it a member
//
// m_pView (Type COrderPageView) contains a list of PageFragments
// The Fragment at index 0 is the header, to be printed at the Top
// of each Page (Customer Details, etc)
// CondensePages() does Nothing for Now.
//
// Anyways, This Works, as I can successfully print the Page to a Text
// File.
void CConfirmOrdersStep1Dlg::OnBeginPrinting(CDC * pDC, CPrintInfo * pInfo)
{
// Set the Font to "CourierNew"
CFont PrinterFont;
if(!PrinterFont.CreatePointFont(
100,
"Courier New",
pDC)){
ASSERT(NULL);
return;
}
CSize Size=pDC->GetTextExtent("AAAA",4);
m_nCurrentPrintRectWidth=Size.cx*10;
m_nCurrentLineHeight=Size.cy;
int PageHeight=pInfo->m_rectDraw.Height();
m_nLinesPerPage=PageHeight/m_nCurrentLineHeight;
m_pView->CondensePages(m_nLinesPerPage);
}
/////////////////////////////////////////////////////////////////
//
// This is where we print, First the Header, and thereafter the Page Content
void CConfirmOrdersStep1Dlg::PrintPage(CDC * pDC, CPrintInfo * pInfo)
{
int PageNumber=pInfo->m_nCurPage;
m_nCurrentPrintRectTop=0;
COrderPageView* pView=(COrderPageView*)m_pView->GetDataFromIndex(0);
PrintDocFragment(pView,pDC);
COrderPageView* pOrder=(COrderPageView*)m_pView->GetDataFromIndex(PageNumber);
PrintDocFragment(pOrder,pDC);
}
void CConfirmOrdersStep1Dlg::OnEndPrinting(CDC * pDC, CPrintInfo * pInfo)
{
}
// We Create a List of Set of lists of 40 char wide strings
// The First Item in this List is the Header, specifying the
// Customer Details
// The remaining items contain Order Details for the Same Customer
// This Part Works, As is shown by 'DumpToTextFile()'
bool CConfirmOrdersStep1Dlg::CreateViewForPrinting()
{
delete m_pView;
m_pView=new COrderPageList();
int i;
int ItemCount=0;
for(i=0;i<m_clist.getcount();i++){
if(m_clist.getcheck(i)="=1)ItemCount++;
" }
="" if(itemcount="=0)return" false;
="" tag_str_customer*="" pcust="m_pNode-">pCustomer;
COrderPageView* pPageHeader=new COrderPageView(NULL,40);
pPageHeader->m_pCustomer=m_pNode->pCustomer;
pPageHeader->PrintPageHeader();
m_pView->AddReference(pPageHeader);
for(i=0;i<m_clist.getcount();i++){
if(m_clist.getcheck(i)!="1)continue;
" int="" index="((int)m_cList.GetItemData(i))-BIAS;
" lpstr_order="" po="(LPSTR_ORDER)m_pOrderList-">GetDataFromIndex(Index);
COrderPageView* pPageView=new COrderPageView(pO,40);
pPageView->PrintOrderBody();
m_pView->AddReference(pPageView);
}
ifdef _DEBUG
m_pView->DumpToTextFile();
endif
return true;
}
///////////////////////////////////////////////////////////////////////////////
//
// THIS IS WHERE THE RUBBER MEETS THE ROAD!
//
// We Are Committing a Set of Lines of Text in an Incrementing
// List of adjusting Rectangles.
int CConfirmOrdersStep1Dlg::PrintDocFragment(COrderPageView * pView, CDC * pDC)
{
ASSERT(pView);
ASSERT(pDC);
int i;
for(i=0;i<pview->GetItemCount();i++){
RECT DrawingRect;
DrawingRect.left=0;
DrawingRect.top=m_nCurrentPrintRectTop;
m_nCurrentPrintRectTop+=m_nCurrentLineHeight;
DrawingRect.right=m_nCurrentPrintRectWidth;
DrawingRect.bottom=m_nCurrentPrintRectTop-1;
LPCSTR DrawingText=(LPCSTR)pView->GetDataFromIndex(i);
pDC->DrawText(DrawingText,-1,&DrawingRect,DT_LEFT);
}
return i;
}
Getting Desparate at this stage. I Guess I am doing something trivial wrong.
Thanks + Regards,
Bram van Kampen
|
|
|
|
|
Well I just Notice, I forgot to Select the Font into the Printer Device Context.
That would of course have an impact!
Can anyone spot other errors?
Bram van Kampen
|
|
|
|
|
Bram van Kampen wrote: The Binary I get refuses to open. Not sure what that means, or what is missing. If you do not select the font into the DC then it will just use a default, so you should still see some output. Given that this is Chris's original code, you may want to try talking to him.
|
|
|
|
|
Wel,
I get a Binary File not recognised by the XPS Reader.
I can open it as Binary in a HexVieuwer, and get nothing recognisable.
Bram van Kampen
|
|
|
|
|
When I look at an XPS print file it looks something like:
PK µC'I Metadata/Job_PT.xmlíW]s¢H}ߪý)Þ' &Ùh%NÝ4ZÁØ }Cè`|
´¢óë÷¶ã̬‰™™§éòš{Îážþ¸póqGgK–<Mn•ʹ¦œ±ÄOž„·Š3l¸V>6ÿþë&+žƒœ'bÈý9gKŠöÞ*3!²†ªþŒÅ^qs?O‹ôIœûi¬–< Ò²P«šVSµk5"H¾=Øbžr/fešÏ•íªà{Ú²,ÏËÚyš‡’£¢>š÷öõ'…🽠‚·QÊA²ÏÀ¤Ð°žÈ•ŠŸÿJdÎÖ˜FP¨{è*
which is fine, and the XPS reader opens it OK.
As to why you cannot read yours is a total mystery. If you are using all the standard APIs (or their MFC equivalents) to create your print files, then they should at least be readable.
Try changing the extension from .xps to .zip and have a look at the content then.
|
|
|
|
|
Hi, Richard,
Well, if it opens in your machine , there is evidently something wrong with my reader, and nothing wrong with the code I wrote to generate same.
I'm away on a break for a few days. I had my 62nd Birthday 3 weeks ago, but, were unable to escape. We are trying enjoy life in semi retirement, with a small important money spinning business running in the background, powered by my software.
I appreciate your comment, and will try changing the XPS ext to ZIP when I'm back.
I Think that you know that I write software for Laundrettes and Dry-Cleaners, specifically for our own chain.
There are No Trade or Other secrets buried in the Text Example I Sent. It is a Fictitious Customer with a Fictitious ancient Order. (The Bane of a laundrette is people not coming back to pay and collect, It Clogs up the shop, the work is done, but, the Till does not ring. )
The Program I am writing now, is a concerted attempt to attack this, by contacting customers. The First step there is, to ensure that ancient Orders that appear on the database, are still present in the shop. Whereas we Trust our staff, an order could have been given out, without the order being rang in, the staff pocketing the sale, and the Item remaining on the Database. At any rate, we do not want to contact customers over long forgotten items, when we no longer poses them, for whatever reason.
It also gives staff an other activity at quiet Times. Instead of drinking cups of tea, they have a Screen of alternative, and More Productive activity. Making Phone Calls, and finding People's goods. If people's goods can not be found, then there is no point in ringing the customer. Let sleeping dogs lie, and Management writes the item off. We tried it manually, and got things like "Oh I forgot about that, I will collect it next Saturday" Saturday came and went, we all forgot, order still here. This new program will pursue only say 10 old orders at the time, but these orders will be pursued vigorously.
Items Promised to be Collected By a date, will disappear of the ToDo List, but, will re-appear there after that date, if at that stage not collected and paid.
The Interface is being designed so that Junior Staff can handle it, kicking major decisions back upstairs. The Document I tried to print was a form, for staff to go around the shop, and find the goods. The First Step.
When you Opened the XPS File, could you read the Text as Follows:-
Finding Old Orders in the Shop
Printed by <????> on 01 09 16 - 23:40:14
Customer:-
TONY LOUGHLIN
If The Item(s) are Found you should
Update the Computer Record, and
Destroy this Page!
Otherwise Inform Management of the
Discrepancies, by Returning this Page
Marked Up Accordingly!
Order Nr 214058
Received on: 27/07/12 - 13:18:21
Not Confirmed Present since Completion
Qty Description Amount
1 lb Wash +Dry £11.00
========
Total For Order £11.00
Due for This Order £11.00
Packaging:- -1Wb
========================================
<pre>
Actually Found:-
Hangers Pastics Flatpacks WashBags
+-+ +-+ +-+ +-+
| | | | | | | |
| | | | | | | |
| | | | | | | |
+-+ +-+ +-+ +-+
========================================
Please let me know If you Did.
It means in that case: "Programming Problem Solved"
Thanks and Regards,
Bram van Kampen
|
|
|
|
|
Hi Bram, well I'm a few years older than you, so in theory I should have more knowledge locked in my brain. But you know what they say about theory and practice.
When I said I could open the XPS file, I meant one that I generated here. If you can send me the one you generate I could have a look at it for you. Send me a private email and I can give you an address, or put it up on one of the public staging sites.
|
|
|
|
|
I am not sure that you should be calling CView::OnBeginPrinting[^] in your code. That function will be called by the framework when printing is initiated.
|
|
|
|
|
I have a custom rotary slider control inheriting from CSliderCtrl. Its own behaviour is fine, it displays as I want, responds to mouse dragging and rotates just as it should. Then I want to interact with it from its parent dialog and the problems start.
I had imagined that I would just have to trap the ON_VSCROLL message to obtain its value as it changes. (It is set up with Orientation: Vertical though I have tried Horizontal too.) I can't trap ON_VSCROLL or ON_HSCROLL with either setting. I have tried catching NM_RELEASEDCAPTURE and can't get that either. I have:
BEGIN_MESSAGE_MAP(CNewPatchDlg, CDialog)
ON_WM_HSCROLL()
ON_WM_VSCROLL()
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_VOLUME, OnReleasedCapture)
END_MESSAGE_MAP()
in my dialog message map and
void CNewPatchDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
void CNewPatchDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
void CGm36NewPatchDlg::OnReleasedCapture(NMHDR* pNMHDR, LRESULT* pResult)
declared and defined in my dialog .h and .cpp files. They exist as temporary function stubs with a little junk code in there to just see whether I can hit breakpoints in the functions. None get hit.
In the dialog editor the wizard shows only four control events available for the control, NM_CUSTOMDRAW, NM_OUTOFMEMORY, NM_RELEASEDCAPTURE, NM_THEMECHANGED. I expected to see more than that! I would have thought at least I could have accessed ON_VSCROLL via the wizard though a standard CSliderCtrl shows the same four options.
I know sometimes these controls can be a little eccentric but I thought this would be pretty plain sailing. I've dug around and found a couple of suggestions that I'm not the only person to have this issue with a Custom slider but no one seems to have a solution, only to use ON_HSCROLL or ON_VSCROLL which I can't seem to do. This must be something very simple I am seeing wrong. Can anyone suggest what I am missing?
|
|
|
|
|
|
I found that Richard, MSDN is the first thing I go to. There is a wealth of stuff with examples (that actually are only part complete) in there. None of it seems to work!
From your link:
Quote: A slider control notifies its parent window of user actions by sending the parent WM_HSCROLL or WM_VSCROLL messages, depending on the orientation of the slider control. To handle these messages, add handlers for the WM_HSCROLL and WM_VSCROLL messages to the parent window. The OnHScroll and OnVScroll member functions will be passed a notification code, the position of the slider, and a pointer to the CSliderCtrl object.
It just seems to back up everything I have done so far. I am trying unsuccessfully to catch the ON_HSCROLL and ON_VSCROLL messages in the parent wiondow just as MS says. I know I can parse out the info once I have caught the message, it's getting the message to land that I can't do even though I seem to be doing exactly what they say.
|
|
|
|
|
AlbertB wrote: MSDN is the first thing I go to Unfortunately so many of our posters do not.
Looking at CDialog, it does not look like it implements the OnXScroll methods, so one wonders whether it just ignores scroll messages. I'm not sure quite how to get round that (years since I did MFC), but in Win32 I would probably subclass the Dialog control and use my own message handler.
|
|
|
|
|