|
I neded a feature where I want my Dialog application to be versioned (Like a timestamp) whenever I recompile my file. I am unaware of methods to do this . Please help
|
|
|
|
|
See __DATE__, __TIME__, __TIMESTAMP__ predefined macros in MSDN library
|
|
|
|
|
http://www.codeproject.com/macro/incprivatebuild.asp
or search for auto-incrementing a version number here or on CodeGuru
-pete
|
|
|
|
|
My program when first opened takes up about 1K of memory. Then When open some dialogs and documents etc. the usage goes up.
Closing all the children doesn't shrink the usage, though, at least not by anything significant. However, when I minimize and maximize, I'm back to 1k.
Is this pretty normal? Does windows just assume the memory is still associated with my task, until it gets freed during minimize? Or does this signify I'm leaking memory?
I'm running Win2000, if it matters.
Thanks
BW
"Gandalf. Yes. That is what they used to call me. Gandalf the Grey. *I* am Gandalf the White."
- Gandalf the White
|
|
|
|
|
What you are describing is normal behavior. I don't know exactly what Windows is doing, but minimizing an application does seem to flush the cache. If you want to know for certain if you are leaking, buy a copy of Bounds Checker or just run your application in the debugger. When you exit look at the output window and search for the word leak. These are only basic leaks that Visual Studio finds though; a new without delete. Bounds checker will find the more difficult leaks; like creating a com object and not calling release. But with any more sophisticated tool, you have a bigger learning curve and it can be frustrating to use.
Ron Ward
|
|
|
|
|
Thanks Ron!
BW
"Gandalf. Yes. That is what they used to call me. Gandalf the Grey. *I* am Gandalf the White."
- Gandalf the White
|
|
|
|
|
Hi,
To use StrStrI, I
#include "shlwapi.h"
#pragma comment(lib, "shlwapi.lib") // link to shlwapi.lib
MSDN states: "shlwapi.dll 4.71 or later" (and, basically, IE4 must be installed)
However, on 98SE, even with IE6 installed, I get:
"missing export Shell32.dll:StrStrIA"
What's wrong? Do I need to write my own StrStrI? (I need to support 98, IE4 is no problem)
Nur wer feige ist tötet Liebe durch das Wort allein [sighist] | [Agile Programming] [doxygen] If you look for evil in me you will find it whether it's there or not.
|
|
|
|
|
Because of the final "A", it sounds like a problem of ANSI/UNICODE versions of the function
is your code built UNICODE?
Angels banished from heaven have no choice but to become demons
Cowboy Bebop
|
|
|
|
|
no, it's a straight MFC/ANSI build.
I'm a little bit confused by the dll name mismatch.
Nur wer feige ist tötet Liebe durch das Wort allein [sighist] | [Agile Programming] [doxygen] If you look for evil in me you will find it whether it's there or not.
|
|
|
|
|
You probably need to define WINVER to be 0x0400 or 0x0500 or something like that
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
I have a controller program working like this. controller is set as a time event 1000/sec. But the "current_trials", sometime increments, even the controller doesn't go into state 1. why? Thank you.
controller()
{
static clock_t start_time, end_time;
if(state==1)
{
position= get_position();
set_force(position);
if(position > 10.0)
{
start_time= clock();
state = 2;
}
}
if(state==2)
{
end_idle = clock();
idle_time = (end_idle - start_idle);
if (idle_time >= IDLE_DURATION)
{
start_idle = end_idle = 0;
state=3;
}
}
else//state=3
{
position=get_position();
if(position < 0.5)
{
load_force_spatial_profile();//this is time consuming
state = 1;
current_trial++;
}
}
}
|
|
|
|
|
What is state intialised to, and where?
Also, your states are best described by an enum
e.g.
enum MyStates {ms_timing = 0, ms_loading, ms_state_to_be_defined, ms_error, ....};
This will make your program much more readable for yourself and others in the future.
Roger Allen
Sonork 100.10016
WHats brown and sticky?
A stick or some smelly stuff!
|
|
|
|
|
Hello!
I wonder how you Gurus are managing all Error Messages in a large project?
I think that each Message should have a unique number, severity, text in current language, ... What else?
Do you number all error messages sequencially discarding severity or do you have one sequence per serverity?
Do you use the Message Compiler (mc)??
Are there any add-in for Managing Error Messages?
All input is valued!
Cheers!
Mike Eriksson
Sonork 100.21825
|
|
|
|
|
Mike, sounds like you are asking about logging eh? There are as many ways to log as there are people to answer the question
You might consider using the OS log mechanism if that makes sense for your product. Otherwise you can do whatever you want. I've done logs with a UDP socket and a database for persistance. I've also done logging directly to disk files using XML.
You really need to consider your project specific requirements for logging. The main consideration in some projects like server side projects is to get logging working day ONE! Makes life simpler.
-pete
|
|
|
|
|
Thanks for your answer!
No, I not specifically talking about logging. I'm talking about Error Messages, which most of the time just get display via an dialog. I'm also talking about multiple languages and the importance of a unique error number.
I do application which are translated into English, Swedish, Finnish. If a user calls/emails me with an error and the error messages is in Finnish, I have no clue on what the error is, since I don't speak or read Finnish. If I have a unique error number then I just look at the Swedish error message and usually I understand it
The above scenario is one major drawback of Windows, which has all error messages translated into different languages. So I use a Swedish Windows, then I get Swedish error messages, which I have to translate into English in order to find any info about the error ...
My original question was more of how to manage/administrate these error numbers, messages and how to use then in a MFC environment.
Cheers!
Mike Eriksson
Sonork 100.21825
|
|
|
|
|
I looked around and found this http://support.microsoft.com/default.aspx?scid=kb;EN-US;231777
which shows how to make an ERD (emergency repair disk). But I dont know if this also backs up my registry.
Also while running the backup utility does one have to shut down all apps? Or can one keep working and let it do its stuff in the background? The aricle doesnt say....
Thanks
Appreciate your help,
ns
|
|
|
|
|
Not sure about Win2K, but it certainly backs up the registry in Win98.
"We are the knights who say Ni" (The Knights Who Say Ni)
|
|
|
|
|
Hi,
I'm wondering where to get info on how to burn files on a cd. I didn't find a SDK or API or something like that.
I want to make a simple app to create and burn files on multi-session cds.
-widi
-
|
|
|
|
|
|
Thanks.
I guess I didn't find something in MSDN because I'm still using the version of '98.
|
|
|
|
|
|
|
How can I use the compiler and linker from vc6 in a batch file?
I never run the batch from inside the vc/bin folder. This results in missing c++ dll's.
example:
- folder c:\testapp
inside folder:
- test.h
- test.cpp (including test.h, windows.h, iostream.h)
- compile_link.bat
What do I have to put in compile_link.bat to compile and link these sources to a win9x DLL? (and to a win9x-app also...)
TNX
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
the easiest (if you already have a VC++ .dsp project file) is:
start /w MSDEV.EXE project.dsp /MAKE "myproject - Win32 Debug" /OUT buildlog.log
make sure MSDEV and all other stuff is in your path (VC++ setup creates a vcvars32.bat somewhere that registers the environment vars...)
Either make the project folder your current directory, or specify a full path to the project file (.dsp)
Make sure you specify the correct target name behind the /MAKE command.
Advantage: it respects onn your VC++ customization and project settings (including VC++ Tools/Options/Directories, and project post build commands, etc.)
You could create a project by using the project wizard for a DLL, then add your own source files.
You can also add other options (like REBUILD to force a complete build)
Another option would be creating a MakeFile - but I've been lucky in my life to largely avoid that...
Tip: make sure the target names are distinctive. I had one case, with darget names
"foo - Win32 Release" and "foo - Win32 Release ATL", where, upon specifying /MAKE "foo - Win32 Release" it would build the wrong target. renaming the first target to "foo - Win32 Release MFC", and specyfing this in the make command did fix it.
Nur wer feige ist tötet Liebe durch das Wort allein [sighist] | [Agile Programming] [doxygen] If you look for evil in me you will find it whether it's there or not.
|
|
|
|
|
I have nothing, no dsp.., except the source files (*.cpp) and header files (*.h)
But vcvars32.bat was the file what I was looking for. I copied that file to my batch folder and added a call to lc at the end, including the source folder. It worked fine
tnx
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|