|
I'm not saying that memory fragmentation is the problem. I don't know what the problem is. Let's try to find that out!
|
|
|
|
|
I am asking about the calculation i.e 72 MB for each CreateDIBSection call.
|
|
|
|
|
Rather than repeating the same question over and over, would it not be better if you acted on some of the advice you have been given? We do not know the exact amount of memory that is being used, and the best estimate is the one you have been given. It is up to you to do some logging/debugging of your application to find out what is actually happening when the code runs, and how much memory it is consuming.
Veni, vidi, abiit domum
|
|
|
|
|
Exactly!
|
|
|
|
|
Amazing how many people belieive that we CPians have some "magic bullet".
Veni, vidi, abiit domum
|
|
|
|
|
An even worst case scenario (not this one) when they think we can read their mind along with their unposted source code so we can put together a ready-made solution they can just copy-paste from the forum post into their IDE... I love this when coupled with some rocket engineering problem without math/physics knowledge!
Solving and debugging this problem is just basic memory examination as a first step, I really don't understand what takes so long... Maybe some lazyness??? Some periods of the development are really boring even in case of the best hobby projects...
|
|
|
|
|
Post the exact function call and describe the value of incoming parameters if possible.
|
|
|
|
|
6000 x 4000 x 3 = 72,000,000 bytes. or ~68MB.
|
|
|
|
|
I have an SDI application that uses a CFrameWndEx main window and has several CDockingPane 's inside of it.
The problem is that when I choose to create a new document, the Framework automatically resets the size of the CFrameWndEx to some fixed value that is stored somewhere (I don't know where.)
How can I disable this "feature?" I want the frame window to remain the same size when a new document is created.
EDIT:
The solution was to remove the call to ResizeParentToFit() in the view's OnInitialUpdate() .
The difficult we do right away...
...the impossible takes slightly longer.
modified 26-Aug-13 0:11am.
|
|
|
|
|
Even though Visual Studio 2010 and Visual Studio 2012 use the same file extension (.sln) for their solution files, somehow the File Explorer is able to assign them different file icons.
One of them says "10" and the other says "11".
Does anyone know how the File Explorer knows the difference between the two?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
How to Create Icon Handlers[^]
I guess this is the key for VS: HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln
The icon handler of visual studio is parsing the first 1-2 lines of the sln file if I remember right, the line that seems to be a comment is also used by the handler!
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
|
|
|
|
|
Thank you.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
|
One more strange behavior of stuff in CPropertyPage ( see CListCtrl selecting item inconsistent bellow) .
I cannot select the CEdit control using mouse ( to enter text) , but it works using tab and when I test the dialog by itself.
Would someone be kind enough to try this on the latest and greatest MS VS?
I am about to reload my IDE, and it but it would be nice to know before I spent hours doing that.
I really appreciate this forum help.
Cheers
Vaclav
|
|
|
|
|
Vaclav_Sal wrote: ...and when I test the dialog by itself. So it works fine on a dialog but not a property page?
Vaclav_Sal wrote: Would someone be kind enough to try this on the latest and greatest MS VS? VS2013?
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Yes, when I test the dialog flipping the ON/off switch in resource manager it works.
I did build a simple dialog based test app ( CFormView ) and it works there too.
As I said, I got too many fires going - the other one is that my CComboBox won't sort dynamically added items, only the initial "static" data.
I really feel I need to reload VC 6.0 or "upgrade" to whatever. Too many strange problems.
But my serial control of my radio works, one atta boy!
Cheers Vaclav
|
|
|
|
|
Next time my XP crashes I'll install VS 2013 and test this.
I cannot do it now, last time I "upgraded" to VS I ended up reinstalling both clean XP and VC 6.0!
It reminded me going from VB3 to VB4 fiasco. To risky.
Cheers Vaclav
|
|
|
|
|
I have a C++ application that has 3 functions. The first is the standard int main entry point function. The other function is a simple test function void Test(). And finally the 3rd is a analysis function that takes several parameters one of which is a std::vector. Both the main and Test function pass the same parameters to this analysis function. In theory these 2 functions should return identical results. However they don't. The main function is called from a command prompt and the other function is called from a python script. I have eliminated marshaling issues by not passing parameters to or from the Python environment. The Python environment simply calls the test function. However after placing print statements throughout the library I have seen that the results are completely different. Does anyone know of any memory model issues or threading issues that can occur between these 2 environments that might lead to something like this.
void Test();
void Do(std::vector<int> &x, int search);
int main(int argc, char* argv[]) {
std::vector<int> x; int search =8; Do(x,search);
}
void Test() {
std::vector<int> x; int search =8; Do(x,search);
}
void Do(std::vector<int> &x, int search)
{
}
I don't want to bother with the Python code here though it just calls the test function...it appears to run so, not sure what else it has to do other than wait for the C++ library to finish.
nothing
|
|
|
|
|
You should see that from this info it's impossible to tell what's wrong with your code. The only valid answer is: debug it.
If you are using multiple threads then make sure that there are no race conditions as the first step. You should know what kind of threads present in your system. If you don't know it then its a big problem, then try to find it out with your debugger.
Lets assume that you have no race conditions or you have eliminated all of them. The problem is obviously not the contents of main() and Test() even in case of multiple threads because they use just local variables and they contain the same code. You Do() function does the following: It puts together a result by using the input parameters and some variables (state) inside your program. The input parameters of Dd() are always the same so the only difference between the calls from main() and Test() can be that the code of Do() (and the code of all function calls performed by Do()) see something different in your program state when it calculates the result.
So the difference in your program state can have several different reasons:
1. You simply fill different values into some variables before calling Do() from Test() and main()
2. You have some bugs in your program for example uninitialzed variables or memory overwrites. For this reason your Do() calls may see different values in some variables used for the calculation of the result.
3. If you have multiple threads and they are modifying the same internal variables used by Do() even with proper synchronization without race conditions then don't be surprised if Do() may return completely different results for the same input parameters if it uses some variables that are shared with another thread and modified randomly by another thread.
Check out your code and check what kind of data is used by the Do() function besides the input parameters to put together the result! Check all code that possibly modifies these variables. Start debugging!!!!
Use your debugger: First put a breakpoint into Test() and check out which thread calls it and what is the callstack. Probably you have called into the python interpreter from your program and the same thread called back into C++ but who knows, its your code and you keep it a secret right? After this execute the call into the Do() method step by step from both the main() and Test() methods and try to find out where is the difference between the two calls. Its boring like debugging anything else...
|
|
|
|
|
Well Thanks for taking a stab at it, I know this post wasn't much to work with but I am dealing with various constraints none the less. I have not found an answer for this behavior yet, but I will continue to look for one.
nothing
|
|
|
|
|
You are welcome! Definitely check out the meaningful threads in your prog and the callstack on which python calls your C++ code. Without that you are just blindly navigating in fog... Check out the bottom of the callstack that calls into python when the breakpoint in Test() fires. If you are good then it is the very same (Main) thread that you are using. Still interference with other threads as the result of bad threading design can be evil when it comes to unpredictable program state used by your Do().
|
|
|
|
|
how to write a program in which whatever the user types into program is typed into microsoft word letter by letter....like i paste the essay of 10 pages into the program n the program gives the same in ms word letter by letter......plzz help
i know i can just copy paste it or just type into ms word directly but still i need the program..
|
|
|
|
|
|
|
Extend your legal chess move identification program as follows:
• Allow the user to add an arbitrary number of pieces to the board (either red/black or
white)
• Allow the user to select a given piece and then that piece must work out its set of
valid moves from its current position
• A piece cannot move over a piece which is the same colour as it is
• A piece may move over (and replace) a piece which is of the opposite colour.
• Create a Visualiser Abstract Base class which implements a show() pure virtual
function
• Create a TextVisualizer derived class which overrides show to display
the chess board (with legal moves for the selected piece) to the standard
output stream
• Create a GraphicalVisualizer derived class which overrides show to
display the chess board (with legal moves for the selected piece) as an
image.
|
|
|
|