Re: Using COM. Please help.

2011-06-27 Thread Nub Public

On 6/27/2011 1:28 PM, Andrej Mitrovic wrote:

You mean COM interfaces? I usually do this:

interface SomeComInterface : IUnknown
{
 extern(Windows):
 BOOL PrototypeFoo();
}

But maybe this is already implicit when deriving from IUnknown, I wouldn't know.

But from what I can tell some of those prototypes seem to have C
linkage, maybe you're getting access violations due to wrong calling
conventions.



Thanks for the reply. But it still doesn't work.

interface ISomeComInterface : IUnknown
{
void funcWithManyParams(/*10 params*/);

extern(/*insert whatever linkage here*/)
void funcWrapperWithLessParams(/*3 params*/)
{
funcWithManyParams(/*fill in some default params*/);
}
//this func is inlined in the MS SDK header
}

DMD complains that the function body of funcWrapperWithLessParams isn't 
abstract.


Different NaNs used

2011-06-27 Thread bearophile
This question is related to this thread:
http://d.puremagic.com/issues/show_bug.cgi?id=3632

Can you tell me why real.nan and real.init don't contain the same bit patterns?


import std.math: isIdentical;
void main() {
assert(isIdentical(real.nan, real.init)); // this asserts
}

Bye and thank you,
bearophile