FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Funcion CallDll()
Posts: 144
Joined: Thu Jan 02, 2014 01:49 PM
Funcion CallDll()
Posted: Fri Jun 13, 2014 07:38 PM

Al compilar con FWH64 y VS2013 , obtengo un error con la funci贸n CallDll() y
y tambi茅n con FwCallDll()

Alguna sugerencia ?

Saludos

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Funcion CallDll()
Posted: Sat Jun 14, 2014 08:24 AM

Vikthor,

Puedes mostrar un ejemplo de como las estas usando ? gracias

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 144
Joined: Thu Jan 02, 2014 01:49 PM
Re: Funcion CallDll()
Posted: Mon Jun 16, 2014 03:16 PM
Quiero utilizar el control RMChart

Code (fw): Select all Collapse
// Copyright FiveTech 1993-08 聽- 2nd version with no data types passed in

// modified by Roger Seiler with FiveTech authorization; this does not require
// any part of FWH and can operate solely with xHarbour.

// DLLxHb.ch - enables using same syntax with xHb's DLLCALL as with FWH's DLL32

#ifndef _DLLxHb_CH
#define _DLLxHb_CH

#define DC_CALL_STD 聽 聽 聽 聽 聽 0 // 0x0020

#translate NOREF([@]<x>) => <x>
//----------------------------------------------------------------------------//

#xcommand DLLxHb FUNCTION <FuncName>( [ <uParam1> ] [, <uParamN> 聽] ) ;
聽 聽 聽 聽 聽 聽 聽LIB <*DllName*> ;
聽 聽 聽 聽=> ;
聽 聽 聽 聽 聽 聽function <FuncName>( [NOREF(<uParam1>)] [,NOREF(<uParamN>)] ) ;;
聽 聽 聽 聽 聽 聽 聽local hDLL := If( ValType( <DllName> ) == "N", <DllName>, LoadLibrary( <(DllName)> ) ) ;;
聽 聽 聽 聽 聽 聽 聽local uResult := 0 ;;
聽 聽 聽 聽 聽 聽 聽if Abs( hDLL ) > 32 ;;
聽 聽 聽 聽 聽 聽 聽 聽 uResult = CallDll( hDLL, DC_CALL_STD, <(FuncName)> [,<uParam1>] [,<uParamN>] ) ;;
聽 聽 聽 聽 聽 聽 聽 聽 If( ValType( <DllName> ) == "N",, FreeLibrary( hDLL ) ) ;;
聽 聽 聽 聽 聽 聽 聽else ;;
聽 聽 聽 聽 聽 聽 聽end ;;
聽 聽 聽 聽 聽 return uResult

// This previous "else" code gpf's, even with FWH...
// 聽 聽 聽 聽 聽 聽 聽 聽If( ValType( <DllName> ) == "C", <DllName>, Str( <DllName> ) ) ) ;;
// 聽 聽 聽 聽 聽 聽 聽 聽MsgAlert( "Error code: " + LTrim( Str( hDLL ) ) + " loading " + ;

DLLxHb FUNCTION RMC_CREATECHART( ; 聽 聽 聽 聽 聽 // RMC_CreateChart
聽 聽 聽 聽 聽 聽 聽 聽 聽nParentHndl, ; 聽 聽 // hWnd
聽 聽 聽 聽 聽 聽 聽 聽 聽nCtrlId, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽nX, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽nY, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽nWidth, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽nHeight, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽nBackColor, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽nCtrlStyle, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽nExportOnly, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽sBgImage, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽sFontName, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽nToolTipWidth, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽nBitmapBKColor ;
聽 聽 聽 聽 聽 聽 聽 聽 聽) 聽LIB hRmcDll 


