Skip to content

Commit 8fe1955

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

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
@@ -1402,7 +1403,7 @@ ENDFUNC
14021403
*!* FUNCTION CreateClrInstance(lcLibrary,lcClass,lcError)
14031404
*!* LOCAL lnDispHandle, lnSize
14041405
1405-
*!* DECLARE Integer ClrCreateInstance IN WWC_CLR_HOSTDLL string, string, string@, integer@
1406+
*!* DECLARE Integer ClrCreateInstance IN (m.WWC_CLR_HOSTDLL) string, string, string@, integer@
14061407
14071408
*!* lcError = SPACE(2048)
14081409
*!* lnSize = 0
@@ -1975,7 +1976,7 @@ IF VARTYPE(this.oDotNetBridge) != "O"
19751976
ENDIF
19761977
19771978
*** Load by filename - assumes the wwDotNetBridge.dll is in the Fox path
1978-
DECLARE Integer CoreClrCreateInstanceFrom IN WWC_CLR_HOSTDLL string, string, string@, integer@
1979+
DECLARE Integer CoreClrCreateInstanceFrom IN (m.WWC_CLR_HOSTDLL) string, string, string@, integer@
19791980
lcError = SPACE(2048)
19801981
lnSize = LEN(lcError)
19811982
lnDispHandle = CoreClrCreateInstanceFrom(lcRuntimePath,lcVersion,@lcError,@lnSize)
@@ -2023,7 +2024,7 @@ ENDFUNC
20232024
FUNCTION Unload()
20242025
IF VARTYPE(this.oDotNetBridge) == "O"
20252026
this.oDotNetBridge = NULL
2026-
DECLARE Integer CoreClrUnload IN WWC_CLR_HOSTDLL
2027+
DECLARE Integer CoreClrUnload IN (m.WWC_CLR_HOSTDLL)
20272028
CoreClrUnload()
20282029
ENDIF
20292030
ENDFUNC

0 commit comments

Comments
 (0)