Skip to content

Commit a527bf8

Browse files
author
Edward Brey
committed
Variable CLR host DLL path.
Allows the CLR host DLL path to be set at runtime.
1 parent c6a1b1c commit a527bf8

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Distribution/wwDotnetBridge.PRG

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ SET PROCEDURE TO wwDotnetBridge ADDITIVE
55
#DEFINE IS_WESTWIND .F.
66
#DEFINE IS_LEGACY .T.
77

8+
PUBLIC WWC_CLR_HOSTDLL
89
#IF IS_WESTWIND
9-
#DEFINE WWC_CLR_HOSTDLL wwipstuff.dll
10+
WWC_CLR_HOSTDLL="wwipstuff.dll"
1011

1112
*** Other dependencies
1213
* .NET Runtime 4.0+ or .NET Core 5+
@@ -16,7 +17,7 @@ SET PROCEDURE TO wwDotnetBridge ADDITIVE
1617
* wwDotnetBridge.dll
1718
* NewtonSoft.Json.dll - ToJson()/FromJson() only
1819
#ELSE
19-
#DEFINE WWC_CLR_HOSTDLL clrhost.dll
20+
WWC_CLR_HOSTDLL="clrhost.dll"
2021

2122
*** Other dependencies
2223
* .NET Runtime 4.0+ or .NET Core 5+
@@ -195,7 +196,7 @@ IF VARTYPE(this.oDotNetBridge) != "O"
195196
#ENDIF
196197

197198
*** Load by filename - assumes the wwDotNetBridge.dll is in the Fox path
198-
DECLARE Integer ClrCreateInstanceFrom IN WWC_CLR_HOSTDLL string, string, string@, integer@
199+
DECLARE Integer ClrCreateInstanceFrom IN (m.WWC_CLR_HOSTDLL) string, string, string@, integer@
199200
lcError = SPACE(2048)
200201
lnSize = 0
201202
lnDispHandle = ClrCreateInstanceFrom(FULLPATH("wwDotNetBridge.dll"),;
@@ -241,7 +242,7 @@ ENDFUNC
241242
*** Return: nothing
242243
************************************************************************
243244
PROTECTED FUNCTION SetClrVersion(lcVersion)
244-
DECLARE Integer SetClrVersion IN WWC_CLR_HOSTDLL AS SetClrVersionApi string
245+
DECLARE Integer SetClrVersion IN (m.WWC_CLR_HOSTDLL) AS SetClrVersionApi string
245246
SetClrVersionApi(lcVersion)
246247
ENDFUNC
247248
* SetClrVersion
@@ -259,7 +260,7 @@ ENDFUNC
259260
FUNCTION Unload()
260261
IF VARTYPE(this.oDotNetBridge) == "O"
261262
this.oDotNetBridge = NULL
262-
DECLARE Integer ClrUnload IN WWC_CLR_HOSTDLL
263+
DECLARE Integer ClrUnload IN (m.WWC_CLR_HOSTDLL)
263264
ClrUnload()
264265
ENDIF
265266
ENDFUNC
@@ -1433,7 +1434,7 @@ ENDFUNC
14331434
*!* FUNCTION CreateClrInstance(lcLibrary,lcClass,lcError)
14341435
*!* LOCAL lnDispHandle, lnSize
14351436
1436-
*!* DECLARE Integer ClrCreateInstance IN WWC_CLR_HOSTDLL string, string, string@, integer@
1437+
*!* DECLARE Integer ClrCreateInstance IN (m.WWC_CLR_HOSTDLL) string, string, string@, integer@
14371438
14381439
*!* lcError = SPACE(2048)
14391440
*!* lnSize = 0
@@ -2006,7 +2007,7 @@ IF VARTYPE(this.oDotNetBridge) != "O"
20062007
ENDIF
20072008
20082009
*** Load by filename - assumes the wwDotNetBridge.dll is in the Fox path
2009-
DECLARE Integer CoreClrCreateInstanceFrom IN WWC_CLR_HOSTDLL string, string, string@, integer@
2010+
DECLARE Integer CoreClrCreateInstanceFrom IN (m.WWC_CLR_HOSTDLL) string, string, string@, integer@
20102011
lcError = SPACE(2048)
20112012
lnSize = LEN(lcError)
20122013
lnDispHandle = CoreClrCreateInstanceFrom(lcRuntimePath,lcVersion,@lcError,@lnSize)
@@ -2054,7 +2055,7 @@ ENDFUNC
20542055
FUNCTION Unload()
20552056
IF VARTYPE(this.oDotNetBridge) == "O"
20562057
this.oDotNetBridge = NULL
2057-
DECLARE Integer CoreClrUnload IN WWC_CLR_HOSTDLL
2058+
DECLARE Integer CoreClrUnload IN (m.WWC_CLR_HOSTDLL)
20582059
CoreClrUnload()
20592060
ENDIF
20602061
ENDFUNC

0 commit comments

Comments
 (0)