|
nehe.gamedev.net, a site is very good for programming with OpenGL & VC++
-----------------
conglt
|
|
|
|
|
Hi,
I have created a List Control. I have to add the text by default by which the user can modify the text as required.
List control ID :- IDC_EXCLUDE_FILTERS_LIST
Type :- CListCtrl
Member :- m_EXCLUDE_FILTERS_LIST
I have to add the folowing text by default when the Dialog window loads.
*.exp *.ilk *.res *.trg *.tlh *.idb
*.pdb *.pch *.opt *.lib "*\Deleted
Items\*" *.cab *.mov *.mp3 *.swf
*.psp *.bmp *.chi *.chm *.com *.dll
*.exe *.gif *.hlp *.ivi *.ivt *.ix
*.jpeg *.jpg *.msi *.nl.mpeg *.mpg
*.ram *.rm
Can anyone please tell me how to add the default text to the list box & also user can edit the text and also remove the text..
I dnt know properly that i have to Edit Box or List box. but the text should be
multiple lines where the user can edit the text.
Regards,
Parichay.
|
|
|
|
|
hai parichay
for this u can use combo box instead of list box or edit box where u can enter the list before and u can edit while runtime
|
|
|
|
|
Hi,
Thanks for the reply..
But in the Edit box , how to display the text in multiple line ???
|
|
|
|
|
hai parichay
to display mutliple lines u can set the property of the edit box as follows
in the edit box properties->styles->mutliline checked
|
|
|
|
|
I just create a edit box with m_EDIT member of Type CString also checked multiline and i declared
m_EDIT = "*.exp *.ilk *.res *.trg *.tlh *.idb *.pdb *.pch *.opt *.lib "*\Deleted Items\*" *.cab *.mov *.mp3 *";
i am gettling lots of erro that i cant use * etc can u please tell me how to do it?
--------------------Configuration: DesktopSearch - Win32 Debug--------------------
Compiling...
UpdateDlg.cpp
D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2017: illegal escape sequence
D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2065: 'Deleted' : undeclared identifier
D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2017: illegal escape sequence
D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2296: '*' : illegal, left operand has type 'char [61]'
D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2146: syntax error : missing ';' before identifier 'Items'
D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2065: 'Items' : undeclared identifier
D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2297: '*' : illegal, right operand has type 'char [21]'
Error executing cl.exe.
DesktopSearch.exe - 7 error(s), 0 warning(s)
|
|
|
|
|
Use \\ for getting a single \
- NS -
|
|
|
|
|
keerthikaaa i cant use the Combo Box, i can use Edit box or list control or list Box.
|
|
|
|
|
hai parichay
look at this link.it may help u
www.codeproject.com/listctrl/listctrldemo.asp
|
|
|
|
|
parichaybp wrote: I have created a List Control. I have to add the text by default by which the user can modify the text as required.
I've no idea what you are trying to say here.
parichaybp wrote: I have to add the folowing text by default when the Dialog window loads.
What do you mean "by default?" What control do you want this text added to? If it's a list control, please explain in more detail as that control can be displayed in many different formats (e.g., report, list, icon).
parichaybp wrote: Can anyone please tell me how to add the default text to the list box
Now you are using a listbox?
parichaybp wrote: ...also user can edit the text and also remove the text..
Do you need an edit control for this?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hey folks:
I've got a nice C++ STL string and I need to turn it into a TCHAR.... (and I can't use MFC)
I've tried:
typedef std::basic_string< TCHAR > tstring;
and it doesn't work (or it does, and I don't know how to use it) ... basically how do I convert these types?
Thanks!
-- modified at 2:07 Monday 17th April, 2006
|
|
|
|
|
typedef std::basic_string< TCHAR > tstring;
is the correct syntax for changing a STL string to TCHAR
Now when you want to change the string to tstring you can use
tstring("ABCXYZ"); that's all
I hope this works fine at your end but there may be some other problem in the way you are using this code.Please specify how you are using the code.
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
So I have the following header, but basically, I have a STL string that I want to convert to tchar, to call Win32 APIs... (that require the use of LPTCSTRs) when I try your suggestion:
tstring blah = tstring("ABCXYZ");
I get the error:
error C2440: '<function-style-cast>' : cannot convert from 'const char [7]' to 'tstring'
Could you provide a more elaborate example? Thanks!
#include <windows.h>
#include <stdio.h>
#define NULL 0
#include "LogFiles.h"
#include "TestPrint.h"
#include <string>
#include <iostream>
#include <conio.h>
using namespace std;
typedef std::basic_string< TCHAR > tstring;
|
|
|
|
|
Lots of helper functions here[^] (look for toWideString()).
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
i am making a application as follows:
there is one main dialog and then i am calling a component that is also dialog and i want to set the position of componet dialog to main dialog.
now i have successfully set the button which are actually creating in component and set at main dialog but i want to whole dialog to main dialog
can anybody tell me what i have to do for the same.
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Bankey Khandelwal wrote: now i have successfully set the button which are actually creating in component and set at main dialog but i want to whole dialog to main dialog
Huh?
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
Hi Bankey Khandelwal
You want to set position from dialog?
|
|
|
|
|
now its done
thank you
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Hi
I have problem related to singelton class....
I have to design a singelton claa such that if the user try to create second object then it should direct to first instance of class.
Please suggest me that how to implement such class
Thanks
|
|
|
|
|
1.Make the constructor of the class private.
2.Write a static function that return the object of this class. In that function create a static object of the same class and return the reference of that object. Thus instead of creating a object directly, call this function to get an instance of the class.
eg:-
class single
{
private:
single()
{
}
public:
static single& Instance()
{
static single Obj;
return Obj;
}
};
here every application should call single::Instance() to get an instance of the class single
|
|
|
|
|
I think Instance() should be public, right?
- NS -
|
|
|
|
|
Thanks Naveen
Will this code ensure that when we are going to create second object of the class then it will point to the first one.
Please explain how.
Thanks
|
|
|
|
|
Ya.. since the constructor is private, u cannot create an object directly. You have to call the Instance() function to get the one and only one object of that class.
eg :-
single a;// causes error since the constructor is private.
single &a = single::Instance(); // reference to the one and only one object.
nave
|
|
|
|
|
Hi!
I use Johan Rosengren's Files "Controls-in-controls: A line-numbering edit box" for line numbering in an SDI application.
I have changed it to CEditView to get it working.
The problenm is: After the visible area of the edit-control doesn't apprear a vertical scroolbar. Instead the cursor jumps into a new line. And also if I make the whole window smaller, the text which doesn't have enough place jumps into a new line.
How can I make a scrollbar in this case?
I hope you know what I mean, my English isn't the best.
|
|
|
|
|
Hi there,
I have a CTreeCtrl as a child of a docking window (CMyBar). In my docking window class I set a handle just like this:
(CMyBar.cpp)<br />
ON_NOTIFY(TVN_SELCHANGED, ID_TREE, OnTreeChange) .. .
The declaration of the function is
(CMyBar.h)<br />
afx_msg void CMyBar::OnTreeChange(NMHDR *hdr, LRESULT *NotUsed)<br />
I had to explicity add the ON_NOTIFY handler because the Visual Studio6 ClassWizard doesn't show the ON_NOTIFY event for my docking class (CMyBar), (don't know why?).
As far as I know CTreeCtrl does send ON_NOTIFY notifications to it's parent (CMyBar). Spying++ CMyBar window class shows CMyBar gets WM_NOTIFY messages...
Now all this crap doesn't work (OnTreeChange never gets called), and I'm to figure out what's going on and what's wrong with it.
Would be really happy if someone can answer this question...
Thank you!
|
|
|
|