|
Hi,
If you need to put so many controls on a single dialog, there is something wrong with your design. This is most definitely not manageable.
There are different ways to implement a manageable dialog, which does the same (or even better):
- property sheets
- sub dialogs
- child controls
- status bars
- toolbars
So the real question is why do you need so many controls on a single dialog.
codito ergo sum
|
|
|
|
|
Hallo everyone,
For the last two days I am stuck at a very silly problem. I want to call GNU zip (gzip.exe) from within a C++ program and redirect the output (compressed/uncompressed) files to a filename of my choice.
The command for compression/decompression is:
<br />
gzip.exe uncomp.txt > nuncomp.gz<br />
gzip.exe -d uncomp.gz > nuncomp.txt
I tried using different API functions :
<br />
With ShellExecute I have tried:<br />
ShellExecute(NULL, "open", "cmd", "/A /C \"D:\\gzip.exe\" D:\\uncomp.txt >D:\\nuncomp.gz", ".",<br />
SW_HIDE);<br />
ShellExecute(NULL, "open", "D:\\gzip.exe", "D:\\uncomp.txt >D:\\nuncomp.gz", ".", SW_HIDE);<br />
and some other variations. I have similarly tried to use the redirection operator > under system (STDLIB) and CreateProcess. But none seem to work. If any of you have perhaps used the redirection of output to a file in past please let me know.
I should mention that the functions work as expected when not using the redirection operator. The possible effects of adding a redirection are:
* the redirected file is never created and the function behaves as if there is no redirection
* a redirection file is created but the output is still written to the default file
* a redirection file is created but the executable (gzip.exe in this case) never exits or flushes the file.
Thank you
-- modified at 13:06 Wednesday 2nd November, 2005
|
|
|
|
|
One of the parameters to CreateProcess is a pointer to a STARTUPINFO structure. This has members that allow you to specify file handles to be used for standard input and output for the process you are starting with the CreateProcess call.
|
|
|
|
|
|
|
Yes.
Lose the DllMain.
Create a object dervied from CWinApp, declare global instance of it.
Whatever was done in DLL_PROCESS_ATTACH, do it in CWinApp::InitInstance
Whatever was done in DLL_PROCESS_DETACH do it in CWinApp::ExitInstance.
Link with appropriate MFC library (static or dynamic).
There may be a few other compiler or linker settings to tweak, but that is the gist of it.
|
|
|
|
|
Hi All,
Sorry to post such an open ended question, but does anyone have an opinion on the best way for an experienced developer to learn C++?
I have worked with VB6(Don't tell me - a toy language! ) and C# for some time now and I would consider myself to be pretty competent with both of these and SQL. I have also done a considerable amount of Web Development using ASP/ASP.NET and Javascript. Recently I did some reading on C++ and decided I would like to learn this too, however I am unsure where to start. A lot of the articles I have found start at a very low level - understandably aimed at novice developers. Does anyone have any suggestions/links/books that they would recomend for someone in my position?
Thanks.
MCSD(VB6/SQL7)
MCAD(C#/SQL2000)
MCSD(C#/SQL2000)
|
|
|
|
|
I assume that you have basic understandings in the area of OOP. If so then I really recommend you this book : Teach Yourself C++ by Herb Schildt - 3rd Edition
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
Yes I am very familar with OOP
Thanks for your response - I will take a look at this book.
MCSD(VB6/SQL7)
MCAD(C#/SQL2000)
MCSD(C#/SQL2000)
|
|
|
|
|
You should be aware that many C++ gurus consider Schildt to be very poor. For example, look at the book reviews at http://www.accu.org[^]
Kevin
|
|
|
|
|
I remember reading one of his Turco C books back in the early 90s. That, coupled with Petzold's Windows book, did wonders for me.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
the best book i've ever read on C++ is The C++ Language[^], written by the creator of the language, Bjarne Stroustrup.
i found it so complete that i now have it at home...
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 10:37 Wednesday 2nd November, 2005
|
|
|
|
|
I wouldn't recommend it for a C++ beginner though. It's more useful once you've had some experience with C++.
Kevin
|
|
|
|
|
2 things :
-Mr Leather99 don't seem to be a beginner... he - himself - qualify as an experienced developer
-I learnt C++ reading this book !!! i had no OO basics, few C ones...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote: Mr Leather99 don't seem to be a beginner.
He's a C++ beginner though. Even after having done C++ for quite some time I found Stroustrup's book heavy going. I also found it more useful as a reference rather than as a first book.
I actually learnt C++ mainly from Bryan Flamig's (now very ancient and probably out-of-print) Turbo C++ Step by Step. I still occasionally refer to it though.
Kevin
|
|
|
|
|
Odd that you would recommend learning C++ from someone other than its author.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Not at all. Because someone created a technology it doesn't follow that they are the best ones to explain its ideas.
Kevin
|
|
|
|
|
Hello,
What you need to reed depends on what you want to do. If you want to write windows programs, you can study MFC or WIN32. I don't recommand WIN32 since MS is moving to another platform.
When you want to learn how the standard library works, you should read 'The C++ programming language' by Bjarne Stroustrup. This book was already suggested.
My suggestion is that you start to build small C++ programs in C++. Design them well first and read about each topic you come across. If you need some data structure for example, read about vectors, maps, lists, etc.. So for your first toy app, you almost read an entire bookm but you'll read less and less each time. I found that this is an easy way to learn a new language if you are an experianced developer.
One more tip, learn about the C++ memory model very fast. Since it is not managed like C#, you can easy leak tons of memory. This was one of the biggest pitfalls for developers who step down to C++ from a managed language.
Hope this helps.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Thanks for that Bob... Yes Memory allocation etc is something i have generally been able to avoid using VB and .NET. I will keep it in mind.
MCSD(VB6/SQL7)
MCAD(C#/SQL2000)
MCSD(C#/SQL2000)
|
|
|
|
|
A common error for C# or Java programmers moving to C++ is the tendency to use heap allocation (new) everywhere. But the general strategy for C++ is to
1. Use dynamic allocation only when its necessary.
2. Prefer using library data structures, e.g., std::vector, std::list, to rolling your own.
3. If you must use dynamic allocation, use a smart pointer class, e.g., auto_ptr or boost::shared_ptr
Kevin
|
|
|
|
|
|
I will work my way through those.
Thanks Kevin - and to everyone else who responded.
MCSD(VB6/SQL7)
MCAD(C#/SQL2000)
MCSD(C#/SQL2000)
|
|
|
|
|
Hello guys,
I have next situation : I have a class CHugeInteger , which has four public functions :
1) CString add(CString &a,CString &b)
2) CString sub(CString &a,CString &b)
3) CString mul(String &a,CString &b)
4) CString div(CString &a,CString &b)
I also have two(or more) protected member functions : foo1(..) ,foo2(..) ,...;
The later four public functions I need for doing arithmetic operations on very large numbers.
The protected functions are called by public functions very many times,especially when I am doing arithmetic operations with very big numbers(more than 500 digits).
Also public functions call each other very many times , for example div calls add ,sub and mul .
My questions is : what is the best way in this case to declare these functions(static,friend,inline,global..) in order to get best performance ?
My first implementation looked like this :
-The four public functions(add,mul,div,sub) were declared as friend functions.
-All protected members as static .
So the class's user interface was also easy to use as the client could call the functions straight like :
CString s = mul("23423423498989898877234234","4568988590866085685686805680")
but the user interface is not important for me.And I thought that latter implementation was not the best way of declaring functions for getting highest performance.
Can anyone help??
thanks
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
me think the cost of calling a function/method will be negligeable compared to the cost of doing the calculation.
but I might be wrong.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote: me think the cost of calling a function/method will be negligeable compared to the cost of doing the calculation.
Of course you are right , but I have modified the functions as much as I could in order ro achieve better performance , but now if I increased the speed of calling them It wouls do me a hand.
Imagine the case when I need to call the protected members or public for example 10^100 times.I really think in this case the calling method would give me a difference in time.
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|