Not sure anyone is interested, but after a lot of research on line it appears 
that 64bit version of Powershell cannot call a 32bit dl and vice versa. This 
does not match the results I am getting with v17R3. 

In my previous post I left out that . 4D client is running on a 64bit Windows 
10 install, so in all my tests the system contained both a SysWow64 folder 
containing the 32bit version of PowerShell and a System32 folder containing the 
64bit version of PowerShell.

The following is more descriptive of my testing….

        4D               OSServer & Client      4DServer          4DClient      
     PowerShell      DLL         Result
        v17R3                64                               64                
   32                      32                32            OK
        v17R3.               64                               64                
   32                      64                32            OK.   //According to 
my research this should not work!

        V17R3               64                                64                
     64                      32                 32           OK
        V17R3               64                                64                
     64                      64                 32            X      
//According to my research this is the expected behavior



Why is the 32 bit 4D client working when it uses 64bit PowerShell?

Hard to find answers for this. There is no forum that has folks that are expert 
in 4D, PowerShell, and Quickbooks.I am going to post my question on Stack 
Exchange, Intuit SDK forum, and the Powershell forum and see what I get.

If you got this far, thanks for reading. If I get an answer I will post it here.

John

> On May 29, 2019, at 7:12 PM, JOHN BAUGHMAN <john...@hawaii.rr.com> wrote:
> 
> Anyone using PowerShell on Windows 10 out there? Maybe you can help me figure 
> this out.
> 
> I am upgrading an old v13 database to v17. My ultimate goal is to have 
> everything run-in 64bit.
> 
> The database talks to QuickBooks on a Windows 10 machine using an XML stream 
> in a Powershell script file executed with PowerShell by LEP.
> 
> I have successfully upgraded all of 4D to run successfully 64 bit, but have 
> am unable to get v17R3 or R4 64bit client to work successfully with 64bit 
> PowerShell…
> 
> 
> 4D                Server             Client              PowerShell           
>       Result
> v17R3            64                     32                      32            
>                 OK
> v17R3.           64                     32                      64            
>                 OK
> 
> V17R3            64                    64                       32            
>                 OK
> V17R3            64                    64                       64            
>                  X  
> 
> I am pretty sure that the PowerShell script is not being executed because 
> QuickBooks is not receiving a call. What changes with 64Bit 4d client that 
> could possibly be preventing the PowerShell Script from executing?  
> 
> I have posted the applicable code and ps script below.
> 
> Thanks,
> 
> John     
> 
> ----------------
> Here is what the LEP call looks like…
> 
> ScriptPath:=$1
> $4D_Folder:=Get 4D folder(Active 4D Folder)
> $FileID:=String(Milliseconds)+"-"+String(Random)
> 
> Case of
> :  (32bit). //pseudo code
>       
> $FilePath:="C:\\Windows\\sysWoW64\\WindowsPowerShell\\v1.0\\powershell.exe 
> -file \""+$ScriptPath+"\”"
> 
> :  (32bit)
>       
> $FilePath:="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe 
> -file \""+$ScriptPath+"\""
>       
> End Case
> 
> $OutputStream:=$3
> $ErrorStream:=$4
> $XMLOutBlobPtr:=$5
>  //set the environmentals and launch the external process
> SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE";"true")
> SET ENVIRONMENT VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"false")
> SET ENVIRONMENT VARIABLE("_4D_OPTION_CURRENT_DIRECTORY";$4D_Folder)
>  //SET ENVIRONMENT VARIABLE("_4D_OPTION_INPUT_STREAM";"I"+$FileID)
> SET ENVIRONMENT VARIABLE("_4D_OPTION_OUTPUT_STREAM";"O"+$FileID)
> SET ENVIRONMENT VARIABLE("_4D_OPTION_ERROR_STREAM";"E"+$FileID)
> SET ENVIRONMENT VARIABLE("_4D_OPTION_STOP_TOKEN";$FileID)
> LAUNCH EXTERNAL PROCESS($FilePath)
> —————————
> 
> ———————
> The PowerSrcipt script looks like this…
> 
> [String]$requestXML = '<?xml version="1.0" ?>
> <?qbxml version="2.0"?><QBXML>
> <QBXMLMsgsRq onError="stopOnError">
> <CompanyQueryRq requestID="1">
> </CompanyQueryRq>
> </QBXMLMsgsRq>
> </QBXML>'
> $myQBXMLRP = New-Object -com QBXMLRP2.RequestProcessor
> $myQBXMLRP.OpenConnection2("qb4D","CCFolioPro",1)
> $ticket = $myQBXMLRP.BeginSession("C:\Company Files\Cadinha & Co., 
> LLC.QBW",$myQBXMLRP.qbFileOpenDoNotCare)
> $myQBXMLRP.ProcessRequest($ticket, $requestXML) > 
> $env:_4D_OPTION_OUTPUT_STREAM
> $myQBXMLRP.EndSession($ticket)
> $myQBXMLRP.CloseConnection()
> "Stop" > $env:_4D_OPTION_STOP_TOKEN
> 
> -------------------
> 
> 
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.com
> 

**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to