Quantcast
Channel: The Old New Thing
Browsing all 24428 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

re: What does the COINIT_SPEED_OVER_MEMORY flag to CoInitializeEx do?

0) Code that runs correctly is better than code that runs fast - there's nothing more un-optimised than 'wrong' :-)

View Article


Image may be NSFW.
Clik here to view.

re: What does the COINIT_SPEED_OVER_MEMORY flag to CoInitializeEx do?

See also stackoverflow.com/.../80189 for a (now updated) answer to this question.

View Article


Image may be NSFW.
Clik here to view.

re: What does the COINIT_SPEED_OVER_MEMORY flag to CoInitializeEx do?

@JustSomeGuy: If you count that in, I think you've omitted a more important rule.-1) Code that never runs is fastest. - Stop inserting garbage in your code.Unintentional violation of this rule often...

View Article

Image may be NSFW.
Clik here to view.

re: What does the COINIT_SPEED_OVER_MEMORY flag to CoInitializeEx do?

So COINT_SPEED_OVER_MEMORY works exactly like the "Door Close" button in an elevator.

View Article

Image may be NSFW.
Clik here to view.

re: What does the COINIT_SPEED_OVER_MEMORY flag to CoInitializeEx do?

The MSDN page must have been updated, because currently it documents COINIT_SPEED_OVER_MEMORY as follows: "Increase memory usage in an attempt to increase performance."

View Article


Image may be NSFW.
Clik here to view.

re: Thread affinity of user interface objects: Addendum

"(Printer driver developers have a habit of calling CoInitialize in their implementation of CreateDC and CoUninitialize in their implementation of DeleteDC.)"Which had amusing consequences in an MFC...

View Article

Image may be NSFW.
Clik here to view.

re: What does the COINIT_SPEED_OVER_MEMORY flag to CoInitializeEx do?

@caf: I've actually been in a few elevators where the "Door Close" button actually makes the doors close. Sure, in most, the button does nothing. But in these few, the button reduces the...

View Article

Image may be NSFW.
Clik here to view.

re: Thread affinity of user interface objects: Addendum

@John Elliott: Man that gun was pointed at the foot for a long time. Maybe MFC should be relegated to the trash heap. Oh wait, that's already been done.

View Article


Image may be NSFW.
Clik here to view.

re: Thread affinity of user interface objects: Addendum

I call that the win32 call/anti-call rule.  Unless explicitly called out in the docs treat it as if it can only be used on 1 thread...  Your code will thank you for it.  The subtle crashes by messing...

View Article


Image may be NSFW.
Clik here to view.

re: What does the COINIT_SPEED_OVER_MEMORY flag to CoInitializeEx do?

As far as I can tell, one possible use for this flag could be to keep factories referenced/locked between COM calls, possibly releasing after some time without usage (and at the next COM call). This...

View Article

Image may be NSFW.
Clik here to view.

re: If you're asking somebody to help you, you want to make it easy for them,...

In c:\Program Files (x86)\Microsoft Visual Studio 10.0\vc\atlmfc\include\afxwinforms.inl, we had to changeextern "C" void   AfxmEnsureManagedInitialization();toextern "C" void  __cdecl...

View Article

Image may be NSFW.
Clik here to view.

re: Thread affinity of user interface objects: Addendum

"Printer driver developers have a habit of calling CoInitialize in their implementation of CreateDC" --- hmm, does that imply that it is not safe to print from a thread that already belongs to the...

View Article

Image may be NSFW.
Clik here to view.

re: Thread affinity of user interface objects: Addendum

Henning,Bingo! I'd already tried to post a comment regarding HP's cruddy drivers but my comment disappeared. (Mmm...does this blog not like Firefox?) Anyways, post-printing, some HP drivers stupidly...

View Article


Image may be NSFW.
Clik here to view.

re: Thread affinity of user interface objects: Addendum

Microsoft will never get rid of the bad reputation from programmers until they build a stack of replacement to current COM interfaces that don't load foreign forth-party DLLs into third-party processes...

View Article

Image may be NSFW.
Clik here to view.

re: Thread affinity of user interface objects: Addendum

I've always wondered who to blame when an application only crashes when printing to one particular driver. (In my case I think I worked around it by launching the application from WinDbg -G -g with a...

View Article


Image may be NSFW.
Clik here to view.

re: Thread affinity of user interface objects: Addendum

@Erik: I'll admit that I had to read "To close the COM library gracefully, each successful call to CoInitialize or CoInitializeEx, including those that return S_FALSE, must be balanced by a...

View Article

Image may be NSFW.
Clik here to view.

re: Thread affinity of user interface objects: Addendum

(I'll copy and paste this into the next suggestion box, but I copy it here in case you're tempted to answer it.)In Windows 7 I can't pin the "Microsoft Help Viewer" that comes with Visual Studio 2012...

View Article


Image may be NSFW.
Clik here to view.

re: Thread affinity of user interface objects: Addendum

Erik Knowles: Fortunately, most GUI threads are STA.

View Article

Image may be NSFW.
Clik here to view.

re: If you're asking somebody to help you, you want to make it easy for them,...

I wonder, did the liason refer to Raymond's response, or to their own original question?More often than not, e-mails chain the replies. Usually it's OK to drop this duplicate text when quoting; but...

View Article

Image may be NSFW.
Clik here to view.

re: What does the COINIT_SPEED_OVER_MEMORY flag to CoInitializeEx do?

@pinwing... if that quote is accurate then it is hilariously inaccurate documentation.  If it were accurate then simply adding a few arbitrary calls to AllocMem() would improve the performance of my...

View Article
Browsing all 24428 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>