|
In my application, I'm using a TreeCtrl to display some hierachical information about the setting of the information.
I want it to be shown like:
[B] Solutions
|
---+[F] Solution Users
|
---+[F] Materials
I want Solution Users and Materials are not initially expanded (Items not populated until the + is clicked).
[B] and [F] here represents two images.
By the way, I don't know how to create image list for it, should i create a bit map of 2 x 16 x 15 to hold the images, and load it into CImageList, and set it to the tree ??
|
|
|
|
|
Yes, at 1st you shoul create image list, then attach it to the tree. When you'll want to add tree item, specify the index of the image in the image list
_________________________
Warm regards,
Vladimir V. Polischuk
AlarIT Inc.
Developer
URL: http://www.alarit.com
|
|
|
|
|
what is the different between this two declaration of pointer:
1) int* inta;
and
2) int *inta;
|
|
|
|
|
The readability.
Technicaly there is no difference at all. You can write int * inta or even put it in diffent lines. Whitespaces dont count (in most cases).
In my opinion its more readable to see int* pvariable; then int *pvariable; because it is not an integer variable but a integer pointer variable.
But thats only my 2 €-cents.
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
This is a bit of a mess in C/C++
int* pvariable; seems good from some points of view but it suggests that int* is a variable type.
What about:
int* pvariable, p2;
is p2 a pointer? NO! It's an int. For this reason I always write int *p, *p2; ... the * really belongs with the variable name not with the type.
That was just my £0.02
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
This is why experienced programmers do not declare more than one variable on a single line.
Not all of the capabilities of C are necessarily good things.
|
|
|
|
|
Jim A. Johnson wrote:
experienced programmers do not declare more than one variable on a single line
Don't generalise. All generalisations are false.
I am probably more experienced (been programming longer) than most people around here and I often declare more than one variable on a line (in certain circumstances). I just try to make sure it's not confusing.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
That creates a problem, agree. But I never do THAT.
Another (clean) solution is using typdef'd types for that: use a LPINT or PINT and you are out of this troubles.
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
True. My view has always been that the '*' is an attribute of the variable, rather than the type. This is especially true when the language standard makes things of the form:
int* p,i;
equivalent to:
int *p;
int i;
which is not immediately apparent in the first case.
Also, there's a comment in this thread about typedef'ing pointers. I've always considered that poor practice, as it adds a lot of 'noise' type definitions. What do you do when you have to pass **p? Or a reference? Do you add typedef's for all of those as well?
Gary R. Wheeler
|
|
|
|
|
there is no difference in operation
everyone prefer int* variable ;
bcz that increase the readability
A Programmer Never Dies..***
|
|
|
|
|
renjith -CP teckforce wrote:
everyone prefer int* variable ;
WRONG!
renjith -CP teckforce wrote:
bcz that increase the readability
WRONGER!
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Hi there!
What happens to unicode characters outside the Basic Multilingual Plane when using 'unicode enabled' functions in MFC. Are they just invalid?
It appears to me that the _UNICODE support enables UCS-2 encoding (the BMP) only. If I want to use UTF-16 encoding, must I go with _MBCS support?
Thanks
Jonnie
|
|
|
|
|
Here - Is it possible to enable a combo-box to display tabs
(\t) correctly?
I know there's a style to set for List-boxes and the like
(LBS_USETABSTOPS) but I can't find anything simplar for
Combo-Boxes - am I missing something obvious?...
Len.
|
|
|
|
|
hi,
does anybody has a pointer to some information on getting the background of your desktop icon text transparent ?
thx,
bisserke
I used to have a life ... now I have a computer
|
|
|
|
|
I've created a static library project with one dialog inside created using the resource editor and the class wizard.
The project builds without any errors.
If I want to use that library from another project, I can build it. But at runtime the dialog doesn't show. Adding some logging, I can see the dialog's constructor beeing called, but it never gets to the initdialog.
Is there something I should do, something I shouldn't when using a dialog created directly by the project?
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
Grote Smurf wrote:
use library from another project
You have copied the resources for that dialog?
The IDXXXX for all resources have to be in resource.h , likewise have the descriptions from resource.rc .
You may give the path to your libraries resource include in (Project->Settings->Resources->'Additional resource include directories').
Under (View->resource includes->'Read only symbol directives') you would then enter the path to your libs resource.h file.
|
|
|
|
|
The other project is not an app but a static library. I know if you create a dynamic library, the resources are included in the dll, so no copy or extra paths are needed. I don't know if that's the case for static libraries as well, but if so, the resources should be included in the lib.
Maybe, it's more easy to change to a dll instead. That works for sure...
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
If you read the Readme.txt that is created at the time you created the static lib project, you would have found that you need to create a resource.h and StatLibName.rc file. And since the other actual project, where you use this lib, cannot contain more than one .rc file, you need to include the StatLibName.rc in the .rc file of the project to make it work. If the second project doesn't have a .rc file of its own, then it should be fine, I think. Also, since both the projects call their resource file Resource.h, it's useful to call the one in the static lib something else, say StaticLibResource.h, and change the #include directive in the StaticLibName.rc file to match it, so that both the resource files and the definititions get included.
Regards,
Rohit Sinha
|
|
|
|
|
Hi,
Does anyone have an idea (tips, links, code) how my app can detect that the system clock is set backwards?
I want to know even when my app was not running at the time of change and/or the PC has been rebooted.
Thanks.
|
|
|
|
|
Check the date/time of important system files. If they are from the future, you know something is up.
_____________________
"So in the interests of survival, they trained themselves to be agreeing machines instead of thinking machines. All their minds had to do was to discover what other people were thinking, and then they thought that, too."
Breakfast of Champions, Kurt Vonnegut
|
|
|
|
|
Daniel Ferguson wrote:
Check the date/time of important system files.
Can you give some examples?
Is it possible it could work from Win95 upto WinXP?
|
|
|
|
|
\winnt\system32\user32.dll
get the last accessed time.
Signature space for rent. Apply by email to....
|
|
|
|
|
This wont work if updating access times is turned off. (registry hack, speeds up quite a bit)
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
This hack sounds cool. More info?
Signature space for rent. Apply by email to....
|
|
|
|
|