|
Are you running those tests on a separate thread? A modeless dialog doesn't run in a separate thread.
|
|
|
|
|
|
Thanks,
I haven't had to deal with threads yet, but I found a good article by Fritz Onion on Multithreading in MFC. I think I will be able to implement a UI thread to do what I need.
Buck
|
|
|
|
|
I've got a memory question. My program runs at around 5-6M under the memory usage when first started. And remains around that as it runs, however if I minimize it and re-open it, it runs at around 1.5M under the memory usage. I've checked for basic memory leaks and can't seem to find anything. Any thoughts on how I can get it to run at 1.5 on first startup? Any suggestions on good memory articles. Anythoughts would be appreaciated.
Cheers*
|
|
|
|
|
|
Thanks, It was really worthy
|
|
|
|
|
hmm I'm not sure If I'm not getting it or if I did not explain myself well. I also tried to implement the example in the link you gave me and could not get it to work. Where am I suspose to place the LRESULT CALLBACK? I realize that my program should use less memory when it is minimized however when I reopen(restore) my program(from being minimized) it runs with less memory(than when first started) at the same size as when I first initiated the program. Ie: Start the program 5-6M Minimize the program 400-800K Restore program 1-2M! Is my program now functioning less efficiently or was it using more memory that it needed to being with. Any thoughts would be greatfull to help inlighten my understanding. Cheers*
|
|
|
|
|
By doing what you are trying to accomplish your program will be less efficient.
In your case with your program only using 5-6M I really wouldn't worry about it. If another process needs more physical memory the OS will trim the working set of your app anyway.
You also might want to read Joseph M. Newcomer's essay How Big Is My Program[^].
Kelly Herald
Software Developer
MPC
|
|
|
|
|
My 5M memory does seem like a small thing to fuss about except that its a graphing program that connects to a COMport and the operating system/computer often runs 12-20 of these programs at once (all open/not minimized) ... and ideally as many as we can visually fit on the screen so reducing the memory is quite important(as far as I can understand). As the more programs we add the slower and slower the computer functions.
Just to clarifiy if I minimize & resize my program it is now running on less memory (1-3M) but is running less efficently?
Thanks for your suggestions and I will look into the article you suggested. Any more thoughts appreciated.
Cheers*
|
|
|
|
|
Hi all,
I'd love to benefit from some of the expert advice which I regularly see on this site...
I'm creating a new application which will include high-end video playback with live compositing of graphics and possibly even 3D elements. It can be a bespoke system and therefore can be reliant on high-end graphics cards and specific software configurations. It could be targeted specifically at Windows XP or Vista.
My current experience includes most graphics/multimedia apps plus the following dev environments:
- C++
- MFC
- C#
- .Net
- Managed DirectX (currently learning)
For playback I am currently looking at DirectX as the primary technology. Does anyone have any advice or specific resources for the following:
- OpenGL v. DirectX for 2D rather than 3D
- 2D uses of DirectX (Directshow's future seems vague)
- General advice
Many thanks in advance guys,
Simon Reveley
Guildford,
UK
|
|
|
|
|
I have some code from an old C++ 4.0 project that I am trying to update for a friend. I know very little about C++. I have some C experience and some C# experience.
Does anybody have some answers to these questions.
Would I need the old Visual C++ 4.0 to view and compile the code?
Could I use a newer version like 5.0 or 6.0 to view and compile the code?
Would I have to change the code to use in a newer version?
Is there any way I could make it work in Visual Studio 2005?
If there is anyone that could give me some direction, I would appreciate it.
|
|
|
|
|
I would try to compile and run it with either VC5.0 or VC6.0
even then i could be possible that you need to change some code to get it working.
Eventually you could try VS2005 but again probably with some code changes.
If its a relative simple program you could do it in one step, but if you have the other
compilers i would suggest to do it step by step
codito ergo sum
|
|
|
|
|
There's no way for us to answer that, it depends entirely on the code. Compile it and see what happens.
Unless the code is using some MS extension or library that existed only in v4, or is relying on behavior that changed between v4 and now, there's no reason it shouldn't compile on v5-8.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Hello,
Sometimes when looking at C++ code I see member function code that contains a statement(s) with 2 colons as shown below:
HRESULT CSomeClass::OnDraw()
{
//2 COLONS HERE
-> ::DeleteObject(hbmpOld);
}
What does the resolution operator refer to inside the function?
Thanks,
Jerry
|
|
|
|
|
It means to call the function at the global level, rather than calling the one with the same signature that might be defined as a member of the class.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
|
:: is the resolution operator.
It makes the scope of the function to global.
usually as there is no global function with the same name declared it will point to the win32 api function. So generally we use this for calling a win32 api.
in ur case ::DeleteObject(hbmpOld); means it invokes this GDI api.
cheers..mil10
|
|
|
|
|
Sir,
I used the word "plzzzzzzzz" just to make a request n not for begging and if u r thinking so, u r on mistake. Instead of criticising if u will help other, its much better for u n other people.And thanks for the reply.............
|
|
|
|
|
jalpari wrote: Sir,
I used the word "plzzzzzzzz" just to make a request n not for begging and if u r thinking so, u r on mistake. Instead of criticising if u will help other, its much better for u n other people.And thanks for the reply.............
Regards,
Nish
|
|
|
|
|
You stand a much better chance of receiving help if you'll lose the SMS stuff.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
:|Yes it will compile! I have already got it working. I just need other instructions. It is not like drawing on a piece of paper. Computer language is not the same thing. C++
Charles Reese
|
|
|
|
|
I think he ment write the goal of the application down in pseudo code on paper. Then move to a programming language like c++.
like this
pseudo code: to draw * in triangle
draw *
draw **
draw ***
...
draw ***...* now create a function to draw a line giving the number of asterixes you need
draw_line 1
draw_line 2
draw_line 3
..
draw_line n we now see a sort of iteration meaning a loop construct (for , do, while)
for count = 1 to n
draw_line count
next the draw line code looks simular
for number of asterixes = 1 to n
draw *
next
We can now convert this into real code very easy
<code>void draw_line(int iNumberOfAsterix)
{
for(int iCount = 0; iCount < iNumberOfAsterix; iCount = iCount + 1)
{
cout << "*";
}
cout << endl;
}
int main()
{
int iNumberOfLines = 5;
for(int iCount; iCount < iNumberOfLines; iCount = iCount + 1)
{
draw_line(iCount);
}
return 0;
}</code>
just include the correct headers and it will work.
I hope that this is what you needed
codito ergo sum
|
|
|
|
|
do you know what you're talking about ?
you'd better learn C++ first
you are on codeproject since only 2 days, and you already attack the big members on this forum. tssss, it's far from being a good solution to get an answer to your problem.
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
How can I launch my COM exe server under some user?
Where can I define "username", "password"?
Thank you.
Petro
|
|
|
|
|
1) Type dcomcnfg in the Run dialog
2) Expand Component Service ->Computers -> My Computer -> DCOM Config
3) Select ur component
4) Right click and select properties.
5) Click on the Identity tab in the Properties dialog box.
6) Select "This user" readio button and enter the user credentials under which u need to run the component.
cheers...mil10
|
|
|
|