|
Are you including windows.h explicitly somewhere?
Also make sure you have something like this before any MFC header file includes...
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
#endif
Even if you get past this, the MFC included with the platform SDK is from VC 6.
If you get it to compile and run on 2005 express you will be the first I believe.
Even then, you'd be using MFC version 4.x
|
|
|
|
|
that didn't help.... the same problem persists and this what it points to when I compile and it gives me that error
#ifdef _WINDOWS_
#error WINDOWS.H already included. MFC apps must not #include <windows.h>
#endif
|
|
|
|
|
|
Hi,there
I'd like to load a JPEG picture onto a DirectDraw7 surface. For parsing the JPEG, I have used GDI+, the code like this:
Bitmap bitmap(L"F:\\images\\CIMG1531_1.jpg");
g_width = bitmap.GetWidth();
g_height = bitmap.GetHeight();
//create surface, load image
DDSURFACEDESC2 ddsd2;
INIT_STRUCT(ddsd2);
ddsd2.dwFlags = DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT;
ddsd2.dwWidth = g_width;
ddsd2.dwHeight = g_height;
ddsd2.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN|DDSCAPS_VIDEOMEMORY;
if(FAILED(g_lpdd7->CreateSurface(&ddsd2, &g_lpddsSecond, NULL)))
return -1;
HDC hDC;
if(SUCCEEDED(g_lpddsSecond->GetDC(&hDC)))
{
Graphics graphics(hDC);
graphics.DrawImage(&bitmap, 0, 0);
g_lpddsSecond->ReleaseDC(hDC);
}
when the picture is small, the code works fine. otherwise, there's only a part of the picture could be display! The test picture has a resolution of 2990*2000, it's big, the problem occurs.
when I change the code like this:
ddsd2.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY;
to create the surface in system memory, the area displayed increased, but not all yet.
|
|
|
|
|
How are you displaying it once you've drawn it on the surface?
What video mode?
|
|
|
|
|
this is the drawing code:
RECT dest, src;
dest.left = pt.x+100;
dest.top = pt.y+50;
dest.right = pt.x + 400;
dest.bottom = pt.y + 350;
src.left = 0;
src.top = 0;
src.right = g_width-1;
src.bottom = g_height-1;
g_lpddsPrimary->Blt(&dest, g_lpddsSecond, &src, DDBLT_WAIT, NULL);
g_lpddsPrimary is the primary surface
video mode?sorry I don't know what you mean
|
|
|
|
|
giant_hao wrote: video mode?sorry I don't know what you mean
I meant display mode. I asked just in case you were trying to draw 2990x2000 image on 1280x1024
display without stretching.
I would think your code should work.
Perhaps Creating Wide Surfaces[^] is an issue
since you are creating an offscreen surface larger than the primary..(?)
Also what happens if you try this (keep the aspect ratio of the src image)...
RECT dest, src;
dest.left = pt.x+100;
dest.top = pt.y+50;
dest.right = dest.left + (g_width / 10 - 1);
dest.bottom = dest.top + (g_height / 10 - 1);
src.left = 0;
src.top = 0;
src.right = g_width-1;
src.bottom = g_height-1;
g_lpddsPrimary->Blt(&dest, g_lpddsSecond, &src, DDBLT_WAIT, NULL);
|
|
|
|
|
Does anyone know how to implement "Right Click-->Copy to Clipboard-->Ctrl-V" with CListCtrl control.
I would like the functionality of copying the contents of a CListCtrl into Word editor.
Thanks,
cy163
-- modified at 18:27 Saturday 25th November, 2006
|
|
|
|
|
See Clipboard: Copying and Pasting Data on MSDN...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Do you want to copy the entire contents of the CListCtrl into the clipboard or the item on which the user is clicking? In either case, if you have a Control variable of the CListCtrl, then you could get the contents. Then just copy that into memory by using SetClipboardData() function.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Thank you for your hints. However, I am new to MFC. Would you please to be more specific.
(1) How to bring up a pop=up menu by right-clicking over a CListCtrl control.
(2) How to get the contents.
Thanks in advance
|
|
|
|
|
I have been searching for the answer to the captioned question for a long time.
anyone can help.
|
|
|
|
|
F5
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
I mean how to jump to previous / next breakpoint in editoring mode instead of debugging mode. I have tried with F5 , it did not work at.
|
|
|
|
|
i think jumping to the previous breakpoint is something that you cannot do.
|
|
|
|
|
I mean how to jump to previous / next breakpoint in editoring mode instead of debugging mode. I have tried with F5 , it did not work at.
|
|
|
|
|
Ctrl-B to open the Breakpoints dialog and you get a list of breakpoints at the bottom of the first page. Click Edit code to go to the source code for each one.
Less than ideal but I think it's the best you've got.
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2.4 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
I don't see any built-in commands to cycle through breakpoints like that. (The ealier answer of F5 was a joke)
|
|
|
|
|
please help me to know how to display the x-y coordinates of the serial port mouse on dialog box in visual c++ and mfc application.
thanx
ahmad al-omar
|
|
|
|
|
You may override the CWnd::OnMouseMove handler.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Handle the WM_MOUSEMOVE event and use the GetCursorPos() function.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
thanx alot but really i dont know where or how can i add GetCursorPos() in my MFC program
ahmad al-omar
|
|
|
|
|
GetCursorPos()
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
thanx alot but really i dont know where or how can i add GetCursorPos() in my MFC program
ahmad al-omar
|
|
|
|
|
ahmad al-omar wrote: i dont know where or how can i add GetCursorPos() in my MFC program
It's really easy, Open your favorite web browser, navigate to msdn.microsoft.com[^], type GetCursorPos into the search bar in the upper right hand side of the page and click the search button. A new webpage will be presented to you with a variety of different links mostly relating to the topic of GetCursorPos. Read up and enjoy.
The second or third link is GetCursorPos Function[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|