|
You're welcome.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Read the docs carefully, the registry APIs are tricky. ERROR_MORE_DATA means the buffer you passed in isn't big enough to hold the data.
|
|
|
|
|
The code:
int RegReadLastRun(long *L){
HKEY hk;
DWORD RegType = REG_DWORD, size;
if(RegOpenKey(HKEY_LOCAL_MACHINE, reg0, &hk))return 1;
if(RegQueryValueEx(hk,reg1,NULL,&RegType,(unsigned char*)L,&size))return 2;
if(RegQueryValueEx(hk,reg2,NULL,&RegType,(unsigned char*)(&Inst),&size))return 3;
if(RegQueryValueEx(hk,reg3,NULL,&RegType,(unsigned char*)(&Uninst),&size))return 4;
if(RegCloseKey(hk))return 5;
return 0;}
reg1, 2 and 3 are DWORD
|
|
|
|
|
Hello everyone,
In Visual Studio 2005, I can not create Visual C++ Smart Device project -- when input required inputs (project name, path, etc.) in "New Project" dialog, then when I click OK, the "New Project" displays again -- without any error notifications...
And I have checked the related physical location of the project path, the project is not created.
I am wondering whether it is a bug of Visual Studio 2005, or I need to install some additional components in order to create Visual C++ Smart Device type project?
thanks in advance,
George
|
|
|
|
|
Hi,
I want to read the call stack of another process and save it to a file.
I am able to atach to the process by using DebugActiveProcess but waht is the function which reads the info from the callstack and translates the symbol information
DavidR
|
|
|
|
|
StackWalk64()
It's not quite trivial though - you'll want to read up on the DbgHelp API[^].
Alternately, just call MiniDumpWriteDump() [^], and use a debugger to examine the resulting dump.
|
|
|
|
|
im using a performance counter to monitor my bandwidth but its not displaying like it does in performance monitor in my code it jumps from 0 to a 34523452(positive) number to a -45735399negittive) number in performance monitor it runs steady with what azureus says im uploading at when azureus says upload is around 226 KB/s performance monitor says around 244000 bytes/s here is the code that seems to not be right its running on a 1 sec timer
PDH_FMT_COUNTERVALUE fmtValue;
pdhStatus = PdhCollectQueryData(hQuery);<br />
if (ERROR_SUCCESS != pdhStatus)<br />
{<br />
ErrorExit("PdhCollectQueryData");<br />
cleanup();<br />
}<br />
<br />
pdhStatus = PdhCollectQueryData(hQuery);<br />
<br />
pdhStatus = PdhGetFormattedCounterValue (hCounter,<br />
PDH_FMT_DOUBLE,<br />
&ctrType,<br />
&fmtValue);<br />
<br />
if (pdhStatus == ERROR_SUCCESS)<br />
{<br />
sentinfo.Empty();<br />
sentinfo.Format("%.3d", fmtValue.doubleValue);<br />
GetDlgItem(IDC_SENT)->SetWindowText(sentinfo);<br />
UpdateWindow();<br />
}<br />
else<br />
{<br />
ErrorExit("PdhGetFormattedCounterValue");<br />
cleanup();<br />
}<br />
MSG msg;<br />
if(PeekMessage(&msg, 0, 0, 0, PM_REMOVE))<br />
{<br />
TranslateMessage(&msg);<br />
DispatchMessage(&msg);<br />
}
if you see what aint right please let me know.
|
|
|
|
|
Since fmtValue.doubleValue is a float value, I do not think the "%d " format specifier is appropriate. You should try "%f " or "%g ":
sentinfo.Format( "%.3f", fmtValue.doubleValue);
I hope this helps.
|
|
|
|
|
where can i see a list of all the different one i can use %d %f %g %s %u ect.....?
|
|
|
|
|
|
is it possible to capture parent window text(title bar text) instead of sending the title text from parent to child.
actually in our project we have more than 200 dialogs, and nw our client needs title bar look like parent text/child text.
for example say suppose we hav 3 dilaogs nd
1st dialog is parent of 2nd and 3rd dialogs and 2nd is parent of 3rd dialog so 3rd dialog is subchild for 1st dialog and child for 2nd dialog.
lets say
1st dialogs - title text is Dialog1
2nd dialogs - title text is Dialog2
3rd dialogs - title text is Dilaog3
and now the title text for each dialog should be as follows,
1st dialogs - title text is Dialog1
2nd dialogs - title text is Dialog1/Dialog2
3rd dialogs - title text is Dialog1/Dialog2/Dilaog3
itz just like directory sturcture which is displayed in addressbar while opening any directory.
as it is difficult to open every dialog and get the title text and send it to child and itz quite a bit confusion if there are sub-sub-sub dialogs so can we write any DLL to simply the problem if ny one hav idea regarding this plz lemme nw.
Raj Gopal
|
|
|
|
|
In a dialog's OnInitDialog() you can call GetParent() to get the dialog's owner, and call GetWindowText() to get the owner window's caption text.
|
|
|
|
|
thnx for reply sir.
But the problem here is there are many sub dialogs, actually for every dilaog the title should be
grandparent
grandparenttext/parent
grandparenttext/parent/child
grandparenttext/parent/child/subchild
grandparenttext/parent/child/subchild/subsubchild.....
so is it good way of creating a dll and pass the handle of the dialog and maintaing all the previous dilaogs handle in it so that we can loop thru the handles and get the title text of each dialog and put the text in the above format?
|
|
|
|
|
You could paint the title bar yourself. This way you would not have to
change the title of your windows. Just would have to walk the parents
using GetParent, and build the new name for each window on the fly.
|
|
|
|
|
To get your main window handle from any of the children/grandchildren/... just put the GetParent() api in a loop, when it returns null you have found the top level window. For each window it returns, get the text and build a title bar string.
|
|
|
|
|
In a "Installer" program I want to present to the user a Dialog with a progress bar and over the progress bar I want to show what file(s) are being copied.
Can someone present me code snipspets of how to do this?
Thanks
A C++ programming language novice, but striving to learn
|
|
|
|
|
Several of these[^] articles show how to have a progress bar with text.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Thanks. They helped!
A C++ programming language novice, but striving to learn
|
|
|
|
|
You might want to check out the SHFileOperation API.
Steve
|
|
|
|
|
I'll check it out. Thanks!
A C++ programming language novice, but striving to learn
|
|
|
|
|
I'm going on a bit of a book spending spree to get myself an ultimate C++/Object Oriented reference library and am considering the following books (which all seem to be highly recommended):
Accelerated C++: Practical Programming by Example
Effective C++
More Effective C++
Effective STL
Exceptional C++
More Exceptional C++
Exceptional C++ Style
The C++ Standard Library: A Tutorial and Reference
Beyond the C++ Standard Library: An Introduction to Boost
C++ Templates: The Complete Guide
C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond
Modern C++ Design: Applied Generic and Design Patterns
Design patterns : elements of reusable object-oriented software (Gof)
Head First Design Patterns
Design Patterns Explained: A New Perspective on Object-Oriented Design
1) If I get all three Effective C++/STL books, is it worthwhile me getting all three Exceptional C++ books ?
2) Should I get the Design Patterns Gof book as it is quite old now, and from what I've read it doesn't really explain when patterns shoul;d not be used (plus there are other newer design pattern books) ?
3) Should I get both C++ Template books, or would one suffice ?
4) Any other suggestions or comments would be appreciated ?
|
|
|
|
|
Maybe you should start with Effective C++, read it, and after that see what you
want to do? Have you tried the Stroustrup?
|
|
|
|
|
Yeah, I've got the Stroustrup Special Edition.
I want to start using STL and the Boost libraries in particular to help speed up development time as well as offering portability and improving the quality (compared to custom written classes).
|
|
|
|
|
Hi
I'd like to write a programm to restrict internet sides.
I mean a filter that only allows some sides - maybe working like a virtual proxy depending on the user login name for a machine.
Second function should be to fill in login data into a form. And those data should be non changebal. For example using gmx login only for one given account.
Thanks for any help
Tim
If you believe this is not very usefull then I believe you have not been in my situaltion.
|
|
|
|
|
Does anyone have any good articles on doing these 2 things with c/c++? I see many articles for c# and VB. I would like to do simple everyday tasks but faster without the need of accessing AD Users and computers everytime.
Thanks
|
|
|
|