re: The extern "C" specifier disables C++ mangling, but that doesn't mean it...
There's a third way to expose a function without any mangling: 1. In .h file: extern "C" __declspec(dllexport) void foo(); 2. In .cpp/.c file: void foo(); // without __declspec(dllexport)! This way...
View Articlere: The extern "C" specifier disables C++ mangling, but that doesn't mean it...
@Aaron - the C language itself doesn't provide for this, but an implementation might. Microsoft C compilers disambiguate the calling convention to avoid catastrophic stack corruption on mismatch. Ref:...
View Articlere: The extern "C" specifier disables C++ mangling, but that doesn't mean it...
Why is this even an issue 2012? The docs should have been super clear on this for the last 20 years. [We thought the docs were clear on this, especially since nobody asked about it until 2011. -Raymond]
View Articlere: GUIDs are designed to be unique, not random
@Maurits: Not to toot my own horn, but see stackoverflow.com/.../expand-a-random-range-from-1-5-to-1-7 for some interesting solutions to that (several correct, many wrong) with different numbers.
View Articlere: GUIDs are designed to be unique, not random
Interesting indeed. I notice that: 5^1 mod 7 = 5 but is less than 7 so we can't use that 5^2 mod 7 = 4 so we have 4 "repeat" results 5^3 mod 7 = 6 so we have 6 "repeat" results 5^4 mod 7 = 2 so we have...
View Articlere: What happens if I call KillTimer with a NULL hwnd?
>That's exactly the information we were looking for. Thanks. This sounds worryingly like "So someone else's app crashes rather than ours. Thanks, we can safely ignore the problem".
View Articlere: What happens if I call KillTimer with a NULL hwnd?
Dave: It sounds to me like it will only crash their own app -- assuming that their app uses thread timers, which I'm guessing they actually don't.
View Articlere: What happens if I call KillTimer with a NULL hwnd?
Well, technically all the information they needed was in the MSDN pages for SetTimer and KillTimer. Must say though that I couldn't have thought up a more oblique way of stating it all. Also, the way...
View Articlere: If my window hosts multiple windowless ActiveX controls, which one do I...
The problem is, the documentation that exists for OLE sometimes uses the phrase "the windowless object with the keyboard focus" and sometimes refers to the "Active object" - without ever making it...
View Articlere: What happens if I call KillTimer with a NULL hwnd?
>>> So what's your proposal? while ( SetTimer( id ) != ERROR_SUCCESS ) ++id;? The point is, when you install a thread timer your code no longer controls which ID's are in use and which ones...
View Articlere: How do I prefetch data into my memory-mapped file?
Another option is to use PrefetchVirtualMemory: msdn.microsoft.com/.../Hh780543%28v=vs.85%29.aspx
View Articlere: How do I prefetch data into my memory-mapped file?
MM files as an IO surrogate are more hassle than they worth.
View Articlere: The time I watched a total lunar eclipse from the top of a mountain
Yo, dawg, I heard you like blocked views...
View Articlere: The time I watched a total lunar eclipse from the top of a mountain
Dont miss the transit of Venus on Tuesday. Might need to go to eastern washington to see the sun.
View Articlere: How do I prefetch data into my memory-mapped file?
Didn't it occur to you to preread the memory mapped region by dereferencing a pointer at 4k increments?
View Articlere: How do I prefetch data into my memory-mapped file?
@alegr1: I wouldn't call them a "surrogate". It's a way of doing I/O, plain and simple. It's when people think it's not that the problems begin. Memory-mapped files are particularly useful for sharing...
View Articlere: The time I watched a total lunar eclipse from the top of a mountain
I'm still waiting to see a total SOLAR eclipse.
View Articlere: How do I prefetch data into my memory-mapped file?
I like how some PM found this post in Raymond's queue a couple years ago, decided to do something about the problem, and created the API that "No" linked to!
View Articlere: How do I prefetch data into my memory-mapped file?
>Besides, memory-mapped I/O is way cooler. Until you don't have enough address space. Then you have to handle that (map part of the file, remap as necessary), and that becomes a mess.
View Articlere: How do I prefetch data into my memory-mapped file?
@Gabe It's not years, the "No" link is dated 5th of May, so it's maximum one year :)
View Article