|
As with all problems, debugging is the key.
|
|
|
|
|
This is the exception 0x4001000A
This is a new exception Microsoft implemented in Windows 10 something to do with OutPutDebug String though I have that in program I check isdebuggerpresent so dont know why it was raised
This is what I saw when googling
Quote: Windows creates a new exception with RaiseException: DBG_PRINTEXCEPTION_WIDE_C (0x4001000A). This new exception code needs 4 parameters. For backwards compatibility it also requests the Ansi version of the string
This is what I added to my SEH handler
if (pExceptionPtrs->ExceptionRecord->ExceptionCode == 0x4001000A)
return EXCEPTION_CONTINUE_EXECUTION;
|
|
|
|
|
|
Hi
I am still on the red bullet bitmap. What I have been trying to do is change the color of the surrounding rectangle from white to gray. to match the background of where I bitblt to
I have used CImage to load it Create it.
When I try to access the header info such width and height I get the right values back even including the bitbitcount there are 8 bits to represent a pixel (256 colors)
However I when use methods such as GetColorTable or Getbits and look at pointers returned it is all hex zeros.
I have opened the file with hex editor and can see it anything but returned. I am trying to get to the pixels represented by white RGB(255,255,255) I know there can be shades of white and turn it into
Gray(0XD3,0XD3,0XD3) to match the background of where I have bitblt (place it) it to
|
|
|
|
|
It is hard to guess how you has implemented it without seeing your code.
|
|
|
|
|
Richard
When I did the Create instead of DDX and I used the dimensions of CDialog I mean Did a GetClientRect from the Dialog and deflated the left side used that rect to Create the richedit
The bitmap then came out on the frame of the dialog MY X location is 0 I thought its 0 of windows Client Area not Window itself which includes the frame
|
|
|
|
|
Reply to one of his posts so he gets a notification you posted something.
DO NOT create a new thread. NOw you're just hoping (the correct) Richard comes along and realizes it's for him. There's no notifications to anyone that you posted this.
|
|
|
|
|
Hi
I have a CrichEditctrl which I am using to display code (as in debugger). When the User whishes to place a breakpoint I TransparentBlt a red bitmap to the left In order to give GDI it own space DeflateRect the Richedit Rect (for the text ) to the left and RcihEdit::SetRect the new smaller size for richedit, Placing the bitmap everything looks fine
However when my code reaches to where the breakpoint was set I highlite the line of code with SetSel and SetSelectionCharFormat this has the effect of wiping out the top of the red bullet bitmap which I dont understand Since the SetRect should ensure that it doesnt go out of the rect bounds. I know rich edit has an OLE interface (which can display bitmaps) however with that too I had problem as the bullet shifted the text
Thanks
|
|
|
|
|
Not able to see the message on the message board saw the email)
|
|
|
|
|
Sorry about that, it was not appropriate to the specifics of your question.
I cannot remember if you are using MFC or not. If you are then perhaps create your own class that inherits from the RichEdit class. If not then you could use the SubClassWindow function to get control of Windows WM_xxx messages and so modify what gets displayed.
|
|
|
|
|
I am using MFC wondering if by that you mean WM_PAINT or in my case the OnPaint message handler to ensure bitmap is intact
|
|
|
|
|
I cannot suggest anything more without spending hours analysing your code. Which is not an option, sorry.
|
|
|
|
|
I understand I am going to try one more thing all this time I have been using DDX to create the window handle to the richedit. and using the control id it would pick the rect value from the resource file
This in a way doesnt make sense. I am going to do a GetClientRect for the parent dialog deflat the recct on the left side then instantiate the Richedit with new and Call the Richedit Create to Create the
the richedit with smaller rect
|
|
|
|
|
Richard
For my GDI display I need the number of rows equal to same number as the original Client suffice on column is enough
|
|
|
|
|
|
thanks going try one more thing before bypassing richedit's coloring capabilities
|
|
|
|
|
# include <stdio.h>
# define scanf "%s me "
main()
{
printf(scanf, scanf);
getchar();
return 0;
}
|
|
|
|
|
Didn't you try to compile/test it?
|
|
|
|
|
You already have the answer on your repost of this:
Please give me explanation of this code.[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I don't have a physical printer, so I cannot test (Am I wrong here?)
I'm trying to print something (a bitmap) using MFC.
I set my default printer to "Microsoft Print To PDF" in Windows 10 settings.
I have a skeleton code like this :
The GetDefaults() fails.
Am I missing something ?
Obviously, other print commands in other software work (VS, Word, Chrome... )
{
CPrintDialog dlg(FALSE);
if (!dlg.GetDefaults())
{
AfxMessageBox(_T("You have no default printer!"));
}
else
{
CDC dc;
dc.Attach(dlg.m_pd.hDC);
}
}
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
You don't need the CPrintDialog if you already know the printer name.
Just use something like
HANDLE printerHandle = nullptr;
TCHAR name[] = _T("Microsoft Print To PDF");
if (!::OpenPrinter(name, &printerHandle, nullptr))
{
...
}
|
|
|
|
|
the problem is not the device name, but GetDefaults not returning the default printer.
Obviously, it should work for any device.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
Max,
The default constructor is in the documentation[^]:
CPrintDialog(
BOOL bPrintSetupOnly,
DWORD dwFlags = PD_ALLPAGES | PD_USEDEVMODECOPIES | PD_NOPAGENUMS | PD_HIDEPRINTTOFILE | PD_NOSELECTION,
CWnd* pParentWnd = NULL);
The default constructor does not contain PD_RETURNDEFAULT. You will need to use the PD_RETURNDEFAULT flag[^] to get the CPrintDialog class to simply return the default printer. In fact by using this flag the DoModal(); function won't even open a window.
CPrintDialog dlg(FALSE,PD_RETURNDEFAULT,NULL);
dlg.DoModal();
LPDEVMODE lpdev = dlg.GetDevMode();
MessageBox(lpdev->dmDeviceName,0,0);
Windows 10 makes decisions for the novice users. So Windows 10 will sometimes decide which printer to use and override the user choice. To disable this programmatically you could set the HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\LegacyDefaultPrinterMode to TRUE.
Best Wishes,
-David Delaune
|
|
|
|
|
lol, thanks.
I should really pickup this technical skill of RTFM.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|