Funcion CallDll()

Funcion CallDll()

Postby Vikthor.Thomas » Fri Jun 13, 2014 7: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
User avatar
Vikthor.Thomas
 
Posts: 144
Joined: Thu Jan 02, 2014 1:49 pm

Re: Funcion CallDll()

Postby Antonio Linares » Sat Jun 14, 2014 8:24 am

Vikthor,

Puedes mostrar un ejemplo de como las estas usando ? gracias
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41329
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Funcion CallDll()

Postby Vikthor.Thomas » Mon Jun 16, 2014 3:16 pm

Quiero utilizar el control RMChart

Code: Select all  Expand view
// 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
                 )


//----------------------------------------------------------------------------//
User avatar
Vikthor.Thomas
 
Posts: 144
Joined: Thu Jan 02, 2014 1:49 pm

Re: Funcion CallDll()

Postby Antonio Linares » Mon Jun 16, 2014 4: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41329
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Funcion CallDll()

Postby Vikthor.Thomas » Tue Jun 17, 2014 2:03 pm

Antonio , el control es de 32bits.
User avatar
Vikthor.Thomas
 
Posts: 144
Joined: Thu Jan 02, 2014 1:49 pm

Re: Funcion CallDll()

Postby Antonio Linares » Tue Jun 17, 2014 4: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41329
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Funcion CallDll()

Postby Antonio Linares » Tue Jun 17, 2014 4: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41329
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Funcion CallDll()

Postby lucasdebeltran » Tue Jun 17, 2014 5: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.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: Funcion CallDll()

Postby Antonio Linares » Tue Jun 17, 2014 9:19 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41329
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Funcion CallDll()

Postby Antonio Linares » Tue Jun 17, 2014 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41329
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Funcion CallDll()

Postby Vikthor.Thomas » Wed Jun 18, 2014 1:32 pm

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

Saludos
User avatar
Vikthor.Thomas
 
Posts: 144
Joined: Thu Jan 02, 2014 1:49 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 9 guests