|
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:
|
|
|
|
|
I Made a project in vc++ and Mysql, i write my code at vc++ button and when i compile there is no error and when i build code ( There is not linking error) but at last
when i run the application an messageBox display and say
libmysql.dll can not find and terminate the execution of program
Note : In my system \\mysql\bin\libmysql.lib exist
How can i solve this problem
can any one tell me this
Yogendra Kaushik
mailing me
|
|
|
|
|
You also need the libmysql.dll . Moreover you need the Loader knows about libmysql.dll path, (MSDN):
[...] Windows then searches for the DLLs in the following sequence:
- The directory where the executable module for the current process is located.
- The current directory.
- The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
- The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
The directories listed in the PATH environment variable.
Note that the LIBPATH environment variable is not used.
hope that helps...
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.
|
|
|
|
|
Hi, I'm using MSVC6 and using MFC dialog based application.
The combo box will contain different types of items. Therefore, by choosing one of the items listed in the combo box, i will be able to send appropriate data to the hardware to do the testing process. Below is a sample code that i got:
<code>enum CircuitType {Type1, Type2, Type3};
std::map<CircuitType, std::string> assocs;
assocs[Type1] = "c:\\myfiles\\file1.dat";
assocs[Type2] = "c:\\myfiles\\file2.dat";
assocs[Type3] = "c:\\myfiles\\file3.dat";
int index1 = pCombo->AddString("Type1");
pCombo->SetItemData(index, Type1)
int index2 = pCombo->AddString("Type2");
pCombo->SetItemData(index, Type2)
int index3 = pCombo->AddString("Type3");
pCombo->SetItemData(index, Type3)
int sel = pCombo->GetCurSel();
if(sel == CB_ERR)
return;
CircuitType type = (CircuitType)pCombo->GetItemData(sel);
std::map<CircuitType, std::string>::const_iterator pos = assocs.find(type);
if(pos != assocs.end())
{
// the key is in the map
std::string path = pos->second;
}
</code>
however this codes generates error such as:
error C2039: 'map' : is not a member of 'std'
error C2065: 'map' : undeclared identifier
error C2275: 'CircuitType' : illegal use of this type as an expression
error C2065: 'assocs' : undeclared identifier
error C2275: 'std::string' : illegal use of this type as an expression
and many more....
May what is causing the problems?
Thanks in advance
|
|
|
|
|
Have you included the header files for those classes? <map> and <string>
|
|
|
|
|
hi,
Is it correct to just add "using namespace std;" in the header file?
However, this does not seem to correct the problem. So i guess i'm wrong.
As i was finding for solution i found an articlehttp://www.codeproject.com/cpp/cppforumfaq.asp[^][^]and if u look in the problem listed in 2.2 as below:
2.2: I'm trying to call a Windows API, but the compiler gives an undeclared identifier error (C2065). Why? (top
May i know whether this may be the cause of my problem?
Apart from that, may i know what is the class for map and string and how to declare it in the codes. Hope that you can help as i'm a beginneer here.
Thanks
|
|
|
|