473,492 Members | 4,279 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Are there something wrong with dragqueryfile or extracticon?

Hi,all!
I am new to VC++.net. When I debug these code followed, It doesn't
work.Could anyone tell me why?
(This is an example in Programming Windows with MFC,Second Edition)
void CShowIconDlg::OnDropFiles(HDROP hDropInfo)
{
int nCount = ::DragQueryFile(hDropInfo,(UINT)-1,NULL,0);

if(nCount ==1)
{
m_wndIconListBox.ResetContent();

char szFile[MAX_PATH]="newfile";

::DragQueryFile(hDropInfo,0,szFile,sizeof(szFile)) ;
int nIcons = (int) ::ExtractIcon(NULL,szFile,(UINT)-1);

if(nIcons)
{
HICON hIcon;
for(int i=0; i<nIcons; i++)
{
hIcon = ::ExtractIcon(AfxGetInstanceHandle(),szFile,i);
m_wndIconListBox.AddIcon(hIcon);
}
}

CString strWndTitle = szFile;
strWndTitle += _T(" - IconView");
SetWindowText(strWndTitle);

CClientDC dc(this);
m_wndIconListBox.SetCurSel(0);
m_wndIconListBox.ProjectImage(&dc,m_rcImage,::GetS ysColor(COLOR_3DFACE));
}
::DragFinish(hDropInfo);
}

Thanks in advance,

Kenny
--
Do you fear the force of the wind,
The slash of the rain?
Go face them and fight them,
Be savage again,
Go hungry and cold like the wolf,
Go wade like the crane:
The palms of your hands wil thicken,
The skin of your cheeks will tan,
You'll grow ragged and weary and swarthy,
But you'll walk like a man!

MSN:mu********@hotmail.com
WEB site:www.feifeinet.com
Jun 24 '06 #1
1 1277
> Hi,all!
I am new to VC++.net. When I debug these code followed, It doesn't
work.Could anyone tell me why?


When you drop a file, your application is already
started or the drop launches the application ?
Jun 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1762
by: Kevin T. Ryan | last post by:
Hi All - I'm not sure, but I'm wondering if this is a bug, or maybe (more likely) I'm misunderstanding something...see below: >>> f = open('testfile', 'w') >>> f.write('kevin\n') >>>...
5
2325
by: uberderf | last post by:
I have the following web page setup: http://angels.uberderf.com/glossary.html I have a 2 column table layout which is a glossary of terms and their meanings. When you view this page in firefox...
3
2392
by: allen.clarkson | last post by:
I am trying to capture the filename from a dragged/dropped file into a list control. I have read every single Tutorial, How-To and other documentation I can find and I still can't get it to work. ...
6
6553
by: Michael Sparks | last post by:
Hi, I suspect this is a bug with AMK's Crypto package from http://www.amk.ca/python/code/crypto , but want to check to see if I'm being dumb before posting a bug report. I'm looking at...
11
2332
by: matsi.inc | last post by:
I am looking to make something like a delegate that i can use in my projects but am having a hard time getting started. The behavior I am most interested in is how a delegate changes it's Invoke...
5
2891
by: Simon Brooke | last post by:
This is supposed to be a very simple XSL stylesheet to strip styling information out of HTML documents - it could not be more basic. And yet, it doesn't work. I'm obviously getting something very...
25
3079
by: Jon Slaughter | last post by:
I have some code that loads up some php/html files and does a few things to them and ultimately returns an html file with some php code in it. I then pass that file onto the user by using echo. Of...
3
1863
by: Peter Oliphant | last post by:
It's not necessary, but it would be nice if there was a way I could easily create something like a 'web browser form' or a 'display web page form' as forms in my application (in a Panel would be...
34
1725
by: raphfrk | last post by:
This program should copy one file onto the other. It works if I compile it with gcc to a cygwin program. However, if I compile it with the -mno-cygwin option, it doesn't work (this targets native...
0
6980
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7192
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7364
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.