From 0e085b70a10638aab4b7b1341da99b7698e1c131 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Mon, 17 Oct 2016 23:56:50 +0100 Subject: [PATCH] Fixing PAL_TRY use in BOTR (#7658) In the Exceptions Section it gives an example use of `PAL_TRY`, but the parameters to the `PAL_TRY` need to be passed as an argument, and cannot be implicit. This commit brings the change inline with the programming model. --- Documentation/botr/exceptions.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Documentation/botr/exceptions.md b/Documentation/botr/exceptions.md index daa684b..8e4b77a 100644 --- a/Documentation/botr/exceptions.md +++ b/Documentation/botr/exceptions.md @@ -278,10 +278,16 @@ To use the callout filter, instead of this: write this: BOOL OneShot = TRUE; - - PAL_TRY + struct Param { + BSTR* pBSTR; + int length; + }; + struct Param param; + param.pBSTR = pBSTR; + + PAL_TRY(Param*, pParam, ¶m) { - length = SysStringLen(pBSTR); + pParam->length = SysStringLen(pParam->pBSTR); } PAL_EXCEPT_FILTER(CallOutFilter, &OneShot) { -- 2.7.4