|
Even after years of C++ experience, its very easy to slip into doing it the C way and whilst that is not necessarily bad, you do miss out on a lot of the features C++ provides to make your code tighter and less prone to the wobbly-leg syndrome. I'd heartily recommend Bjarne Stroustrup's C++ Programming Language (3rd ed) not only as a great C++ reference, but also because its very good at demonstrating the differences between C and C++. You dont need a complete changeover of style, but a little bit here and there will work wonders
|
|
|
|
|
I coded in C for over 15 years, and reluctantly moved to C++ about 6 years ago. I can honestly say now that I wish I'd done it a lot earlier. I don't even like straight C any more.
Find you self a small app that you're interested in and design the OO framework for it, then start coding. It took me quite a while to wrap my head around OO design, and even now I'm still learning better ways of composing OO systems. You have to take the plunge. You may find that you can move lots of your existing code into classes. I've done that with ED (see sig), which started life as straight C, and is now nearly all C++.
Understanding OOD is the key, C++ is just a way to implement it.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Neville Franks wrote:
don't even like straight C any more
Yes I was the same, the book I used, was Newnes C++ Pocket book by Conor Sexton ISBN 0 7506 0635 5. don't know if it is still in print though, as you said understanding OOD is the key. That book got me started.
It is amazing what you can accomplish if you do not care who gets the credit. - Harry S Truman
|
|
|
|
|
what u'll find is that most of ur code fragments will end up being class member functions in a properly refactored system
the oo bit is kinda related to how u organise those fragments ... if that helps
"there is no spoon" biz stuff about me
|
|
|
|
|
Hi there,
Kindly tell me how to retrieve the application icon of a registered file type from the file extension without having a specific file name.
For example, I need to retrieve the application icon associated with file type having extension ".doc".
Regards
Gaurav
Gaurav Gumber
|
|
|
|
|
SHGetFileInfo ( ....., SHGFI_ICON );
Iain.
|
|
|
|
|
HICON GetFileIconHandle(LPCTSTR lpszFileName, BOOL bSmallIcon)
{
UINT uFlags = SHGFI_ICON | SHGFI_USEFILEATTRIBUTES;
if (bSmallIcon)
uFlags |= SHGFI_SMALLICON;
else
uFlags |= SHGFI_LARGEICON;
SHFILEINFO sfi;
SHGetFileInfo(lpszFileName, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), uFlags);
return sfi.hIcon;
}
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
Hi
I would like to know how to get color in to my console
App.
How to color background and text.
thanks
|
|
|
|
|
Hi,
Go here:
Click me
and read Working with Windows Consoles: Part 1-4.
|
|
|
|
|
suppose i wan to have 2 views in an SDI that does not take up the whole frame, leaving space for some dialog controls.how do i do that? can i do the controls then split the view?
|
|
|
|
|
In a similar fashion to toolbars and status bars taking up some of the space from the frame,
you can add a CDialogBar too. And then put the controls on there.
Iain.
|
|
|
|
|
Hello
Does anyone knows a C++ library or an ActiveX component that can convert HTML to PDF? Or any other way to convert HTML to PDF in VC NET...
Freeware or the ones that just put their logo are needed
Thank you in advance
|
|
|
|
|
search on google
there are some free converters out there
and btw ... they convert most things to pdf as they act like virtual printer drivers
"there is no spoon" biz stuff about me
|
|
|
|
|
Look for Ghostscript. I think it will do what you want. I think!?
Larry.
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
How do I toggle the toolbar items in the Doc/View architecture? They depress when clicked, but I can't get them to stay down or figure out how I can control this action programmatically.
halblonious
|
|
|
|
|
SetCheck in UI handler.
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
I need to access network resources that are available to the logged-in user from within a service. I would like to be able to do this without prompting the user for their username/password. It looks like I can use the ImpersonateLoggedOnUser API function to do this, but I need a handle to an access token for the logged-in user. If the service and the user are on the same box, I believe I can get the token via OpenProcessToken .
Here's the tricky part. Suppose the user is logged in on machine A, and the service is running on machine B. Is there a way to pass an access token for the user to the service, that will give the service access to the user's network resources?
Software Zen: delete this;
|
|
|
|
|
If you need to do this for only one user, then you can simply run the windows service under this user's account by reconfiguring it. Use Administrative tools on Windows 2000 or Control Panel on windows NT 4.0, select Services to find the service you want to configure.
If multiple users have to use the service, then the above does not work.
My articles and software tools
|
|
|
|
|
Hi,
I would like to know how to add a delay of say 1sec in my
MDI program !!!
Ehsan Behboudi
|
|
|
|
|
Sleep() - but then people may think you program is buggy or broken.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
BuggyMax
|
|
|
|
|
maybe you want to use SetTimer
SetTimer(TIMER_ID, time);
Then just set up a message handler to check for TIMER_ID and do what you want in that message i think there are a few samples somewhere on this site :P
|
|
|
|
|
1. Sleep, but it prevents the program from responding to any other event during the Sleep interval.
2. CreateEvent to create a dummy event,
and then WaitForSingleObject
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|
|
void Delay(DWORD dwMsecs, BOOL bBlocking)
{
DWORD dwStrtmsecs, dwCurmsecs;
dwStrtmsecs = dwCurmsecs = ::GetTickCount();
do
{
if (!bBlocking)
{
MSG msg;
if (::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
}
dwCurmsecs = ::GetTickCount();
if (dwCurmsecs < dwStrtmsecs)
dwStrtmsecs = dwCurmsecs;
} while ((dwCurmsecs < (dwMsecs + dwStrtmsecs)));
}
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
im assuming this is for startup reasons?
what i do is after initialising all i need to simply send urself a message that "starts" the main app running
hope i got the right angle here
"there is no spoon" biz stuff about me
|
|
|
|