|
Thanks for replying. Is a handler the equivalent of int main() in C++?
|
|
|
|
|
I think your main problem is that cout writes to stdout, and there is no stdout in windows. THere are ways to redirect the stdout to a window, you may want to search for that here on CP.
Also, the paradigms between a GUI and a console app are different, therefore you may have to restructure how you want your program to look in a dialog. Maybe it would make more sense to have different fields that are filled with data, rather than having one large text display.
Other than that you should have no problem porting the logic between the two programs.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thanks for the reply. The paradigm of Windows programming is what really gets me confused. Although the program I posted above is procedural, I do have a pretty good understanding of OOP but this MFC stuff just goes right over my head. Do you recommend any beginner's books?
|
|
|
|
|
Charles Petzold's books on Win programming are a worthy read.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Will look into it, thanks.
|
|
|
|
|
Chson wrote:
Do you recommend any beginner's books?
A good start is also the Scribble tutorial that comes with MSDN. Give it a try!
Best regards,
Alexandru Savescu
|
|
|
|
|
I've set up a class in my project that is based on the CTreeCtrl class and am trying to handle messages in the class. It will handle some, but for messages like WM_RBUTTONUP or WM_LBUTTONUP, for example, it doesn't handle those messages when the action is performed on one of the Tree items. They only work if you execute the action in the blank area of the control. Any thoughts on why this is the case and how I can get it to handle these messages?
|
|
|
|
|
Stew wrote:
They only work if you execute the action in the blank area of the control.
Probably tree control enters into modal loop when you click on items and move the mouse a little bit. In such case, messages are processed internally by routine deep inside comctl32 - you'll be unable to process them without hook.
You should handle NM_CLICK and NM_RCLICK instead.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
CListCtrl
What message is passed about when the little box is being drawn to select a group of items? Or is there a message that I can respond to when a new item is selected as part of a group of items being selected in such a fashion.
Thanks!
Dugs
|
|
|
|
|
Check LVN_ITEMCHANGING and LVN_ITEMCHANGED.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
|
|
Hi,
I created a setup using the a setup project in Visual C++ .NET Standard, which works absolutely fine on the dev box, but when I try a vanilla install of Windows 2000 it complains saying it needs the .NET framework installed.
Surely MS Installer 2.0 doesn't need the .NET framework?!
Any help very gratefully received.
TIA.
Paul.
|
|
|
|
|
PaulMdx wrote:
Surely MS Installer 2.0 doesn't need the .NET framework?!
Maybe not, but perhaps your program does!
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Hi Nish,
Thanks for the reply.
Nope, that's not it. We also tried adding the .NET framework MSM, which didn't do anything.
The setup complains before the program is even installed (when the setup.exe is first clicked on).
Paul.
|
|
|
|
|
Hmmm.
This is a wild guess, okay! But in most installers we can set the option to check for some bare minimums. For example you can set the minimum requirements to Windows 98 or say you can insist on IE 5.5 etc...
Maybe somewhere in your installation settings you have enabled the .NET runtime requirement. Thus the installer sees that the runtime is not installed and it stops!
If this was a stupid guess, please forgive me. I am just making a long shot in the dark.
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
|
As a long time C++ programmer, I find VC++ far superior to Delphi for the kind of work I do.
Delphi is a little too focused on RAD for my way of developing.
Michael
Errata 1: p. 154, section 'Defusing'. For 'red wire' read 'blue wire'.
|
|
|
|
|
choosing either Delphi or Visual C++ depends largely on what you are doing.... although C++ executes faster, Delphi compiles in a single pass which means it will always be faster than MSVC, and most other C/C++ compiler out there.... Delphi is also based on the Pascal language, but borland have their own version, Object Pascal, which supports most features found in C++
if you want to do database programming, or large GUI-based programs (using windows common controls and such), Delphi is by far the best choice. if you plan on creating games or other performance-critical applications, C++ is probably a better choice (i am not saying Delphi is slow in any way here, because it isnt). if you want to learn programming, Delphi is far easier to learn than Visual Basic and outperforms it in just about any circumstance (Delphi executables also dont need a DLL with the runtime libraries in it to run either, but that option can be activated to produce tiny executables....)
I actually have both Visual C++ and Delphi and use them both often - which one you use depends on what you want to do (although i prefer Delphi for it's ease of use....)
in the end, it's up to you....
(sorry for the massive amount of text, but im going through caffeine withdrawal and my brain is going crazy....
-- señor codeman
codeman@crowbartherapy.cjb.net
|
|
|
|
|
East or West NoDoubt.. VC++ is best..
Renjith The True CP ian
|
|
|
|
|
We do database applications and large GUI based programs, but we use VC++ because we can make very small distribution packages which is critical for us as we do all business via the internet so our clients must download the program as we do not send any software on CD.
I don't know anything about Delphi, but I'm thinking on difference might be that a setup for a Delphi built business application versus a C++ built one would be much larger.
Is that the case?
|
|
|
|
|
No. MFC apps are generally much larger than Delphi apps. If you want small C++ apps, use WTL.
|
|
|
|
|
i'm not exactly sure which produces smaller exe's, but delphi can create standalone versions which don't rely on msvcrt.dll or similar libraries, or a library-dependant version (which chops a lot off the output file's size, but then it needs the runtime library dll, standalone versions only link with parts they need so they're usually smaller and simpler when installing on an end-user system.... the library dependant version rocks for development because it size is comparable to MSVC, Borland C++ and even, dare i say it, VB. smaller files means i have more hard drive space, which is an issue for me at the moment, being a 'poor student'......
personally i think the output file size difference wouldn't be worth comparing - Delphi was designed to develop business applications quickly (how many games were written in Delphi? not many compared to Visual C++) and it does that task well. from a beginner's point of view, its also a lot easier to learn and use (i learnt it first) - C++ has a bit more power than Delphi, but i've never needed any features that C++ has and Delphi doesn't. once again i guess it comes down to personal choice and experience...
btw, i'm only 17 years old (last year of high school in australia), so i dont have much experience writing business apps - if anyone from melbourne/geelong area wants to change that you have my email address...
-- señor codeman
codeman@delphidudes.com
|
|
|
|
|
VC++
Nish
p.s. Never used Delphi!
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Nish - Native CPian wrote:
p.s. Never used Delphi!
You wouldn't like it. Think of it as Visual Basic for PASCAL programmers
Michael
Errata 1: p. 154, section 'Defusing'. For 'red wire' read 'blue wire'.
|
|
|
|