|
hi, guys
I am newer to MFC and have a question here
----------------
| |
| |
| A |
|_______________|
| |
| B |
|_______________|
Area A and B is two zones, I have a Button in A, and if i click the button, B disappears, showing below, only A; if i click the button again, B shows like above pic
----------------
| |
| |
| A |
|_______________|
my question is how to implenment this function? could you guys give me some idea? thank you very much
|
|
|
|
|
When you design the dialog, make it with area A and B showing.
In the OnInitDialog function of the dialog use SetWindowPos method and set the new height in its cy parameter.
On button click use SetWindowPos again with the full height in the cy parameter.
You can get the current window position using GetWindowRect function.
|
|
|
|
|
You can handle the button click and in the handler, resize the window to appropriate sizes.
|
|
|
|
|
|
thank you, Good Garth, that's exactly what i need
|
|
|
|
|
might be these functions useful for u.
MoveWindow() or SetWindowPos().
Regards,
Srinivas
|
|
|
|
|
thanks, the problem has been solved
|
|
|
|
|
I need a simple HTML parser that can read text from a html file (bold or italic) and tables. I work with Borland Builder C++ 6.
Could you please direct me to some articles/code?
THANKS!
|
|
|
|
|
This[^] article may help.
/ravi
|
|
|
|
|
thanks!
I forgot to mention that the file is from the local hard drive, not from a web server.
modified on Monday, November 30, 2009 5:01 PM
|
|
|
|
|
justme89 wrote: I forgot to mention that the file is from the local hard drive, not from a web server.
Not a problem - just have constructUrl() return a file:// URL.
/ravi
|
|
|
|
|
What about creating your own simple parser using regular expression??
|
|
|
|
|
hello friends
I have to finish an assignment tht says do unlimited number times an undo redo operation in console application.
I wrote an application but in my application I m adding and removing a number from the list and after that i m performimg undo and redo on that.but that is not sufficient.
I need some operation on that I can perform Undo redo but in console application.
Thanks & Regards
Yogesh sikri
|
|
|
|
|
I am not sure about what you are trying to do. What types of operations do you want to undo/redo? You have to give details about your project.
|
|
|
|
|
undo/redo is pretty simple. you need:
1. a data structure that can hold all of the information about any operation the user can perform which can be undone.
2. two stacks
every time the user performs an operation, fill out a structure with all of the information needed to undo that operation, and push it onto the undo stack. clear the redo stack.
to undo, pop the top item off the undo stack, and reverse everything in that item. then push that item onto the redo stack.
to redo, pop the top item off the redo stack, reverse everything in that item. push it onto the undo stack.
|
|
|
|
|
hello
thanks for ur reply,but i m doing some oeration like adding number to vector and removing.i want to know tht can i do any more operations.?
Regards
Yogesh
|
|
|
|
|
In addition to the replies above,
Check here[^]
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy.
|
|
|
|
|
Guys,
what is wrong in here?
i am trying to make a small util to execute commands on linux with source in c
the problem is with the parameters array
http://91.199.99.120/temp/ex1.c[^]
Thanks
|
|
|
|
|
Please read the guidelines on posting above. Then, post the section of your code that is failing and include a proper description of what is not working.
|
|
|
|
|
alonchap wrote: what is wrong in here?
Numerous things. For starters:
You need to check the value of prompt before trying to print it.
You are using command incorrectly (hint: it points to nothing valid).
The first argument to strtok() must be modifiable.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
hi i noe this may sound simple but im having problem in converting char to string.
string get_currenttime(){
time_t rawtime;
string s1,
stringstream ss;
struct tm * timeinfo;
char buffer [80];
time ( &rawtime );
timeinfo = localtime ( &rawtime );
strftime (buffer,80,"%c",timeinfo);
ss << buffer;
ss >> s1;
}
From the above code which i found online, i need to convert the data in buffer to string. i tried using stringstream but results are not complete. See above for example
|
|
|
|
|
You don't need the stringstream variable. Just use
s1 = buffer;
and it will create a string from the contents of buffer .
|
|
|
|
|
The difference in result that you see is because the >> operator will get characters only till a newline or space character. You could use the getline function to get the entire result. But the solution suggested by Richard MacCutchan is simple and the best.
|
|
|
|
|
We are using visual studio to build our applications. Our biggest concern is link time especially for debug target. I list bellow what we tried to minimized link time and what were the gain. If you have others suggestions, reply to my post.
Note that I post a suggestion on “Microsoft Connect” titled “Optimize link time in real developers environment”, feel free to vote for it at : https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=511300&wa=wsignin1.0
1 - Convert many statics libraries to DLLs. Important gain.
2 - Remove debug information for libraries who are rarely debugged (good gain).
3 - Delete PDB file in « Pre-Build Event » (strangely it give interesting gain ex: 2min44 instead of 3min34).
4 - Working with computer equiped with lot of RAM in order to maximize disk cache. The biggest gain. Same computer can link 20 times faster with 16GB instead of 2GB. More than 16GB change nothing.
5 - Big obj versus small obj. No difference.
6 - Use secret linker switch /expectedoutputsize:120000000. Small gain.
7 - Maximize Internal linkage vs External linkage. It's a good programming practice.
8 - IncrediLink (IncrediBuild give interesting gain for compilation but almost no gain for link).
9 - Explicit template instantiation to reduce code bloat. Small gain.
10 - Partial template specialization to decrease the number of symbols. Small gain.
11 - Change project options (/Ob1, /INCREMENTAL, Enable COMDAT folding, Embedding manifest, etc.). Some give interesting gain other not. We try to continuously maximize our settings.
12 - Separate software component as much as we can afford to minimize dependencies. You can then work in unit test that link fast. But we still have to integrate things together, we have legacy code and we worked with third party components.
Note that for all our experimentations, we meticulously measured link time to ensure repeatability.
Thanks
|
|
|
|
|
Very interesting topic. I'm working with a 1 MLOC application with only static libraries, and funny enough we also have issues with linker times in Visual Studio
Our experience is this:
1) Incremental linker in debug-builds can give really fast link times (seconds compared to minutes). But if a change touches too many files, then it can actually cause the incremental linking to take twice the time of a full link.
2) Incremental linker doesn't work properly with static libraries by default. There is an option in VS2005 (and newer) called "Use Library Dependency Inputs" that will solve the issue by linking to all obj files in the library instead of the library itself. This is the same as Incredibuild IncrediLink (Aka. FastBuild).
3) Incremental linker doesn't work if using pragma comment to include the lib of a dll, and using relative path to the lib. The solution is to use the linker-option /LIBPATAH and not specifying path in the pragma comment.
4) Incremental linker can trip over its own feet and sometimes corrupt its incremental-helper-file (called .ilk). This can grow to a huge size (+200 MByte), and causes the incremental linker to fail or just take forever. Have implemented a pre-link step that checks that deletes the ilk-file if it looks corrupt.
5) Our datamodel objects inherits from a special template class, that implements a lot of type specific template methods. This cause a lot of implicit template instantiation all over the code. We got rid of that by declaring all methods on the template class as virtual.
6) Changing static libraries into DLLs really helps. But there is the issue about ensure code stability with versioning of DLLs so it matches properly (along with same compiler options). By compiling with Runtime CRT in a DLL, then it makes it easier to export classes, since it allows one to transfer objects over DLL boundary without needing to worry about which side should allocate/free the memory for the object.
7) Using Solid State Disks (SSD) for compiling and linking really helps performance. Good SSD disks are close to RAM in seek time and throughput (300 MByte/sec - SATA limit)
Some comments about the compiler/linker options you mentioned:
/Expectedoutputsize - There is a little documentation[^], but I never heard of it though. Will try it out.
/Ob1 - Inline function expansion should stay to default for debug-builds
/INCREMENTAL - Should only be used for debug-builds (never for release-buils). Can sometimes (As I have mentioned above) give longer linker times.
/Enable COMDAT folding - Should only be used for release builds as it slows the linker time (Can be considered for compiling debug-versions of dlls, as it will minimize the size of the debug-dll).
/Embedding manifest - If the incremental linker is working, then the embedding manifest is pretty much a no-op. If the incremental linker is having problems, then it can some times be a full link again. The manifest is kind of necessary now if wanting to mark your application as Vista/Win7 ready. You can consider leaving out the manifest for your own internal dlls, since it is the application manifest that controls everything.
It seems Microsoft have looked into pipelining the linker-process using threads in VS2010 (Coming marts 2010). This should improve linker times with 10%.
modified on Wednesday, December 9, 2009 12:06 PM
|
|
|
|