|
Try debugging to see the actual values you pass into the function call.
Looking at your code I would say that depending on the size of rcPrintRect the Destination rectangle can have negative width and height. Try hardcoding it for starters and see if it helps.
The documentation for the function states:
If nSrcWidth and nDestWidth have different signs, the function creates a mirror image of the bitmap along the x-axis.
If nSrcHeight and nDestHeight have different signs, the function creates a mirror image of the bitmap along the y-axis.
In other words:
Change:
nXMargin + 5000,
rcPrintRect.top,
rcPrintRect.right - 7500,
rcPrintRect.bottom - 10500,
to:
nXMargin + 5000,
rcPrintRect.top,
100,
100,
Hope this helps
|
|
|
|
|
Thanks it helped me a loat
|
|
|
|
|
it is a matter of the sign (+/-) of the parameters, but take care to print not more than your output DC-size.
In some case also the bits of your image are bottom-top in memory!!! It is an IBM legacy
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Thanks
|
|
|
|
|
what a bad feelings i am, how to hook sendmessage、postmessage and key message on the same time, now i use WM_CALLWNDPROC, but only can hook sendmessage, would you like to help me, thank you very much.
|
|
|
|
|
Try the WH_GETMESSAGE hook.
|
|
|
|
|
thanks, what a clever you are
|
|
|
|
|
what do you really want to do?
I think you can use SetWidnowsLong to replace its original processing function then you can get the first chance to deal with key message.
And for SendMessage and PostMessage, you can just hook the two API function as normal.
|
|
|
|
|
Hello Everyone,
Can anyone please suggest me some tutorials and notes for connecting VC++ 8 with MySql ??
I have 2 pc’s here in one pc I have MySql installed & it’s a sever ,... for using MySql in my PC is it required to install SQL in my PC also ? or I can access the tables directly without installing MySql in my PC ?
I am very much new to both the things …so asking very silly Questions.
Thanking you,
Naveen HS
|
|
|
|
|
|
No you dont need to install MySql server in your PC. I will recommend using MySql++[^].
-Saurabh
|
|
|
|
|
Hi
i have a win32 console application. i need to use an activeX control in my project.
but my project have problem in execution. in calling Create function
COcxClass objmyActivX;
CWnd cw;
objmyActivX.Create(NULL, NULL, CRect(0,0,0,0),cw.FindWindow(NULL,NULL), 0);
my project is a service and i don't need any dialog or window in my project.
please help me
Zo.Naderi-Iran
|
|
|
|
|
Your code declares objmyActivX and cw and then tries to use them before either of them has been initialised to a value.
|
|
|
|
|
the objmyActivX will be initialize with calling Create function.
do i initialize with what value the cw?
Zo.Naderi-Iran
|
|
|
|
|
zon_cpp wrote: the objmyActivX will be initialize with calling Create function.
Not true I'm afraid. You are trying to invoke the Create() method on the objmyActivX object, which has no value. It would appear that you need to spend some time understanding C++ and whatever functionality you are trying to use here.
zon_cpp wrote: do i initialize with what value the cw?
I presume from its declaration this is some window belonging to the application but I don't really understand how this fits in to what you are attempting.
|
|
|
|
|
my project is a win32 console application !!!
in a dialog base project, this code has not any problem. but in win32 console project (win32 console) ...!
i think, the fourth paramet of create funtion is incorrect. but, what is it , the correct of this parameter ?
Zo.Naderi-Iran
|
|
|
|
|
If you had done a search on Google first you could have found this article[^].
|
|
|
|
|
thank you very much.
my time, for this problem, is very few. you helped me, thanks.
and this article: Getting the most out of IDispatch[^], solved my problem.
Zo.Naderi-Iran
|
|
|
|
|
What's wrong with my code to load an image from a file? It doesn't seem to work. Or is it the code to make it into an HDC that causes the problem?
HBITMAP LoadBitmapFromFile(LPCTSTR szFilename)
{
HBITMAP hBitmap = NULL;
hBitmap = (HBITMAP)LoadImage(NULL, szFilename, IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_DEFAULTSIZE);
return hBitmap;
}
HDC userNewHDC;
HBITMAP userNewBitmap;
userNewBitmap = LoadBitmapFromFile("C:\imagefile.bmp");
userNewHDC = CreateCompatibleDC(NULL);
SelectObject(userNewHDC,userNewBitmap);
I then BitBlt the userNewHDC object but it doesn't seem to work. Whats wrong?
|
|
|
|
|
You should check the return values and the error codes using GetLastError() .
|
|
|
|
|
Try using the Debugger to see if LoadBitmapFromFile returns NULL or a valid handle.
You can than use GetLastError() to see what went wrong.
Looking at your code I would say you should change:
userNewBitmap = LoadBitmapFromFile("C:\imagefile.bmp")
to:
userNewBitmap = LoadBitmapFromFile("C:\\imagefile.bmp");
|
|
|
|
|
Omnicoder wrote: It doesn't seem to work.
How are you verifying this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
hi every body,
is it possible to handle voice speech recognizable and saving option in vc++6.0
please help me..
thanks in advance
|
|
|
|
|
Not possible in VC++6.0 unless you install and use SAPI, Just refer [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
Hi,
I utilize Visual C++ 2003 and MFC with document/view architecture..
I want to respond differently when I choose Print from the menu and the Print button from the toolbar. The reason is that I want to select the file to print when I choose from the menu, and I want to print directly the open file when I choose from the Print toolbar button.
How can I do that ?
Thanks,
Claude
|
|
|
|