|
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....
|
|
|
|
|
|
I don't think this will work.
The last accessed timestamp of the file user32.dll is updated with a date of the past,
when you set backwards the clock.
But you can't check that. The computer thinks 'now' is that date in the past.
Some more details about my question:
Time line: A1 < A2 < X < E < Y
My App is started at A1 end stopped at A2.
My app informs the user that his license will expire at E.
At time Y the user does the following:
- he sets back the clock to X
- he starts up my app
How can my app know
- the computer ever ran at Y (>E)?
- the license is expired
|
|
|
|
|
This might be a problem on PCs that use daylight saving, or on systems that sync with an external time source, such as a server or radio clock.
I'd allow a margin of at least 2 hours to be a valid change, although I'm assuming you want to do some kind of expiry-time protection.
Steve S
[This signature space available for rent]
|
|
|
|
|
That was an issue I indeed already thought of.
Nevertheless, thanks for the input.
|
|
|
|
|
Think about it from another direction:
Why not record the time each time your app exits (keep it in a registry key or a hidden file or something of the sort). When your app starts compare the current time with the last-exit time. If the last-exit time appears to be in the future someone may be cheating. Just remember to allow for DST as someone else suggested.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
The scenario you suggest fails in the following case:
Time line: A1 < A2 < X < E < Y
My App is started at A1 end stopped at A2.
My app informs the user that his license will expire at E.
At time Y the user does the following:
- he sets back the clock to X
- he starts up my app
When my app starts A2 < X, so it doesn't detect any cheating.
How can my app know
- the computer ever ran at Y (>E)?
- the license is expired
|
|
|
|
|
a) examine the eventlog - events there are in chronological order.
b) write to eventlog your own entries.
c) examine registry entries. booting leaves trails in registry. hint: RegQueryInfoKey()
combine methods.
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
What is the syn. function for _ttoi() to convert a string to a float/double (must compile with ANSI and UNICODE).
|
|
|
|