|
Just create a string that contains all your substring with whitespace in between and add that string to the list box. BTW, it doesn't really make sense because it will still be considered as one string in the list box, you won't be able to select "apple" only for example.
|
|
|
|
|
|
You can use a CListCtrl and hide the grid lines that are shown in the list [in case they are displayed]. You can then see all the three strings as if they were separated by a space.
Using custom edit control or a rich edit control would be another idea but a daunting task messing the things up.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Do you mean Horizontal scrollbar?
Hi why did you down vote me, I did not give you answer, but wanted to ask you or let you know one of the list box style.
I hope you get your doubt cleared.
--
"Programming is an art that fights back!"
modified on Monday, June 9, 2008 4:22 AM
|
|
|
|
|
Do you want to insert your strings like insert to a column?
|
|
|
|
|
if i do the following coding,i get error wha should be done???i need to add columns in a list box and add strings to it.
void ClistboxexDlg::OnBnClickedOk()
{
CListCtrl v;
v.InsertColumn(0, "One", LVCFMT_LEFT, -1, 0);
}
error C2664: 'int CListCtrl::InsertColumn(int,LPCTSTR,int,int,int)' : cannot convert parameter 2 from 'const char [4]' to 'LPCTSTR'
Raja
|
|
|
|
|
Try with
v.InsertColumn(0,_T("One"), LVCFMT_LEFT, -1, 0);
|
|
|
|
|
Hi,
How can I send e email but before sending It should check for user name and password?
|
|
|
|
|
MAPI Here[^] , Here too[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi all,
I have written a xml file writer application and all data written into a disk file.
I refer the following example to do it.
http://msdn.microsoft.com/en-us/library/ms753144(VS.85).aspx[^]
Now I want to read that disk file in to memory. I mean to a buffer. Because I want to attach it with another data buffer.
How can I do this.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Hi all,
I have written a xml file writer application and all data written into a disk file.
I refer the following example to do it.
|
|
|
|
|
Hi,
In a SDI Application, I have three Classes CMainFrame, CLeftView(Derived from CTreeView)
and CMyPrgView(Derived from CFormView).
Now I want to access all class member, function and control variables of each class from rest of classes.
Like when I click on tree items(LeftView), Controls placed on FormView should respond
or
clicking on menu(MainFrame) both TreeView items and Formview controls respond and vice versa.
Please tell me any standard way to access other class members and function in SDI Application.
Regards,
Maxim.
|
|
|
|
|
Write your controling function in Application class (Derived from CWinApp).
class CYourApp : public CWinApp
{
public:
void YourControlingFunction();
}
CYourApp* pApp = (CYourApp*)AfxGetApp();
if(NULL != pApp)
{
pApp->YourControlingFunction();
}
Hope this will serve your purpose.
Regards,
Paresh.
|
|
|
|
|
Thanks for your reply. I tried following code in my CLeftView class on Tree item selection(OnTvnSelchanged ).
CMyPrgView* pView= (CMyPrgView*)AfxGetApp();
if(NULL!=pView)
{
pView->m_Edit1.SetWindowText(L"P");
} But getting "Debug Assertion Failed" error on SetWindowText() .
|
|
|
|
|
The AfxGetApp() will return your application class poniter not view. Here you have casted the AppClass to ViewClass poniter. This is not possible.
akt
|
|
|
|
|
I did it as suggested by "Paresh".
I have also tried CMyPrgView* pView = new CMyPrgView();
but still Assertion error comes.
What i do, please suggest me.
|
|
|
|
|
Please read my post carefully. Take the help of AfxGetApp[^].
Regards,
Paresh.
|
|
|
|
|
You can have pointers to your view classes inside CMainFrame.
and then access through AfxGetMainWnd() which will giev you pointer to CMainFrame.
you have to typecast i.e. (CMainFrame*)AfxGetMainWnd().
I home it makes sense.
Regards,
Sandip.
|
|
|
|
|
I have a file dialog.i have filtered out the type of file i need.but how could i open the file in the application after selecting it?after clicking "open" in the dialog , i need to see the file.
Thanks
|
|
|
|
|
ShellExecute(/*parameters*/); will open the file in the application that it is related with. You will have the file path from the FileDialog
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I have to just display a jpeg file from the selected folder.No other operation has to be done.What should I do?
|
|
|
|
|
So, did you try opening the file using ShellExecute? Where do you want to display the jpeg file. look at the parameters of the ShellExecute function. You can pass the name of the application that you want the file to open in. Hope this helps.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thank you Sir....
I was able to open the jpeg file now.Now I want to know what should I do to open an exe file?should i just specify the path of the exe file?
|
|
|
|
|
Yes. BTW you can take some time out and visit MSDN site for more help on ShellExecute and how to use it.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
the jpeg files which i have specified to be opened is displayed in Windows picture and fax viewer.Anything that i have to do to just diaply the picture in vc++ runtime display.
here is the code i have written
ShellExecute(NULL,"open",f.GetFileName(),NULL,NULL,SW_SHOW);
|
|
|
|