|
how do i enable and disable buttons on a toolbar in a standard MDI?
|
|
|
|
|
|
i have used the code as below to enable it
m_wndToolBar.GetToolBarCtrl().SetState(ID_COMMAND_PLAY, TBSTATE_ENABLED);
how do i get to disable the button again?
|
|
|
|
|
I have an application that needs 2GB + of virtual memory and when the memory load goes over a certain point the system starts thrashing and continues to do so for over 10 minutes. I have worked hard to optimize the application by the use of memory mapped files and other optimization techniques. The problem would be solved if I could reduce the size of the working set of my main process and all its child processes when then memory load goes over a certain point. My issue is that when you call SetProcessWorkingSetSize on a background process Win2k will minimize the working set size regardless of the parameters you pass. The problem is that is definitely not what I want to happen. The background processes hold image data I don’t want to be fully paged out. I just want the process to trim the working set by say 10%. Is this possible? One idea to get around this problem is to issue a VirtualLock on the percentage of image data that I need to keep in the process working set then set the working set then issue a VirtualUnlock. Do you think this would work? Can you issue a VirtualLock on a memory mapped region?
Thanks in Advance,
John M. Drescher
Hardware and Data Specialist / Programmer III
University of Pittsburgh Radiology Department
http://www.geocities.com/SiliconValley/Haven/1654/
jdrescher@geocities.com
|
|
|
|
|
A couple of years ago, I was in a team writing a raster image processor system. That means doing manipulations on postscript image files of several Gigabytes. Every component does its task on the file and passes it on to the next stage or component, like a conveyor belt… These components where running on the same system or were distributed over different networked computers. What we learned - when using memory-mapped files (every stage, an intermediate file was saved on the disk of the process doing the next manipulation) - is also the phenomenon you noticed: the system starts trashing when a certain memory usage limit is reached. The solution: Although memory mapped files are great, you have to limit the amount of memory that remains mapped or face the fact that for huge files the system will grind to a halt. You can do that by looking at the parameters of the functions that create the memory mapped file and view. However, the best and most efficient way to do the work is to program the file manipulation yourself. Yes, ReadHandle, WriteHandle and Seek stuff, allocating your own buffers, etc… A lot more work, but I guess in your case well worth it. It is never easy to admit you have to go back to the drawing board, but we did just that and eventually we were very pleased with the end result. IMHO using SetProcessWorkingSetSize, VirtualLock, etc... will not solve the design issue.
Just my 2 cents,
BR,
Gert.
--------------------------------------------------
If my messages appear curt, I apologize.
I try to be brief to save your time as well as mine.
--------------------------------------------------
|
|
|
|
|
Thanks,
After solving the problem of running out of process space, I have worked hard to limit the amount of memory (dirty pages specifically) in the memory mapped files. I force the system to flush a small part of the images periodically, because the lazy write was not aggressive enough and the file cache was eventually claiming all the memory. The system that this application is designed for is a dual processor Athlon 1.2MP with 2GB of registered PC266DDR RAM and my data set should not be much more than 2GB.
|
|
|
|
|
Have you actually tried allocating 2GB of memory or are you using AWE?
The amount of memory available to a user program under NT on a 32 bit processor is just 2GB (0-7fffffff). Of course, when you include stack space and OS dlls, that number drops below 2GB.
Virtual Address Space
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Yes I now know. I thought Win2k server had 3GB user and 1 GB os, but I would have to upgrade again to advanced server. I just upgraded from Win2k Pro. I had to use memory mapped files to get around this by only mapping the images that I needed at the time. The memory mapped files would stay in memory as long as I had them open and there was free RAM. I thought about AWE, but I wanted to page out a small percentage of my image data and AWE does not support this.
|
|
|
|
|
I fixed the problem in my application.
> (taken from another site) Why does SetProcessWorkingSetSize not work on background processes?
It was the way I was using calculating the size of the working set which caused the problem. I first got the maximum size of the working set using GetProcessWorkingSetSize() and then using SetProcessWorkingSetSize() with the maximum set to .9 * Max
I'm not exactly shure why this failed but after I made sure that this max was no less than 1/2 the size
of the committed memory size of the process ( I calculated this using VirtualQuery) it worked as expected.
|
|
|
|
|
ok, i have a snippet of code here:
char buffer[100];
for(i=0, i
|
|
|
|
|
The documentation for send() says:For message-oriented sockets, care must be taken not to exceed the maximum packet size of the underlying provider, which can be obtained by using getsockopt to retrieve the value of socket option SO_MAX_MSG_SIZE. If the data is too long to pass atomically through the underlying protocol, the error WSAEMSGSIZE is returned, and no data is transmitted.
|
|
|
|
|
Hi,
How can I chnage the bitmap of a single toolbar button?
Thanks,
Erik
|
|
|
|
|
Try SetButtonInfo(). There is also a class created by Christian Graus and Masoud Samimi here which can change the bitmap of a toolbar button with a transparent color.
-Raffi
A Sign of Boredom
|
|
|
|
|
On some webpages that use some scripting languages VisualStudio thinks there is some errors on those scripts and gives annoying message if i would like to debug that webpage. Is there any way i could turn this feature off.
Before when i chose it to debug it showed a screen where i could choose debugging with Visual Studio 6 or Visual Studio .NET..but on both of those programs i switched of the Just-in time debugging and now it only alerts that there was eror on a script on website and if i choose to debug it doesn't do anything (because i switched just-in-time debugging off) but it still displays that annoying alert dialog. So anyone knows how to get rid of it.
Thanks a lot
|
|
|
|
|
In Internet Explorer. Tools->Options->Advanced. Under Browsing there is disable script debugging checkbox.
Michael
|
|
|
|
|
I downloaded Mike Blaszczak's http://www.nwlink.com/~mikeblas/samples/stealth.zip
It is a VC++ 5.0 project.
I'm using VC++ 6.0
I put it here C:\Program Files\Microsoft Visual Studio\MyProjects\Stealth\
After compiling I receive this alert:
Error Starting Program
The STEALTH.EXE file is
linked to missing export MFC42D.DLL:1365
This Windows message popped up as well:
C:\program Files\Microsoft Visual Studio\My
Projects\Stealth\Debug\Stealth.exe
A device attached to the system is not functioning.
Where can I find this missing dll?
MFC42D.DLL
Do versions 5 and 6 build code similiarly?
|
|
|
|
|
I downloaded the sample and recompiled it with Version 6 without any problems. Did you do a Build or a Rebuild all. Try doing clean first and then a rebuild all. It sounds like you ran a version 5 exe which tried to use the version 6 MFC42D.DLL
Michael
|
|
|
|
|
I want to define controller for ActiveX like
MS ADO ,or DBGrid in vc++.net but when I right click
on them and press"varibles" it doesn't give me
class for their controler??
|
|
|
|
|
Hello.
I am very close to getting my program working. I would like to know how to send something from an STL container to:
1) cin
2) cout
and especially
3) ifstream
4) ofstream
ifstream temp;
std::string text;
temp << text // this does not work.
It seems I cannot use the sample approach with STL as character array or string.
Do I need to implement an iterator?
Kuphryn
|
|
|
|
|
have you tried
<br />
temp << text.c_str()<br />
Michael
|
|
|
|
|
Just seen the solutuion proposed by Michael P Butler, yeah - it's should work - but
it needs additional call to c_str() member function (dont wanna say that this will cause the
perfomance problem, but it's not looks fine =)
The my STL's implementation (the one that comes with VC6++ ) and (most likely) yours have the << operator overloaded for a basic_string - so the code that you've shown
<br />
template<class _E, class _Tr, class _A> inline<br />
basic_ostream<_E, _Tr>& __cdecl operator<<(<br />
basic_ostream<_E, _Tr>& _O,<br />
const basic_string<_E, _Tr, _A>& _X)<br />
{<br />
_O << _X.c_str();<br />
return (_O); }<br />
in your post should compile flawlessly. The potentional problem that could cause the
compile errors is that you've included old include files...
so - try to compile this code:
<br />
#include <string><br />
using std::string;<br />
#include <iostream><br />
using std::cout;<br />
<br />
<br />
int main()<br />
{<br />
string s = "Russian Software Developers Network - www.RSDN.ru";<br />
cout << s;<br />
<br />
return 0;<br />
}<br />
if the code above will fail to compile - use the Michael's approach to workaround the problem.
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor@soukhov.com | ICQ:57404554 | http://soukhov.com
Russian Software Developer Network
|
|
|
|
|
Most likely you have not included the <string> class. <ifstream> will include parts of the string class which will allow you to declare and use a string, but it will not include the parts which include the insertion operator between string and streams.
--
Where are we going? And why am I in this handbasket?
|
|
|
|
|
Thanks everyone.
The new code works. It use the ostream_iterator and copy() function to output data from the STL deque container to ofstream.
Kuphryn
|
|
|
|
|
So I am almost done my project. Our app is pretty sweet.
So I was checking all the menus to make sure they work properly, and i crashed the app when i tried using the most recently used (mru) list in the File menu.
How do i use this little beast, i only have 4 items at a time showing (set this when i created the app).
I believe if i can get the path from the mru list i can then pass it to my open code (in the same class )
Christian if you are around ? Thank you again for all your help !
Our team actually got an interview with CBC radio (Canadian station) to discuss our app and the technologies used...
Rob Dunsmuir
|
|
|
|
|