|
You can use the new operator...
See this[^] thread for more info.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I'm currently trying to implement a pan function for panning images which are displayed in a picture control area (drawing with GDI+).
I've managed to change the mouse cursor, it should be a hand when the cursor is over the picture control and an arrow everywhere else. A part of that seems to work. I check if the mouse position is inside the area of the picture control but somehow the area "thinks" it's startpoint (upper left) is located @ x: 0 y: 0; in fact it is placed somewhere in the middle of the dialog box.
Here is the snippet:
void CTrackAndTraceDlg::OnMouseMove(UINT nFlags, CPoint point)
{
HCURSOR hcur = NULL;
CRect rc;
m_pictureControl.GetClientRect(&rc);
rc.NormalizeRect();
POINT MousePosition = point;
BOOL isOnPictureControl = PtInRect(&rc, MousePosition);
if(isOnPictureControl && m_bPicLoaded && hcur == NULL)
{
hcur = LoadCursor(AfxGetApp()->m_hInstance,(LPCTSTR)IDC_CUR_PAN);
SetCursor(hcur);
}
else
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
hcur = NULL;
}
CDialog::OnMouseMove(nFlags, point);
}
As you see I get the rectangle from the m_pictureControl (which is a var for the Picture Control on the dialog). But why it gives back the wrong x,y -> the rc.Width and rc.Height are correct.
Any ideas?
Thx, Shi
|
|
|
|
|
can u just put your query into different words such that, they are more cleaar to understand?
|
|
|
|
|
in short:
- I'm using a Picture Control on my Dialog
- It's placed in the middle of the Dialog
- I'm getting the position and dimension of the Picture Control with "CRect rc;" AND "m_pictureControl.GetClientRect(&rc);"
- When I Debug I see that the position of the "rc" is TOP: 0 LEFT: 0 -> Why that, I can clearly see it's not on that Postion of the Dialog.
-> So while this gives me back the "wrong" information about the location, I cannot properly use my pan function (draging image to move it).
Hope that made it a bit clearer
Shi
|
|
|
|
|
that 0,0 you are seeing is that of the control with respect to itself not with respect to the dialog.
but my doubt is how you cn write your logic to pan that image using the picture control.
how ever,
i have my own Active X control, which can take a large bitmap and has the feature of panning.
|
|
|
|
|
can any body tell me where to get msi.lib
thanks
himanshu p.taunk
|
|
|
|
|
|
I have generated this using my version of atlmime.h:
Date: Mon, 3 Sep 2007 14:03:05 +0800
Subject: TestCase1
X-Priority: 3
From: tdelavin <tdelavin@redmaptest.net>
To: User1 <user1@redmaptest.net>
CC: User2 <user2@redmaptest.net>
Message-ID: <ED831DF63867FA4798271894F09D74343C6D1CC461@winsvrpdc.redmaptest.net>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="------=_Next_Part_0021353203.467"
--------=_Next_Part_0021353203.467
Content-Type: multipart/related;
boundary="------=_Next_Part_0021353687.334"
--------=_Next_Part_0021353687.334
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: 8bit
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
content removed
--------=_Next_Part_0021353687.334
Content-Type: application/octet-stream;
charset="Windows-1252"
name="RE URGENT follow up required FW Still open tickets - 15910 16035 15686.msg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="RE URGENT follow up required FW Still open tickets - 15910 16035 15686.msg"
0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAACAAAAAAAAANAEAAAA
EAAAEQAAAAIAAAD+
content minimized
--------=_Next_Part_0021353687.334
Content-Type: image/jpeg;
charset="Windows-1252"
name="image003.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="image003.jpg"
Content-ID:<image003.jpg@01C7D464.924CE700>
/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIf
IiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7
content minimized
--------=_Next_Part_0021353687.334
Content-Type: image/gif;
charset="Windows-1252"
name="image004.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="image004.gif"
Content-ID:<image004.gif@01C7D464.924CE700>
R0lGODlhfAA0AHcAMSH/C01TT0ZGSUNFOS4wDQAAAAFzUkdCAK7OHOkAIf8LTVNPRkZJQ0U5LjAX
AAAAC21zT1BNU09GRklDRTkuMEI8pPUAIf8LTVNPRkZJQ0U5LjAVAAAACXBIWXMAAA7DAAAOwwHH
content minimized
--------=_Next_Part_0021353203.467--
Thanks again
|
|
|
|
|
I'm a fourth year student and I've a project about PDA programming like skype.
I decide to implement with c++ and I have to use SIP Protocol to create session between endpoints
so that's a problem>>> I don't know what Library I should use (I can't find any library ). I found RTC(Real Time Communication) of Microsoft but I'm not sure that it's can use for PDA
or anyone who can give me an example code about register to SIP server or any book about SIP programming.
please help me...T-T
wimut
|
|
|
|
|
Hello
Assuming my projects workspace is present in the path "C:\myfolder\myproject" as myproject.dsw, how do we include the paths for a .h file in the following scenarios,
1. Assume you have a file myproject.cpp at "C:\myfolder\myproject" and you want to include a .h file present in "C:\myfolder" and another .h file present in "C:\myfolder\myproject\library".
2. Assume you have a file myproject.cpp at "C:\myfolder" and you want to include a .h file present in "C:\myfolder\myproject" and another .h file present in "C:\myfolder\myproject\library".
3. Assume you have a file myproject.cpp at "C:\myfolder\myproject\library" and you want to include a .h file present in "C:\myfolder" and another .h file present in "C:\myfolder\myproject".
Thanx
|
|
|
|
|
know one logic i.e., "." refers to the current directory, and ".." refers to the parent directory.
so using above, you can use something like,
#include "..\another.h" or ".\library\something.h"
definately this will work.
|
|
|
|
|
In "Project properties" - "C/C++" - "General" - "Additional Include Directories" add ".." as the first entry.
Now, the cases are
1. #include "file1.h" and #include "library/file1.h"
2. #include "myproject/file3.h" and #include "myproject/library/file4.h"
3. Here, instead of ".." a name from the MACROS would be appropriate" $(InputDir) prossibly.
Then #include "myproject/file5.h" and #include "myproject/library/file6.h"
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Is there any preprocessor directive to set /Gz compiler option
|
|
|
|
|
I'm looking for good Gantt Chart library. Suggest me..
Thank you.
|
|
|
|
|
if you mean an active X control, then spell out your requirements and we shall develop one such control.
|
|
|
|
|
Your kindness is heartwarming
codito ergo sum
|
|
|
|
|
Did you search on the internet?
|
|
|
|
|
Yeah I searched on the internet but found only commercial ones.
I'm looking for chart similar to following one..I need basic library which I can extend for my purpose..
http://www.ilog.com/products/views/gantt/index.cfm
|
|
|
|
|
Hi Dear,
I need to make the report view of the list control non sortable( Disable Sorting) at run time. But i could not find out any API.
I tried to set LVS_NOSORTHEADER in PreCreateWindow() but it is making the list view non sortable all the time.
I need to make it Non soratble only at run time.
Like if I click on a particular node in a tree view then the list view dispalyed corrresponding to that should be non sortable.
Can Any body help me
|
|
|
|
|
1.first, take a separate application for test.
2.take two list controls.
3.in properties, enable sort for one control.
4.assign a member variables to both.(say m_l1,m_l2)
5.try m_l1.GetProperty() and m_l2.GetProperty();
6.see the difference.
7.then appply the same for the required control using SetProperty();
|
|
|
|
|
I've seen various applications that run on Windows detect the upload speed of data being transfered upstream. Obviously this can be done through some feature in Winsock that I can't seem to find. I can do a send() on a non-blocking socket of 1MB of data and it returns immediately and successfully but I know the data is just queued and being sent at about 40K/sec. How? What API?
Actually, never mind. I'm pretty sure I've figured it out.
-- modified at 3:20 Monday 3rd September, 2007
|
|
|
|
|
IsDestinationReachable() AIP helps?
|
|
|
|
|
I forgot to mention that I'd like to remain as cross-platform portable as possible (Preference: BSD-style socket calls) and also something that works under NT 4 (Win9x support would be nice but not necessary) and the language I'm using is C++.
The IsDestinationReachable() API is not useful. It just returns the line speed of my Ethernet connection (100Mbps).
|
|
|
|
|
Hello Friends,
Can I change the color of Button Caption.
I am using Win32 Appliction. And I have a Button on Dialog Box, say Exit. I want exit to be written in Red Color than Black one.
|
|
|
|
|
OnCtlColor[^] is one way of doing it.
Prasad
MS MVP - VC++
|
|
|
|