|
Set the Accept File property of the dialog to TRUE and then do the rest of the handling
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Can you send me the source code that drag Image(bmp or any one )by mouse
pointer on dialog box at run time
RajeshGupta
|
|
|
|
|
There are always lots of articles available here on CP. So why not search here. A quick search took me to this location[^]. See if it helps you in your cause. :->
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi
that project is not downloading can you send me you email for further discussion in detail . because I am new in vc++. I need urgent code snipped requirment I will send you in email with picture.
RajeshGupta
|
|
|
|
|
_AnShUmAn_ is replying in the context of file drag-and-drop. Is that what you need to do
or do you need to drag a bitmap that is drawn in the window/dialog?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I still could not find my answer . I need drag a image (bitmap or any image)on the dialogbox so that every time i drag I find it top and letf coordinated in the textbox .
RajeshGupta
|
|
|
|
|
I still don't quite understand what you need - You want to be able to drag an image around on the
dialog but it should go to the top/left?
Do you have the dialog with an image already? If so, are you drawing the image or using a
control to draw the image? This info will help me hopefully provide some help
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi,
that is what I exactly need
when dialogbox appears .then I want load image from file(.bmp,.jpeg ect)
on the dialog box area . default its left top will be (0,0) at starting.
now I want to drag it by mouse so that its position change and also
I want to appear its changing top left coordinates in Textbox.
I need its code urgent . please help me . i am searching lot but could
not get result. if you forward me mail it will be great helpfull
RajeshGupta
|
|
|
|
|
You can break this down into easier steps...
1) Load the bitmap
2) Sometime in or after the WM_INITDIALOG message is received in the dialog, calculate the rect
the image will be initially drawn at (relative to the client area of the window).
3) If you just want to draw the image on the face of the dialog, add a WM_PAINT handler to the
dialog which draws the image at the image rect position
That'sll get your image drawn in one place on the dialog. Now you want to be able to drag it...
1) Add handlers for the WM_LBUTTONDOWN, WM_MOUSEMOVE, and WM_LBUTTONUP messages.
2) When you receive a WM_LBUTTONDOWN, check if the cursor is within the image rect.
If it is, store the current cursor position and call SetCapture() to capture the mouse to your
window.
3) When you receive WM_MOUSEMOVE, call GetCapture() to see if you are in a drag (if the mouse is
captured to your window). If yes, compare the cursor position with the position saved in step 2.
If it has changed, then the position difference is how far you need to offset the image rect.
Erase the previous image, offset the image rect, and redraw the image at the new rect.
4) When you receive WM_LBUTTONUP, call ReleaseCapture().
Here's sample code: Using Mouse Input[^]
If you have a more specific problem with any of the steps outlined above then just ask
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
|
hi all
i build an application in vc++ MFC
i add a button on dialog box and write upload
now i want that when i click on this button i get
a list of drives in the system to upload a file
can i get help regarding this
thanks alot
hi
|
|
|
|
|
paras_s12 wrote: a list of drives in the system to upload a file
Did you see CFileDialog?
SHBrowseForFolder - Displays a dialog box enabling the user to select a Shell folder.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
paras_s12 wrote: ...get a list of drives in the system...
Use GetLogicalDriveStrings() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
I want only one instance of my application to run at a time.
So i have creted a CSemaphore object with a name "app" in the global area.
And in the Initinstance of the app class i am checking whether it is locked or not. if not locked, locking it and continue otherwise, return false.
Its working fine. What i want to know is how can the CSemaphore object exists between the two different applications even when the application is closed?
Thanks in advance for the reply.
KIRAN PINJARLA
|
|
|
|
|
The Semaphore is actually like a system-wide flag - it's handled by the OS. Once you create (and lock) the named semaphore from one instance of your application, Windows will not let you do that in the second instance ...
|
|
|
|
|
|
for single instance my preference is alwways mutex due to memory overhead and other thing!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
i have to download a file from a url. while sending request system hangs at BOOL bSend = ::HttpSendRequest(m_hHttpFile, NULL, 0, NULL, 0); whats wrong with this.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Are you using MFC?
The class CHttpFile provides the functionality to request and read files on an HTTP server.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
yes i am using mfc.
m_hHttpFile = HttpOpenRequest(m_hHttpConnection, NULL, m_sObject, NULL, NULL, ppszAcceptTypes, INTERNET_FLAG_RELOAD |
INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_NO_CACHE_WRITE , NULL);
if (m_hHttpFile == NULL)
{
return DLFAILED;
}
BOOL bSend = ::HttpSendRequest(m_hHttpFile, NULL, 0, NULL, 0);
thi is the code.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
See Here[^].
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
deeps_cute wrote: i have to download a file from a url.
How about URLDownloadToFile() ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
I have a dialog based application in VC 6.0 MFC. I want to port in to VC++ 2005 with few additions.
Additons are:
1- I need to add a window form to this MFC App, which will be the main form from where all other forms will be loaded on button click.
2- Add ADO.Net support to MFC Project.
How can this be done?.
Thanks in Advance.
Z.A
|
|
|
|