|
I don't know this for sure (just a guess), so bear with me. But, the wizards in the DX SDK work with VC6, and I think even with 8.1 they still only work with VC6. I still haven't tried to use DX and VC7 together, so I don't know for sure.
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"Half the reason people switch away from VB is to find out what actually
goes on.. and then like me they find out that they weren't quite as good
as they thought - they've been nannied." - Alex, 13 June 2002
|
|
|
|
|
Does anybody know how to get extended information about a process under NT4/2000?
I have the ProcessID, therefore I can get a handle etc. but I need to know if the process is still
active(i.e. GetExitCodeProcess(hProcess, &dwExitCode)) does not help, if dwExitCode == STILL_ACTIVE the process could still be hung.
Thanks
|
|
|
|
|
enumerate the thread's windows (EnumThreadWindows) and try
sending message with a timeout (SendMessageTimeout) to see
if there is responsiveness.
|
|
|
|
|
Use this
DWORD dwResult;
BOOL bResponding = SendMessageTimeout(hwndInQuestion,
WM_NULL,
0,
0,
SMTO_ABORTIFHUNG,
5000,
&dwResult);
bResponding is TRUE if the process is responding and processing messages. This is precisely the way Task Manager works.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Wow, thanks, that´s what I call a speedy response, thanks again !
|
|
|
|
|
is it possible to let the user select text that was generated by drawtext in a rect??
if yes, how??
with kind regards
barry pappot
|
|
|
|
|
no. when text is rendered it is simply pixels on a DC - it's not a character any more.
you will have to do all of it by-hand : (where is the character? is the mouse moving over it? yes, draw the character reversed, etc.). like this - an edit control implemented from scratch.
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
Yes, but you have to do it manually. Nothing automatic exists in MFC or the Windows API that allows you to do it.
I wrote an article that and posted it here that almost does what I think you want to do, but you'll probably have to modify the code so that you get the desired visual effect.
Here's a link to that article.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Hi,
I have some problems with my apps memory usage. They use a lot of memory.
How can I make my app to use less memory?
Does it matter if I use semantic
{
CMyClass c;
:
}
or
{
CMyClass *c;
c = new CMyClass();
:
delete c;
}
Do Windows use some kind of garbage collection? Then my app has been running for a while the memory usage is lesser. Why?
Grateful for all help I can get.
/Ola Carlsson, Sweden
|
|
|
|
|
The amount of memory required by a CMyClass object is the same, regardless of whether it's used on the stack or the heap.
Garbage collection in VC++ is non-existant. If you use the heap, use it wisely. If I have a given object new'd/deleted many times, I will usually redesign the app so that the class is defined as a global variable and new'd in InitInstance, and deleted in the app destructor. Of course, this assumes that you don't need more than a single instance of the class object.
Each app's requirements are different.
Last item of note - I'm not sure if there's a limit on the size of the stack in a 32-bit program. In 16-bit days, it was 64k, so you had to be very careful of what data you put there.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
John Simmons / outlaw programmer wrote:
Last item of note - I'm not sure if there's a limit on the size of the stack in a 32-bit program.
There is no limit here, except when the virtual memory for stack bottom reaches something else (such as a heap). Then it will surely go down in flames.
It can AFAIK be changed by e.g. linker flags (changing the PE flags), but to my knowledge it has never been used in production applications.
|
|
|
|
|
Ola Carlsson wrote:
Does it matter if I use semantic
[...]
Yes. If you're using heap memory your app will have larger memory footprint.
There are a number of ways you can reduce the memory size of your executable, but they always boils down to: know what you're doing and what your compiler and runtime library is doing for you.
Do Windows use some kind of garbage collection?
Absolutely not. That's your responsibility.
Then my app has been running for a while the memory usage is lesser. Why?
There could be a number of reasons. One of them could be that you just looked at what was currently committed to RAM and not the total Working Set. When you minimize any app its working set is "trimmed" (SetProcessWorkingSetsize(-1, -1); IIRC).
|
|
|
|
|
I need to read the serial port, but I cannot read it.
I had configure the DCB structure with baud rate of 9600, NOPARITY, 1 Stop bit, and 8 bits of ByteSize.
I can write to the port, I'm using the function WriteFile, and it works fine.
But when I attempt to read the serial port, it fails.
The code is:
ReadFile(hDevComm, chInput, 10, &dwBytesRead, NULL)
and the return value is OK and dwBytesRead 0
thanks in advance!
|
|
|
|
|
There's a couple of articles here on CodeProject that explains that.
Take a look here: http://www.codeproject.com/system/
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi! This should be a easy task for most of you, and it sounds easy, but i can't find in my SDI with MFC aplication where to use WS_MAXIMIZE, but i'm not sure if this is the appropriate procedure because WS_MAXIMIZE is related to a window not an aplication, can you help me?
Thank you
|
|
|
|
|
|
Thank you Nishant S, but what i see now is that the Frame maximizes but it quickly returns to its normal (not maximized) state, i tracked the int nCmdShow argument and i noticed that its value keep being 3 until it reaches a CFrameWnd function :
void CFrameWnd::InitialUpdateFrame(CDocument* pDoc, BOOL bMakeVisible)
inside this function, nCmdShow, returns to its 'default' value 1, why does this happends?
Thanks
|
|
|
|
|
I created a new SDI app using VC++ 6 and added the code I had shown. And the app started maximized and without a flicker as well. If it returns to a normal state for you, you must have over ridden some other functions as well.
Do this :-
(1) Create a fresh SDI app
(2) Use the code I had shown in the first post
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Well, i did it, and it worked, i don't know why it doesn't in my application, what do you think is most probable to be happening? What else can i look for to find where am i iver ridden other functions, i keep on debbuging but i can't find the reasin for the Frame to come back to its 'normal' state!
Thank you
|
|
|
|
|
Well, i guess i found the reason, when i change windows i use:
pNewActiveView->Create(NULL, NULL, 0L, CFrameWnd::rectDefault, this, ViewID, &context);
pNewActiveView->OnInitialUpdate();
maybe its because of the CFrameWnd::rectDefault that it over rides that argument, what do you think? How can i change it to maximized, i look at its member function and variables but nothing seemed to fit with my intents!
Thanks
|
|
|
|
|
Well, it was not what i expected
I'll trying to find witch function i over ride, if there is someone who has a ideia i would appreciate very much an advise.
|
|
|
|
|
Hoorah, viva!!!
I found it!! I was making
m_pMainWnd->ShowWindow(TRUE);
instead of m_pMainWnd->ShowWindow(SW_SHOW);
in my C..app file
Thank you for your time
|
|
|
|
|
Is There any CListCtrl Class Support the Printing ..???
i wanna the Report view..Look like The Seagate Crystal Report.
Renjith-The CPian.
|
|
|
|
|
I don't think so, I think you need to draw the control into your CPrintDC.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
Renjith, see this article.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|