|
Excellent!
I wish I had known about that class sooner!
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
That class is indeed wonderful, but I'm just curious: Why isn't there a way to delete an INI section or entry by API calls? I've tried to search through MSDN and studied all(I think) INI-file-related API's, no lucky, i really can't beleive that.
|
|
|
|
|
Bin wrote:
Why isn't there a way to delete an INI section or entry by API calls?
You are always limited by Win32 API (actually, in this case it's inherited from Win16), and if Micros~1 didn't think of something you'd want to do, there us usually no documented way to do it.
Easy as pie (unless you try a GDI Pie...).
|
|
|
|
|
AfxGetApp()->WriteProfileString("Section", "Part", NULL) should delete "Part" from "Section".
AfxGetApp()->WriteProfileString("Section", NULL, NULL) should delete all of "Section".
See the documentation for ::WritePrivateProfileString and look at the source code for CWinApp::WriteProfileString. The documentation for CWinApp::WritePrivateProfile string apparently fails to mention that you can use it to delete entire sections from the INI file.
|
|
|
|
|
Before every function definitions, I have gotten into the habit of prefacing each with COMMENTS on what's being accomplished in that function (such as which parameters are input, output, and what changes were made to that function, when, and for what reason, etc.).
However (useful as it is), it has become something of a labor for which I would like to formulate a way in which I could do something that would automate the process of inserting a "template like" generic header, which I could then modify with only the specifics for that particular function.
IOW, my rough idea is to insert a macro (or something like that) before each function definition, and when the program is compiled, to have the macro expand into this generic template layout which I would then simply fill in with the relevant information (etc.).
Any idea on the best approach?
Thanks!!
William
|
|
|
|
|
|
Amazing that someone would promulgate this.
This sort of commenting has been discredited as very hard to maintain, and therefore more likely to be misleading than informative. Bad idea.
|
|
|
|
|
I don't see the problem, the guy asked for a way to add comments via macros, and a solution was given; whether the solution is good or bad, is another story, but the principles are there and it's up to the user to modify the script to generate his own good format for him.
Suggest another format!
Max.
|
|
|
|
|
I am not promulgating anything. I am the one asking for ideas.
Like everything good and beneficial, discipline is required if it's to remain that way.
I cannot count the amount of times I've had to spend hours playing detective to applications nobody seemed to remember what all have been done to it (not even the author who wrote it).
Tell me at such times you couldn't use all the help you can get (especially at 2 in the morning when your phone rings because some user on the other side of the world has just experienced a crash or some other anomally while using the application).
Nevertheless, I see your point, because of what good would documentation be if it's out of date and misleading, WHICH IS WHERE DISCIPLINE WILL HAVE COME IN.
Discipline is never easy. It requires (for a lot of people) training, consistence, and (for some) enforcement.
I like to think I'm helping out the next person whose phone might get ring at 2 in the morning, so he/she would know what to do and wouldn't have to call me (which in a way is helping myself).
William
|
|
|
|
|
I am not at my home computer, so I cannot research this up myself. What is the best/easiest way to search a directory and return the file name of every dll? Is it CFileFind()? Thanks for your help.
Darroll
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|
|
See MSDN:
FindNextFile
It has the sample code you want.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Would someone please look this over tell me if I got it right. I am not at my computer so I have no compiler to check it. Thank you.
CFileFind finder;<br />
static const TCHAR szFileToFind[] = _T("*.dll");<br />
Cstring Plugins[100];<br />
int tag = 0;<br />
bool bResult = finder.FindFile(szFileToFind);<br />
<br />
while (bResult)<br />
{<br />
finder.FindNextFile();<br />
Plugins[tag] == (LPCTSTR) finder.GetFileName();<br />
tag++;<br />
<br />
bResult = finder.FindFile(szFileToFind);<br />
<br />
}<br />
finder.Close();<br />
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|
|
How do I get the rect of a subitem in a report-style CListCtrl? I'm wanting to paint icons in the subitems, but in order to paint icons there, I need to know where to put it Basically, I just need a GetItemRect function for subitems.
Thanks!
|
|
|
|
|
|
Doh! Thanks
|
|
|
|
|
Hi guys,
I've a declared bunch of global variables in
CMyClass
{
}
and I want to access them in CMyOtherClass. How do I do that?
Can I use extern? how about static? The compiler still warns me that I've "undeclared identifier" in CMyOtherClass when use those two keywords.
Help?
|
|
|
|
|
#include 'MyClass.h' in 'MyOtherClass.h'.
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
|
|
|
|
|
Then only in the .H file I should've declared the global variables, is that right?
Thanks.
Merc
|
|
|
|
|
I was thinking that you meant member variable because you said they were in CMyClass. If they are global variables, then they should be declared in 'MyClass.cpp' and extern in 'MyOtherClass.cpp'.
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
|
|
|
|
|
Let me answer my own question: FYI::
Put the global variables in the .h files and include the .h. and it'll be visiable to any class which includes .h.
Regards,
JJ
|
|
|
|
|
how create output text in richedit ctrl like mIRC channel textoutput ?
I mean text scrolling from bottom side to upper side....
[ sorry for my english ]
----------------------------
never stop coding.
|
|
|
|
|
You want to insert text at the bottom of the richedit control?
CHARRANGE cr;
cr.cpMax = LONG_MAX;
cr.cpMin = LONG_MAX;
richedit.SetSel( cr );
richedit.ReplaceSel( (LPCSTR)string );
richedit.SendMessage( SB_BOTTOM, NULL, NULL );
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
|
|
|
|
|
thanx
----------------------------
never stop coding.
|
|
|
|
|
I want to learn development for pocket PCs (WinCE).
I already have VS 6.0 and VS.Net and have downloaded SDK for Pocket PC. Do i really need embedded Visual C 4 or I cna use the SDK with my VC 6 to start developing.
Wat else do i need.
Thanks in advance.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Hi All,
I want to use ADSI's IADsDomain Interface in my application to enable the password attribute- password complexity.The problem I'm facing is that I'm not able to set the ADsGetObject method's parameter 1 correctly.Hence unable to bind to the object.For convineince I'm giving the statement I'm including in my application.
hr = ADsGetObject(L"WinNT:",IID_IADsDomain,(void**)&pDomain);
Since I'm connecting to my own system hence I'm using the WinNT: parameter.
Can anybody help me out.
Abhishek.
Learning is a never ending process of Life.
|
|
|
|