|
Though my problem was of different sort but i got clue from all your answers. So i am very thankful to you guys as usual. I am really touched.
Cheers,
Hemang
|
|
|
|
|
char c= (char)65;
-@SuDhIrKuMaR@-
|
|
|
|
|
Why char c= (char)65; when we can use of char c = 65; ?
|
|
|
|
|
Hi all,
I m using OnInitDialog() for dialog box initialization and OninitialUpdate() use for Formview.
please what function is used for MainFrame initialization.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
ThatsMe. wrote: what function is used for MainFrame initialization.
OnCreate
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
If you want to add remove differrent property of the MainFrame you can use MainFrame::PreCreateWindow() or OnCreate()fucntions.
akt
|
|
|
|
|
how to add a series of string in a list box horizontally??add string adds the strings on the next line of the listbox,but i need the srings to be added in the same line and need space between the strings,for example
"apple orange mango"
Raja
|
|
|
|
|
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.
|
|
|
|