CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11

Threaded View

  1. #6
    Join Date
    Aug 2004
    Posts
    184

    Re: RPC Example from MSDN

    I spent some time looking at this today and did not come up with a solution. I tried various MIDL commandline options - had some luck with /app_config Hello.Acf to get the interfaces set - this got rid of the _hello_ServerIfHandle related error - you will have to change the function name to what ever the compiler creates - i.e. _hello_my_p_handle.

    I was not able to get rid of the C1189 error, but I did a lot of looking at things........

    From the Win32 API:
    BOOL DeleteFile()
    If the function succeeds, the return value is nonzero.
    If the function fails, the return value is zero.
    So based on this I take that BOOL TRUE is non zero and BOOL FALSE is zero

    From MSDN:
    When a postfix or prefix ++ operator is applied to a variable of type bool, the variable is set to true. The postfix or prefix -- operator cannot be applied to a variable of this type.

    The bool type participates in integral promotions. An r-value of type bool can be converted to an r-value of type int, with false becoming zero and true becoming one. As a distinct type, bool participates in overload resolution.
    So based on this I take that bool true can be a non zero value and bool false can be zero. Even though you should probably not use an integer to check for bool true or false - it can be done.

    In RpcNdr.h
    Code:
    #if (0x500 <= _WIN32_WINNT)
    #define TARGET_IS_NT50_OR_LATER                   1
    #else
    #define TARGET_IS_NT50_OR_LATER                   0
    #endif
    On an XP and Win2k box, this fails with fatal error C1189: #error : You need a Windows 2000 or later to run this stub because it uses these features:

    If you change RpcNdr.h to match the BOOL or bool definition above.
    Code:
    #if (0x500 <= _WIN32_WINNT)
    #define TARGET_IS_NT50_OR_LATER                   0 // 1
    #else
    #define TARGET_IS_NT50_OR_LATER                   1 // 0
    #endif
    On the same XP and Win2k box, the C1189 error goes away.

    The check in the _c file is
    Code:
    #if !(TARGET_IS_NT50_OR_LATER)
    What am I missing?
    Last edited by f1shrman; August 27th, 2004 at 07:32 PM. Reason: forgot to explain what error went away

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured