# ShellExecute in Multi DLL APP not Compiling

**URL:** <https://clarionhub.com/t/shellexecute-in-multi-dll-app-not-compiling/6569>\
**Category:** questions\
**Tags:** dll, winapi\
**Created:** [September 5, 2023, 9:49am UTC](https://clarionhub.com/t/shellexecute-in-multi-dll-app-not-compiling/6569 "2023-09-05T09:49:24Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [September 5, 2023, 4:33pm UTC](https://clarionhub.com/t/shellexecute-in-multi-dll-app-not-compiling/6569/3 "2023-09-05T16:33:32Z")

</div>

> [@rob\_bac](#):
>
> ```auto
> Shellex:AssocFile='tel:'&CLIP(AGD:TEL)
> Shellex:Param =''
> Shellex:Directory=''
> Shellex:Operation='open'
> ShellExecute(GetDesktopWindow(),Shellex:Operation,Shellex:AssocFile,Shellex:Param,Shellex:Directory,3)
> 
> ```

As Bruce said the `Shellex:Xxxx CSTRING()` variables need to be defined some place in scope in the APP. Likely you made them Global. Find them where they work in the other APPs.

IMO there is no need to pass`GetDesktopWindow()` for Window Handle, you can pass a Zero. Another improvement would be to place the 4+ ShellEx: variables inside a GROUP so you can CLEAR(Shellex:Group) to clear them All and not miss one.

* * *

Since you are including CWUtil you can call it’s Shell Execute wrapper function OpenUrlLink() which I pasted below so you can see how it works and the parameters. I think you could call as `OpenUrlLink('tel:'&CLIP(AGD:TEL), False)`. This will not pass Show as 3 to Maximize so a bit different but fine IMO.

Rather than define your ShellEx CSTRING variables and call the API Shell Execute what I usually do is create a wrapper function of my own, like below, so I can pass STRINGs and deal with the CSTRINGs in that one procedure.

```auto
OpenUrlLink PROCEDURE(STRING urlLink,BYTE forceHttp=1,<STRING path>, <STRING params>)
lWHandle LONG
lOperation CSTRING(255)
lFileUrl CSTRING(255)
lPath CSTRING(255)
lParam CSTRING(255)
lShowCmd LONG(1)
lRetVal ULONG
 CODE
    IF LEFT(UPPER(urlLink),4)<>'HTTP' AND forceHttp
       lFileUrl = 'http://'&clip(urlLink)
    ELSE
       lFileUrl = clip(urlLink)
    END
    lWHandle = 0{PROP:Handle}!Get the handle of the current window
    lOperation = 'Open'    
    lPath = path
    lParam = params
    lShowCmd = 1
    lRetVal = SV_ShellExecuteURL(lWHandle,lOperation,lFileUrl,lParam,lPath,lShowCmd)
    
    RETURN lRetVal

```

---

_[View the full topic](https://clarionhub.com/t/shellexecute-in-multi-dll-app-not-compiling/6569)._
