Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #12108 > unrolled thread

Calling wine_get_unix_file_name from KERNEL32.dll in VO

Started bywyleniauy@gmail.com
First post2018-11-06 08:39 -0800
Last post2018-11-06 16:54 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Calling wine_get_unix_file_name from KERNEL32.dll in VO wyleniauy@gmail.com - 2018-11-06 08:39 -0800
    Re: Calling wine_get_unix_file_name from KERNEL32.dll in VO Carlos Rocha <j.carlos.rocha.1.SpyedBy@gmail.com> - 2018-11-06 16:54 +0000

#12108 — Calling wine_get_unix_file_name from KERNEL32.dll in VO

Fromwyleniauy@gmail.com
Date2018-11-06 08:39 -0800
SubjectCalling wine_get_unix_file_name from KERNEL32.dll in VO
Message-ID<72ff126a-f583-4a34-9989-363c607ae755@googlegroups.com>
Howdy!

In case someone is also sick of Windows 10 in the year 2018 and prefer to roll your app on WINE... this can help you in ShellExecute()'ing Linux processes with file+pathname as parameters ;-)

I've reused some parts of:
https://groups.google.com/d/msg/comp.lang.clipper.visual-objects/rcKQG5-v0w4/vpPJJQaPArUJ

Best regards, w.

FUNCTION WineGetUnixFilename( cPath AS STRING, lSilent AS LOGIC ) AS STRING PASCAL
   STATIC hDLL AS PTR
   LOCAL hProc AS PTR
   LOCAL cDLLName AS STRING      
   LOCAL cRet := "" AS STRING     
   LOCAL pBuffS,pBuffT AS PTR
   LOCAL nSizeS,nSizeT AS INT  
   LOCAL lRet AS LOGIC

   IF hDLL == NULL_PTR
      cDLLName := "KERNEL32.DLL"
      hDLL := _VOLoadLibrary( cDLLName )
      IF hDLL == NULL_PTR    
      	IF !lSilent
            MessageBox( 0, String2Psz("error loading KERNEL32.DLL"), NULL_PSZ, 0 )
      	ENDIF 
         RETURN cRet
      ENDIF
   ENDIF

   hProc := GetProcAddress( hDLL, String2Psz( "wine_get_unix_file_name" ) )
   IF hProc == NULL_PTR   
   	IF !lSilent
         MessageBox( 0, String2Psz("error initializing wine_get_unix_file_name"), NULL_PSZ, 0 )
   	ENDIF
      RETURN cRet
   ENDIF       
   
   nSizeS := INT( _CAST, SLen( cPath ) )

   IF nSizeS > 0
      DynLock()

      pBuffS := StringAlloc( cPath )
      IF pBuffS != NULL_PTR
         nSizeT := MultiByteToWideChar( CP_ACP, 0, PSZ( _CAST, pBuffS ), nSizeS, NULL_PSZ, 0 )
         IF nSizeT > 0
            pBuffT := SysAllocStringLen( NULL_PTR, DWORD( _CAST, nSizeT ) )
            IF pBuffT != NULL_PTR
               nSizeT := MultiByteToWideChar( CP_ACP, 0, PSZ( _CAST, pBuffS ), nSizeS, PSZ( _CAST, pBuffT ), nSizeT )
               IF nSizeT > 0
                  lRet := TRUE
               ENDIF
               
            ENDIF
         ENDIF
         MemFree( pBuffS )
      ENDIF      
   ELSE     
   	RETURN cRet 
   ENDIF       
   
   IF !lRet    
   	RETURN cRet 	
   ENDIF     
   

   pBuffS := PCall( hProc, pBuffT )
   
   IF pBuffS != NULL_PTR
      cRet := Psz2String( pBuffS )
      HeapFree( GetProcessHeap(), 0, pBuffS )                      
   ENDIF                    
   
   SysFreeString( pBuffT ) 
   
   DynUnLock()
                 
   RETURN cRet

[toc] | [next] | [standalone]


#12109

FromCarlos Rocha <j.carlos.rocha.1.SpyedBy@gmail.com>
Date2018-11-06 16:54 +0000
Message-ID<prsh2n$v47$1@dont-email.me>
In reply to#12108
It's good to know that I'm not the only one following the WINE path.
I managed (yesterday) to install VO 2.8 sp4 in linux using PlayOnLinux 
and it seems to work fine, except for the "Save Desktop" option in the 
IDE. Needs further investigation.

Thanks for sharing this

-- 
*Carlos Rocha*

---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web