聽 聽nRetVal = RMC_CreateChart( ;
聽 聽 聽 聽 聽 聽 聽 聽 聽oWnd:hWnd 聽 聽 聽 聽 聽 , ; 聽// nParentHandle
聽 聽 聽 聽 聽 聽 聽 聽 聽ID_RMC1 聽 聽 聽 聽 聽 聽 , ; 聽// nCtrlID
聽 聽 聽 聽 聽 聽 聽 聽 聽0 聽 聽 聽 聽 聽 聽 聽 聽 聽 , ; 聽// nTop
聽 聽 聽 聽 聽 聽 聽 聽 聽0 聽 聽 聽 聽 聽 聽 聽 聽 聽 , ; 聽// nLeft
聽 聽 聽 聽 聽 聽 聽 聽 聽600 聽 聽 聽 聽 聽 聽 聽 聽 , ; 聽// nWidth
聽 聽 聽 聽 聽 聽 聽 聽 聽450 聽 聽 聽 聽 聽 聽 聽 聽 , ; 聽// nHeight
聽 聽 聽 聽 聽 聽 聽 聽 聽ColorAzure 聽 聽 聽 聽 聽, ; 聽// nBackColor
聽 聽 聽 聽 聽 聽 聽 聽 聽RMC_CTRLSTYLEFLAT 聽 , ; 聽// nCtrlStyle
聽 聽 聽 聽 聽 聽 聽 聽 聽False 聽 聽 聽 聽 聽 聽 聽 , ; 聽// nExportOnly
聽 聽 聽 聽 聽 聽 聽 聽 聽"" 聽 聽 聽 聽 聽 聽 聽 聽 聽, ; 聽// sBgImage
聽 聽 聽 聽 聽 聽 聽 聽 聽"" 聽 聽 聽 聽 聽 聽 聽 聽 聽, ; 聽// sFontName
聽 聽 聽 聽 聽 聽 聽 聽 聽20 聽 聽 聽 聽 聽 聽 聽 聽 聽, ; 聽// nToolTipwidth
聽 聽 聽 聽 聽 聽 聽 聽 聽0 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ; 聽// nBitmapBKColor
聽 聽 聽 聽 聽 聽 聽 聽 聽)


//----------------------------------------------------------------------------//
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Funcion CallDll()
Posted: Mon Jun 16, 2014 04:36 PM

Vikthor,

El control RMChart que intentas usar, es version 64 bits ? Porque si no, no funcionar谩

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 144
Joined: Thu Jan 02, 2014 01:49 PM
Re: Funcion CallDll()
Posted: Tue Jun 17, 2014 02:03 PM

Antonio , el control es de 32bits.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Funcion CallDll()
Posted: Tue Jun 17, 2014 04:13 PM

Pues por lo que s茅, no hay forma de acceder a una DLL de 32 bits desde una aplicaci贸n de 64 bits.

Salvo que exista alg煤n truco por google :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Funcion CallDll()
Posted: Tue Jun 17, 2014 04:19 PM

Has probado a buscar acceder a un control OLE de 32 bits desde una aplicaci贸n de 64 bits ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: Funcion CallDll()
Posted: Tue Jun 17, 2014 05:59 PM

Vikthor,

Como bien dice Antonio, no es posible usar una dll de 32 bits en 64 bits. Tienes que conseguir la versi贸n de 64 bits.

Otra cosa es que desde 64 bits llames a un exe de 32 bits, y este 煤ltimo llame a la Dll.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Funcion CallDll()
Posted: Tue Jun 17, 2014 09:19 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Funcion CallDll()
Posted: Tue Jun 17, 2014 09:20 PM
A 64-bit process can access a 32-bit DLL across a process boundary if the 32-bit DLL is loaded into a separate 32-bit surrogate process space, and the application makes use of the built-in IPC mechanisms that support data exchange between 32-bit and 64-bit processes.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 144
Joined: Thu Jan 02, 2014 01:49 PM
Re: Funcion CallDll()
Posted: Wed Jun 18, 2014 01:32 PM

Gracias a todos por la informaci贸n.
Decid铆 usar el control ChartFx en lugar de RmChart

Saludos

Continue the discussion