|
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).
|
|
|
|
|
wcstod
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
For a no source code change, use _tcstod, which I think is what the original poster wanted.
Steve S
[This signature space available for rent]
|
|
|
|
|
I am using CAsyncSocket class in one of my very simple windows application. The problem is that whenever i called the connect function, my program blocks for few seconds. How can i get rid of this blocking problem ??
|
|
|
|
|
you can put your sockets in separate worker threads, or deal with the blocking issue,
put the string into MSDN:
Windows Sockets: Blocking
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
hi all,
when i used FindFirstFile() i got the file name as ".",for the first
FindNextFile() call i got the name as ".." and for the third i got the correct one..how can i avoid the first two cases..
|
|
|
|
|
Use proper wildcards. If you use *.* then it is quite normal you get those two (which are part of the operating system (. is an alias for the current dir, .. is an alias for parent dir)).
if you start putting in too manay features, it no longer remains useful for beginners
quote in a CP article comment, shiraz baig
|
|
|
|
|
You can't exactly, but for stuff other than the root directory of a drive, this will always be the case (just like *n*x systems), so inevitably I have a check for "." or ".." in things dealing with this.
If you only want files and not directories, you can also check the attributes that are present in the results.
Steve S
[This signature space available for rent]
|
|
|
|