hi, i have provided a context menu for copy/paste operations between two listctrl's in my application. but the problem i am facing is that how will i identify from which list ctrl the user has clicked copy and in which ctrl the user clicks paste from the context menu. i.e whether i have to copy from listctrl 1 to listctrl 2 or vice-versa. can anyone help me out thanks aditya
Aditya Rao
Posts
-
context menu for two listctrls -
Add handlers to menu items added at run timehi, i had asked a similar query some days back. i wanted to add some text to the menu at runtime when the user clicks a button(similar to Add to Favourites). the solution posted helped to add the string to the menu at run time. but now i want to write a handler for the items added to the menu list; as there can be many strings in the menu we cannot write handlers for all those items. can anyone tell me how to write a single handler for the strings added in the Favourites menu.( i.e. the user would be adding a names of sites or rather strings to the menu and when he clicks one of those added in the menu i should be able to process the string, such as what is the text selected/string name). thanks aditya
-
Calling programs from a VC++ programhi, does anyone know how to call a program(such as mspaint, word or any other program/ executable present) from our vc++ application. i.e. on executing an application it should call another windows program. thanks aditya
-
display imageshi, can anyone tell how to display images in the browser with the help of CHttpServer and CHtmlStream classes when i use them in an ISAPI extension dll. i have the name of the image file and i want to display the image in the same browser window.(i.e. when i click the get button) thanks aditya
-
Please Helphi, can anybody tell me how do i go about building an ISAPI application. the application which i intend to build is as follows: the user will select some options from a web page(options regarding some images) and then click the get button. then the image selected by the user should get displayed on the page. in html this is simple but this is only a test application.in the final application the user is going to select the name of another application and also send some data required by that application. the background program(i.e. the ISAPI extension ) will have to check whether the application required by the user exist and then pass on the data to that application and wait for the result. when it obtains the result it will show it back to the user. so as a first i want only to send back some images. can anyone tell me how to go about this application. i tried using the sample programs on code project but they did not have any explanation and did not worl properly. Lastly is there anyother better way to build this application other than what i have said(if it is the correct way) thanks aditya
-
Adding items to menu bar(similar to Add to favourites)hi, i have a SDI application in which i want to add some text on the menus. for example the way we have the Add to Favourites in the Internet Explorer menu. so how do i implement that in my application. but in this case i want the data in a text box to be added (functionality is same as that of the Add to Favourites) . can anyone help. thanks aditya
-
ISAPI extension in vc++hi, i want to create an ISAPI extension which would enable me send a page with an image to a browser. there would be options for the user to select a particular image give on a web page and when the user clicks the get button the image should be displayed. i found a sample project here on codeproject given by Jorge Lodos. but i am not able to display the images. i changed the location of the files as specified in the tutorial but only the text is being displayed. can anyone help. also in the html page supplied with the sample code contains a %s in the image src field. can anyone explain what is that. the html code is as follows. Test Image
A car and the link for the sample project is : http://www.codeproject.com/isapi/image.asp thanks aditya
-
ISAPI extensionhi, i want to create an ISAPI extension which would enable me send a page with an image to a browser. there would be options for the user to select a particular image give on a web page and when the user clicks the get button the image should be displayed. i found a sample project here on codeproject given by Jorge Lodos. but i am not able to display the images. i changed the location of the files as specified in the tutorial but only the text is being displayed. can anyone help. also in the html page supplied with the sample code contains a %s in the image src field. can anyone explain what is that. the html code is as follows. Test Image
Test Image
A car and the link for the sample project is : http://www.codeproject.com/isapi/image.asp thanks aditya
-
Show bitmap on Buttonhi, can anyone tell me how to show a bitmap or an icon on a button to be used in a dialog window( my application is a SDI app with view class derived from CFormView). i have added a bitmap as a resource. thanks aditya
-
ClistControl giving exceptionshi, have an SDI application where the view class has been derived from the CFormView class. i added a list control to the dialog. but when i tried to add some sample text to it i got and exception. in some earlier posts someone had suggested to define the virtual function DefWindowProc. and in the handler for the WM_INITDIALOG message call UpdateData(FALSE). i tried that but i am still getting the exception. can anyone help thanks aditya
-
CInternetFile: problem in reading remote filehi , thanks jose . what you said was write, the result of the comparison was being assigned to the writebytes. i changed that and it is working fine. i removed the operator as sunit5 had told and now everything is working fine. in same application i want to add drag and drop from the remote location to the local directories. for this i am using two list controls ( one for each). can you tell how to list the contents of the drives in the list controls ( for the local ones). and i am not able to use the combo box in my application ( my application is a SDI application with the view class derived from CFormView. Is that a constraint for using combo box. i get an exception everytime i am trying to add something in the combo box) . thanks aditya
-
CInternetFile: problem in reading remote filehi this is the codewhich i have written for the Download button handler void CSmartFTP2View::OnDownload() { // TODO: Add your control notification handler code here int i = m_list.GetCurSel( ) ; // get selection from list box CString srcfile; m_list.GetText ( i, srcfile ) ; CString str; CInternetFile * pfile; CFile fp; localtarget = localpath; localtarget+= srcfile; srcfile = remotepath + srcfile; srcfile+='\0'; localtarget+='\0'; try { pfile = m_pftp->OpenFile(srcfile.operator LPCTSTR(), GENERIC_READ, FTP_TRANSFER_TYPE_BINARY, 1); fp.Open(localtarget, CFile::modeCreate |CFile::modeReadWrite); long size = pfile->Seek(0, CFile::end); int pos=0, writebytes=0; while( writebytes = pfile -> Read ( (void *)str.operator LPCTSTR(), 50 )!=0 ) { fp.Write ( str, writebytes) ; } MessageBox("Download Successful"); } catch ( CInternetException * pex ) { MessageBox ( "Error in file copy" ) ; pex -> Delete() ; } pfile -> Close( ) ; fp.Close( ) ; } the localtarget will contain the local path and the srcfile has the remote path eg:- ftp://homepc/test.txt aditya
-
CInternetFile: problem in reading remote fileCode ia attached in the reply to the reply below hi, i want to read a file for an ftp application from a remote location. so i used the CInternetFile::Read method to do so. but if i try to read more than 1 byte (say 512 bytes in one read ) then i get the number of bytes read through the return value as only. but the buffer in which i read the contents contains the numbe rof bytes specified and also contains some extra characters. eg:- i have a text file having only 42 characters when i read it by passing 50 as the number of bytes to be read to the Read method then the return value is 1 but the buffer contains the 42 bytes plus some extra characters. how can i solve this problem. Also i want to know the size of the file being copied . is there any function for the filesize. i tried using seekToEnd but it gave me an exception. aditya :)
-
ftphi, i am trying to create a ftp application in which i want to show the progress bar. i tried using the OpenFile of CFtpConnection to open the file and then read it. but the problem i am facing is that whenever i try to get the file size by using the SeekToEnd function which returns the file size i get an exception. and i think that the file is not being opened properly. can anyone help me. i have used IIS for the ftp adn created a virtual directory. the name of the computer in IIS is : homepc. so how should i give the file path( what should be the path of the file : suppose the file to be copied is test.txt what should be the exact path). also can anyone provide any example for the same. is there any other way to use a progress bar in this application thanks aditya
-
problem in CFtpConnection::OpenFile()hi, i am creating a FTP application in which i have used a progress bar for showing the status of the download. for doing this i used the CFtpConnection::OpenFile() method so that i will read the data in small number of bytes and then display the status. the problem here is that when i try to open the file using this method the return value which should be in the form of a CInternetFile is being returned as a null value. hence i am not able to read the file and there is an excepetion the syntax i have used is as follows: the completePath is a CString and contains the path as ftp://homepc/test.txt i have used IIS to create a ftp site and stored some text files as well as other file in the ftp root directory try { srcFile = pftp->OpenFile(completePath, GENERIC_READ, INTERNET_FLAG_TRANSFER_BINARY, 1); } catch(CInternetException *IE) { display the exception } when i debugged the program i found out that the srcFile had nothing in it i.e it was NULL with some "?????" in the watch window. can anyone tell me why am i getting this problem or is there any other way to use the progress bar? aditya
-
FTPhi, my name is aditya. i am new to vc++. i am trying to create a ftp application. what i want to know is when we connect to a ftp site. there are many directories on the site(apart from the files). so how can i see the contents of the directories or download the whole directory present there. aditya