|
Aqueel wrote: I know how to change paths of files, i just want to ask how to implement drag and drop.
If you just need to know how to implement drag and drop, Microsoft has given you an example just for that. You can find the article in the following link.
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q148738[^]
I Strongly suggest you to go through David Fleming's article on Drag and drop between CListCtrl also. You may find the same in the following link.
http://www.codeproject.com/listctrl/dragtest.asp[^]
Regards,
Rajesh R. Subramanian
Akruti Software,
Bombay, India.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
What is transparent bitmap?
Is there any article on this subject?
NSS
|
|
|
|
|
I guess it's a bitmap that has a transparent area. If you're not supporting W95, there's a TransparentBlt method. This assumes you have one colour that is transparent. If you want to make a range of colours transparent, you need to use GDI+ ( check my articles for info ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
How to load some icons from a file into a listcontrol? I want to load some icons from a file into a list control,but I'm not able to do it ?help me.
|
|
|
|
|
If we're talking about the common control version of List Control (CListCtrl in MFC) it's pretty easy.
The list control just uses an imagelist object to retrieve it's images from, all you need to do is create an CImageList object and bind it to the list control, then all you've got to do is specify the index for the image you want a listitem to have.
You'll need to add something like CImageList m_imageList; into your class definition for the parent window, then in your initialisation routine (OnInitDialog or whatever) you'll need something like:
CListCtrl pListCtrl = NULL;<br />
CWinApp * pApp = NULL;<br />
<br />
pApp = AfxGetApp( );<br />
if( pApp == NULL ) { _ASSERT( FALSE ); return FALSE; }<br />
<br />
pListCtrl = ( CListCtrl * ) GetDlgItem( IDL_LIST );<br />
if( pListCtrl == NULL ) { _ASSERT( FALSE ); return FALSE; }<br />
<br />
if( m_imageList.Create(32, 32, ILC_COLOR8, 0, 4) )<br />
pList->SetImageList( & m_pImageList, LVSIL_NORMAL);<br />
finally, when adding your items into the list control, you'll need something like:
<br />
HICON hIcon = NULL;<br />
int idxIcon = 0;<br />
<br />
hIcon = pApp->LoadIcon( MAKEINTRESOURCE( IDI_INDEXFORICON ) );<br />
idxIcon = m_imageList.Add( hIcon );<br />
pList->InsertItem( 0, TEXT( "items description" ), idxIcon );<br />
I think the code is correct (the theory is at least) as i dont have a copy of Visual Studio to hand to try it and notepad ain't quite the same
Gavin Taylor
w: http://www.gavintaylor.co.uk
|
|
|
|
|
Thank you for your warmest help,but the icon is still not able to display?
could you help me ?
|
|
|
|
|
Which mode is the list control displaying in report, icon, etc?
I should have explained, the CImageList::Create methods parameters have got to match the icon size the list control is going to display in. ie, if it's running in report mode the image size would be 16x16 as opposed to 32x32. see the MSDN topic[^] for more details on using the image list, and when you bind the CImageList to the CListCtrl using CListCtrl::SetImageList pass LVSIL_SMALL instead of LVSIL_NORMAL.
Any more probs try posting some of your code so I can see where your going wrong...
Gavin Taylor
w: http://www.gavintaylor.co.uk
|
|
|
|
|
I have foud where I am wrong .
The CImageList m_imageList should be add in head file (.h file) intead of .cpp file.
But,I have another question ,how to load some icons not in resource view from a file into listcontrol ?
Could you help me again ?
Thank you.
|
|
|
|
|
|
I want load Icons in a file(eg."d:\m")not Bitmap into Listcontrol.
could you write some code with the LoadImage() function?I have somewhat puzzle at the parameter in the LoadImage() function.
|
|
|
|
|
LoadImage can be used to load icons, bitmaps and cursors all you've got to do is change the 4th paramter
<br />
HICON hIcon = NULL;<br />
hIcon = ( HICON ) LoadImage( NULL, TEXT( "c:\\icon.ico" ), IMAGE_ICON, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE );<br />
if( hIcon != NULL )<br />
{<br />
}<br />
Gavin Taylor
w: http://www.gavintaylor.co.uk
|
|
|
|
|
I currently am working with Visual Studio 2005 if that matters, though trying to keep my code portable for people using pre .net Visual studio compiliations, so if possible no .net options.
I currently am using a CEdit box. However as I add text to it with this snippit
m_IDCResponseBox3 is a CEdit
<br />
char Response[1000]="";<br />
if(UDPSocket.CheckReceived())<br />
if(UDPSocket.ExtraReceive(Response,1000))
{<br />
CString Text;<br />
m_IDCResponseBox3.GetWindowText(Text);<br />
strcat(Response,"\n");<br />
Text+=Response;<br />
m_IDCResponseBox3.SetWindowText(Text);<br />
}<br />
However for some reason when the code runs through I get "200 e1VQf LOGIN ACCEPTED" With two Square boxes. These boxes are newlines. however it doesn't actually register in the editbox. Is there a way to register the newline in a EditBox, I've tried most of the options in the properties setup. Or is there a better tool for a short log? (probably 6-10 lines max.) I'm just using this to test UDP Responses)
|
|
|
|
|
It's either \n\r or \r\n, I forget which. If they are not both there, in the right order, you get black boxes.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote: I forget which
Not that you really need to know, but its \r\n
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
Hi all,
I am extending multiple language support to my visual C++ 6.0 dialog based application. I am using resource only DLL and everything is working fine. My question is - Is there any way by which I can do the same by using static libraries instead of DLL? I tried making rc file for the static library and thought of using LoadString, but this will not work since I do not have HINSTANCE handle of the static library. Is there any way?
Thanks!
|
|
|
|
|
I could be very wrong but I think using GetModuleHandle( TEXT("libraryname.dll") ) should return the instance handle for any statically linked libraries just as it would do with stuff loaded with LoadLibrary() , you could then just pass that into LoadString . Can't try it though as no copy of Visual Studio around me.
Gavin Taylor
w: http://www.gavintaylor.co.uk
|
|
|
|
|
Hello everyone!
OK, look:
error C2679: binary '=' : no operator found which takes a right-hand operand of type 'char' (or there is no acceptable conversion)
That's what I get whenever I do something like this:
mapData[x-sub].Char = ' ';
Why is that? I could do it on standard C++...Thanks!
BTW: mapData is a CHAR_INFO pointer, and its Char property is a char... (duh!)
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
CHAR_INFO::Char is a union. You have to specify which union member you are assigning the character to: AsciiChar or UnicodeChar.
mapData[x-sub].Char.AsciiChar = ' ';
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
|
Hello folks:
I have been trying to find a simple way to convert PDF's to TIFF files, w/o actually having to open the files themselvs, be it with a batch routine, shell execute command, a library that someone knows of, code that they have written for this puropse, etc. It doesnt really matter what the format is so long as it is reliable and produces print quality tiff images. The reason for this is our plotter cannot handle remote downlevel documents sent in a PDF format; it does however handle TIFF images with no issues whatsoever. I have taken a look around on various forums, but have been unable to find any method of converting from PDF to, well any other format. I have found many methods of converting TO PDF, but no way to reverse the process. If someone could give me a hand or point me in the right direction that would be great.
-Thanks
|
|
|
|
|
hi all i need help i want the code to finding the longest path of a graph this means how to get from nod 1 to nod 8 in the longest path with consederation for the weith of the path between nodes
plz contact me at senatort@hotmail.com
thanks
|
|
|
|
|
What about using good old Pythagoras, using the x and y coords as input parameters?
|
|
|
|
|
Hi, I´m quite new at programming C++. Can someone please tell me how I can initialize an array with random generate characters ?
|
|
|
|
|
char array[size];
for (int i = 0; i < size; i++) {
array[i] = (char)((rand() * 255) / RAND_MAX);
} The calculation scales the return value of the rand() function, which returns a value in the range 0 to RAND_MAX to the range 0 to 255.
Software Zen: delete this;
|
|
|
|
|