Window API

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Window API

Nguyen Xuan Son
Hi all,
As you know, from 0.3.7 QuantLib uses Boost. The library defines

#define Handle boost::shared_ptr

But because I intende to use WINAPI , this definition results in a conflict

c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\WinUser.h(3282): error C2751:
'boost::shared_ptr' : the name of a function parameter cannot be qualified

because Handle appears in definitions in WINAPI


RPCNSAPI
RPC_STATUS
RPC_ENTRY
I_RpcNsSendReceive(
    IN PRPC_MESSAGE Message,
    OUT RPC_BINDING_HANDLE __RPC_FAR * Handle
    );

What should I do.

JK

PS: it comes from my effort to CLEAR SCREEN in console mode, but it might
happen one day I incorporate the program in a user friendly interface, which
obviously will use Microsoft foundation.





Reply | Threaded
Open this post in threaded view
|

Re: Window API

Nicolas Di Césaré
Le sam 31/07/2004 à 19:13, Nguyen Xuan Son a écrit :

> Hi all,
> As you know, from 0.3.7 QuantLib uses Boost. The library defines
>
> #define Handle boost::shared_ptr
>
> But because I intende to use WINAPI , this definition results in a conflict
>
> c:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\PlatformSDK\Include\WinUser.h(3282): error C2751:
> 'boost::shared_ptr' : the name of a function parameter cannot be qualified
>

Hi,

You probably have done a "using namespace QuantLib" or "using
QuantLib::Handle" before including WINAPI headers.

Nicolas  


--
Nicolas Di Césaré <[hidden email]>



Reply | Threaded
Open this post in threaded view
|

Re: Window API

Luigi Ballabio-2
In reply to this post by Nguyen Xuan Son
On 2004.07.31 19:13, Nguyen Xuan Son wrote:
> Hi all,
> As you know, from 0.3.7 QuantLib uses Boost. The library defines
>
> #define Handle boost::shared_ptr
>
> But because I intende to use WINAPI , this definition results in a
> conflict

Hi,
        the #define is there only in order to keep the name "Handle"  
around (for backward-compatibility reasons. People might have written  
code based on it and it shouldn't cease to compile all of a sudden. It  
will disappear in next version.)

If your code uses shared_ptr already, just remove the #define. If it  
doesn't, replace "Handle" with "shared_ptr" in your code (which you  
will have to do before next release anyway) and then remove the  
#define.

Hope this helps,
                Luigi