|
First thanks for your reply again.
The value of the pPrinterName is " HP LaserJet 1022 " And I can get the member Attributes correctly. So It puzzles me if the printer don't support the member Status?
-- modified at 20:39 Thursday 20th April, 2006
|
|
|
|
|
bluelzdwy wrote: ...if the printer don't support the member Status?
To verify this a bit further, try turning the printer off or removing the paper and see if the status is still 0. Do you have another printer that you can test with?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
how to use TRACE function in console win app, if we include afxwin.h for this function then comes a lot of unresolved
app error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in libcpd.lib(newop.obj)
app error LNK2005: "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) already defined in libcpd.lib(newaop.obj)
app error LNK2019: unresolved external symbol __beginthreadex referenced in function "public: int __thiscall CWinThread::CreateThread(unsigned long,unsigned int,struct _SECURITY_ATTRIBUTES *)" (?CreateThread@CWinThread@@QAEHKIPAU_SECURITY_ATTRIBUTES@@@Z)
app error LNK2019: unresolved external symbol __endthreadex referenced in function "void __stdcall AfxEndThread(unsigned int,int)" (?AfxEndThread@@YGXIH@Z)
9ine
|
|
|
|
|
TRACE is a MFC macros.
Check radio button "An application that supports MFC" on step 1 of 1 while creating console application.
|
|
|
|
|
Can we do it after app was created? it is nasty to recreate existing one completely.
if there are also similar TRACE like in STD or win libs?
9ine
|
|
|
|
|
see your project settings
in the C/C++ section, there might be some "MFC support" to enable
|
|
|
|
|
use api
OutputDebugString. You need to include windows.h for this.
|
|
|
|
|
yes it works, and in proj settings there is additional MFC libs usage combo box
9ine
|
|
|
|
|
We have an application developed in Windows 2000. When we run the same application on Windows XP with exactly same environment, there is a drastic increase in CPU Usage. Say if it was 15% on Windows 2000, now its 50% on Windows XP.
Application has few components communicating through DCOM and few Win32 Dlls. Any hint how can i trace which portion of code is taking too much CPU on Windows XP. Any easy to get profiling tool? any other way?
Any help would be really appreciated.
Regards
Muhammad Shoaib Khan
http://geocities.com/lansolution
|
|
|
|
|
M.Shoaib Khan wrote: Any easy to get profiling tool? any other way?
Try profiler come with Visual Studio!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I do not find the settings which shows the whole String / CString. Using my VS I only see the first char of the String. Which setting do I have to change?
|
|
|
|
|
Tools -> Options -> Debug and check 'Display Unicode strings'
|
|
|
|
|
I need some artical or feedback on text with moving cursor. probably this is an irritating repetitive post for many experienced gurus here.
Text string will be retreived from dialog edit box and seen moving with the cursor in the view. As I click the left button, text should stop moving and should placed at the point. I assume ROP functions wont help here. TextOut will show the array of texts in the view. Should I keep on updating the views
as the user moves the cursor in the OnMouseMove handler to avoid that. I also
read somewhere to capture the bitmap of the text and erase it.. something liek that. I need to hav serialise support in this application. I have achived rubberband effect with lines but text seems to be hard.
Kindly help me.
Leya
Leya
|
|
|
|
|
You can try this:
CDC::IntersectClipRect(CurrentTextRect);
And in your OnPaint()...try not drawing the background when mouse is moving. while mouse is moving, only the updated rect should be drawn.
I am not sure of this approach. You might have to investigate.
Hope this hint helps.
|
|
|
|
|
I have a problem with asserts. We are implementing graphics code (OpenGL) on MFC. We finished, zipped, and emailed our assignment a month ago when it was working fine. Now, we unzip our code because we need to modify it for a new project and it gives an assertion failure at the line:
ASSERT(::IsWindow(m_hWnd));
We read the article "Assert is your friend" but upon tracing the stack, it never lead back to our code.
Can anyone help?
MIRA
|
|
|
|
|
mira666 wrote: ASSERT(::IsWindow(m_hWnd));
This kind or error checking is usually found together with code that either sends/posts messages or receives them. Since you haven't provided any info about what function this line can be found in it's impossible to tell what the problem is.
Generally an assertion of this kind indicates an error, such as a message is about to be sent but the message loop is terminated, or about to be terminated, so the message may never be handled.
I'm just guessing but maybe you are posting a message from your code that is handled in another window that is closing.
Hope this helps
--
Roger
It's suppose to be hard, otherwise anybody could do it!
|
|
|
|
|
Thanks for your help. It turns out Visual Studio is not properly installed 'cause I tried on a different PC and it worked just fine.
MIRA
|
|
|
|
|
Seems like a strange way to find out that VS is not properly installed and if you base your assumption on "since it works on another machine it's got to be the VS installation" you have missed a lot of more possible errors, e.g.:
1. It could be that you have executed the 'Release'-built code without errors and since the ASSERT macro doesn't do anything in 'Release'-built software you may have made the wrong assumption.
2. Since you first wrote that your code was never on the call stack when the execution was stopped due to the assertion, I suspect that it's multithreaded at least or you have an even bigger problem.
If the software is multithreaded it's possible that it could be a timing issue and the timing was "right" when you executed the software on the machine where it worked.
BUT, it could be the VS installation even if it's unlikely.
--
Roger
It's suppose to be hard, otherwise anybody could do it!
|
|
|
|
|
The reason I think this is because we tried someone else's progam, and he's supposed to be good at it, on the same machine and it crashed. So the sys ad is going to work on fixing it.
MIRA
|
|
|
|
|
It's difficult to help unless you give us more informations. You have to use the debugger to see what instruction in your program causes the crash.
|
|
|
|
|
how to put thru cntr+B conditional breakpoint if some variable becomes equal to some value etc. It does not want to make a nice red circle to appear
9ine
|
|
|
|
|
set your breakpoint, right click on it, and choose Conditional breeakpoint in the contextmenu...
|
|
|
|
|
Hi,
In my class wizard WM_NC**** messages are not available for CMainFrame class. So can not add the handlers for the same from the classwizard.
how to make them available.
Thanks
Leya
|
|
|
|
|
|