RickStrahl / wwDotnetBridge

.NET Interop for Visual FoxPro made easy
http://west-wind.com/wwDotnetBridge.aspx
73 stars 35 forks source link

VS 2015 Windows 10 - can not instantiate wwDotNetBridge from VFP #5

Closed NaomiN closed 7 years ago

NaomiN commented 7 years ago

I am getting - 1 for these lines of code

DECLARE Integer ClrCreateInstanceFrom IN WWC_CLR_HOSTDLL string, string, string@, integer@

    lcError = SPACE(2048)
    lnSize = 0
    lnDispHandle = ClrCreateInstanceFrom(FULLPATH("wwDotNetBridge.dll"),;
            "Westwind.WebConnection.wwDotNetBridge",@lcError,@lnSize)

    IF lnDispHandle < 1
       this.SetError( "Unable to load Clr Instance. " + LEFT(lcError,lnSize) )
       RETURN NULL 
    ENDIF

What can I do?

vicosx12 commented 7 years ago

wwDotNetBridge issue with .NET Framework 4.6.2 (Windows 10 Anniversary Update: 394802). Always return v.2.0.50727.8745.

*** Load dependencies DO wwDotnetBridge

** Create an instance loBridge = GetwwDotnetBridge("V4") ? loBridge.GetDotnetversion()

loBridge = CreateObject("wwDotNetBridge", "V4") ? loBridge.GetDotnetversion()

RickStrahl commented 7 years ago

Make sure you use the files from the distribution folder.

vicosx12 commented 7 years ago

My mistake. Loading eTecnologiaNetExtender in _STARTUP.

RickStrahl commented 7 years ago

Yeah if something else loads the .NET Runtime you can't change it subsequently. Only one runtime can run in a Process. wwDotnetBridge will attach to the existing instance.

vicosx12 commented 7 years ago

Thanks.