|
Program settings should
0) Be user-specific
1) Should be saved in the registry if at all possible
2) and if #1 isn't possible, saved in a file in the user's appropriate application data sub-folder.
3) "Data" is not the same as "settings". "Settings" are rarely written, and typically only read at startup, eliminating the need for much more performance than we already get by reading/wqriting to the registry. "Data" on the other hand is read/written all the time, hence the need for better performance.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I'm looking for a VS2005 add-in to auto increment the build number each time I compile.
Anyone know of a working VS2005 add-in? What do you use/do to accomplish this task?
Patrick
|
|
|
|
|
Does this meet your needs?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Actually, I was able to get that mostly working, but had some problems.
First, it doesn't update the product number. I could probably fix that as he provides the source, but the second problem lead me to continue for more of an "add-in" solution.
The 2nd problem is that this results in a file that has the version set in the properties, but if you mouse over it, the hover text always says, 1.0.0.0. That would just confuse my users.
So, I'm searching for something someone has turned into a drop-in add-in, or something that doesn't have these issues.
Also, I prefer to have the .rc2 VERSIONINFO be the source, vs. another file, although that is really nothing, I can edit either easily.
Patrick
|
|
|
|
|
How can i convert a string ( "1234.5") as a double =1234.5
I know only to convert number to string
str.Format( _T ("%f") ,double );
how i do the reverse?
|
|
|
|
|
double atof( const char *string );
[edit]
I assume that the one who voted my post '1' is unfamiliar with the basic standard library functions in C/C++. atof() is declared in stdlib.h.
To get a double from a CString would look like this:
CString str = "12345.6";
double value = 0.;
value = atof( str ); Further information can be found here[^].
[/edit]
-- modified at 13:44 Thursday 31st May, 2007
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
|
Immunity18 wrote: PS. i didnt vote
Don't worry about it.
Regardless of who it was, it made me clarify my post in a way that I should have done from the start. :->
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
how can i convert CString variant to double like this?
i mean cut off the zero
example:
CString ---> double
1.020000 ---> 1.02
|
|
|
|
|
Can someone remind me what the required step is so that if you add in a header and source file from an article here to be included in your project (eg MFC dialog), you get the class members to pop up when you hit a "." or "->" operator on an object.
t.i.a
|
|
|
|
|
Nothing special is required. You may need to rebuild the .clw file, however.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hmm, I tried this but no joy so far. I've added Cedric Moonens CCHartCtrl files to my project and make use of them on a dialog with a graph. I know it all works properly, but for example where I have
CChartSerie* pLineSerieCol = m_ChartCtrl.AddSerie(CChartSerie::stLineSerie);
pLineSerieCol->SetName("Energy Data");
pLineSerieCol->SetColor(0x00ff0000);
at the "->" it refuses to pop up the available methods of the class. I've manually deleted the .clw file, tried rebuild all and also opened class wizard with the clw file missing to force it to rebuild and checked that the source files are all included, but no joy as yet.
I wonder if it is humanly possible to feel more like a muppet than I do today
|
|
|
|
|
ldsdbomber wrote: ...at the "->" it refuses to pop up the available methods of the class.
I've had this happen in a few instances where the method that I was currently in had not yet been added to the class. For example:
void MyClass:DoSomething( void )
{
CChartSerie* pLineSerieCol = m_ChartCtrl.AddSerie(CChartSerie::stLineSerie);
pLineSerieCol->SetName("Energy Data");
pLineSerieCol->SetColor(0x00ff0000);
} If the DoSomething() method had not yet been added to MyClass , then Intellisense would fail to work. This does not appear to be the case with you however.
ldsdbomber wrote: I wonder if it is humanly possible to feel more like a muppet than I do today
Only if you are you sprouting fur in odd places.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It's not easy being green.....
A small tribute to Jim Hanson who made us happy without computers, cell phones and other gizmos.
|
|
|
|
|
The default setting in IDE in VS2005 while creating a new project to Use Unicode Character Set. There are several functions that use TCHAR and the _T macros. Why is is that the default setting is set to unicode. Most of the applicaitons are written in such a way that it expands to unicode or single byte character set while _MBCS is defined.
|
|
|
|
|
tom groezer wrote: Why is is that the default setting is set to unicode
what is your problem exactly ? what would you have prefered instead ? ...and why ?
|
|
|
|
|
hi im trying to get my head around GDI+ as far as i can tell i can only use it in the main function.
With what i've done below the image shows up at first but when the window refreshes i.e (change the size of it)
the image disappears is not repainted.
main..
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
{
Graphics graphics(GetDC(hwnd));
Image* image = new Image(L"clock2alpha.png");
Bitmap bitmap(L"clock2alpha.png");
graphics.DrawImage(&bitmap, 0, 0);
}
GdiplusShutdown( gdiplusToken );
.....
im interested in displaying png images and how to access them outside the main method with GDI+
thank you
|
|
|
|
|
Because your code doesn't have a re-painting mechanism. The drawing code should be placed in a OnPaint() or OnDraw() handler, regardless of GDI or GDI+ rendering.
Best,
Jun
|
|
|
|
|
Lamefif wrote: as far as i can tell i can only use it in the main function.
Where did you get that idea?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
hey Mark
i dont know what i did earlier but it keept crashing at runtime, when i put the code above in a method it was weird.
thank for your replies guys.
|
|
|
|
|
Lamefif wrote: keept crashing at runtime, when i put the code above in a method
hmm It was something else probably.
You can make GDI+ calls anywhere (of course, all the usual thread safety issues apply if you're
using multiple threads).
If you're using GDI+ extensively, you can do the GdiplusStartup() just once - main/winmain is
fine - and call GdiplusShutdown() just once after all drawing is done - just before returning
from main/winmain is fine.
If you have trouble in other functions you can always post related sample code here
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Whats the error and where you used your code?
|
|
|
|
|
Hi
Actually i have already ask this question but not get any setisfactory
ans.
My problem is that i want to upload a .doc file in mysql database ,
i am making my application in VC++ 60. Modal Dialog based(type)
It should be work like whenever we upload our resume in any job site.
problem is that in VC++ there is not any file field(in which a browse button is already atteched)
I use a button and write code for it to open window but using it
we can select only file name not whole path
Please any one told me how i can solve this problem
Regard's
Kaushik
|
|
|
|
|
Your table will need to contain a blob-type field. You would then copy the file's bytes to this field just like you would any other field. The fact that the bytes come from a file is irrelevant.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|