D1: Passing 0x00000000 value to a Windows COM function

torhu no at spam.invalid
Tue Aug 21 01:30:54 PDT 2012


On 20.08.2012 00:43, jicman wrote:
>
> Greetings.
>
> I am trying to pass a (I think) dchar value to a Windows COM
> function and it does not work.  Imagine this situation...
>
> dchar test()
> {
>    dchar val = 0x00000000;
>    return val
> }
>
> void main()
> {
>    ...lots of code excluded
>    SomeWindowsComCall(test); // this call does not work
>    SomeWindowsComCall(0x00000000); // this call works
> }
>
> Any idea how I can create a function to be able to return values
> such as 0x00000000 .. 0x0000FFFF?

Returning a dchar works just fine when I try it, there is probably a bug 
in your code.

What is the argument type of SomeWindowsComCall?  That's the type you 
should, and it's probably not a dchar.  Look at the MSDN docs for the 
function to see what type it wants.


More information about the Digitalmars-d-learn mailing list