converte from vb

converte from vb

Postby Silvio » Fri Jan 09, 2009 9:01 am

someone can converte these funs from vb please ?

Private Declare Function OpenThemeData Lib "uxtheme.dll" (ByVal hWnd As Long, ByVal pszClassList As Long) As Long

Private Declare Function CloseThemeData Lib "uxtheme.dll" (ByVal hTheme As Long) As Long

Private Declare Function DrawThemeBackground Lib "uxtheme.dll" (ByVal hTheme As Long, ByVal lHDC As Long, ByVal iPartId As Long, ByVal iStateId As Long, pRect As RECT, pClipRect As RECT) As Long

Private Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hDC As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long

thanks
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: converte from vb

Postby StefanHaupt » Sat Jan 10, 2009 4:42 pm

kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: converte from vb

Postby Otto » Sun Jan 11, 2009 8:14 am

Hello Stefan,

Thank you for this sample. I tried to compile this sample from César but get following error.

c:\fwhtests\806\tutor02.prg(27) Error E0021 Circularity detected in #translate: 'As'
c:\fwhtests\806\tutor02.prg(27) Error E0030 Syntax error: "syntax error at 'FUNCTION'"
c:\fwhtests\806\tutor02.prg(30) Warning W0007 Function 'MAIN' does not end with RETURN statement

Do you have a sample with a link file.
Thanks in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6064
Joined: Fri Oct 07, 2005 7:07 pm

Re: converte from vb

Postby StefanHaupt » Mon Jan 12, 2009 9:29 am

Otto,

my tests this morning produced the same errors you get. There must be something wrong in the translate commands.
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: converte from vb

Postby StefanHaupt » Tue Jan 13, 2009 12:39 pm

Otto,

you have to do the following changes to compile the saple without errors.

comment out these lines in vbdll.ch
Code: Select all  Expand view
#ifndef _VBDLL_CH_
#define _VBDLL_CH_

#xTranslate ByVal <x> => <x>
#xTranslate ByRef <x> => @<x>
//#xTranslate As Long => AS LONG
//#xTranslate As Integer => AS LONG
//#Translate As String => AS STRING
//#Translate As Boolean => AS BOOL
//#Translate As Any => AS LPSTR
//#Translate As Pointer => AS LPSTR
//#Translate As Void => AS VOID


change the vb function like this
Code: Select all  Expand view
// FWH entiende esta sintaxis / FWH understands this sintax

Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" ;
  (ByVal pCaller As LONG, ByVal szURL As STRING, ByVal szFileName As STRING, ;
   ByVal dwReserved As LONG, ByVal lpfnCB As LONG) As LONG


See the parameter types are upper case !

It compiles now, but I don´t know if it´s working correct, we need a test with real data
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: converte from vb

Postby StefanHaupt » Wed Jan 14, 2009 10:14 am

I made a last test with real data for cUrl and cSaveAs.

It is working fine :D
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: converte from vb

Postby César E. Lozada » Sat Jan 17, 2009 12:55 pm

Otto wrote:c:\fwhtests\806\tutor02.prg(27) Error E0021 Circularity detected in #translate: 'As'


Sorry!

This code compiles ok with xHarbour 0.99.7. Something has changed with the pre-processor that makes it fail with xH 1B.
User avatar
César E. Lozada
 
Posts: 128
Joined: Wed Oct 26, 2005 12:18 pm
Location: Los Teques, Miranda, Venezuela


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 39 guests