FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour DLL de terceros y definici贸n de funciones.
Posts: 1445
Joined: Mon Oct 10, 2005 02:38 PM
DLL de terceros y definici贸n de funciones.
Posted: Tue Dec 09, 2008 07:29 PM

Hola a todos,

A ver si me pueden ayudar un poco.

Estoy intentando definir como usar茅 una utilidad en una aplicaci贸n, y 茅sta viene en una DLL.

Seg煤n la documentaci贸n la definici贸n de una funci贸n concreta seria:


HWND TerCreateWindowAlt(x, y, width, height, IsContained, hParentWnd, styles)

int x; // x position of the window in pixel units
int y; // y position of the window in the pixel units
int width; // width of the window in the pixel units
int height; // height of the window in the pixel units
BOOL IsContained; // TRUE if this window is to be contained inside another window
HWND hParentWnd; // handle of the parent window.
DWORD styles; // TER window styles. Please refer to the TER_xxx constants defined in the 'Getting Started' chapter. Set to 0 to use the default styles.

Description: This is a quick method of creating a TER window. For a more elaborate method of creating a TER window, please refer to the CreateTerWindow function.

Return Value: This function returns the window handle of the new window. It returns NULL if the window creation fails.


y yo la intento 'definir' as铆:

DLL32 FUNCTION TerCreateWindowAlt( x AS LONG, ;
y AS LONG, ;
width AS LONG, ;
height AS LONG, ;
IsContained AS _INT, ;
hParentWnd AS LONG, ;
styles AS LONG ) ;
AS LONG PASCAL FROM "TerCreateWindowAlt" LIB "ter16.dll"

驴Ser铆a correcto?
驴Cuando ejecuto la aplicaci贸n debo realizar en su inicio Loadlibrary()?

Saludos y gracias
Carlos G.

Un Saludo

Carlos G.



FiveWin 25.12 + Harbour 3.2.0dev (r2502110321), BCC 7.7 Windows 11 Home

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
DLL de terceros y definici贸n de funciones.
Posted: Tue Dec 09, 2008 09:28 PM

Carlos,

> IsContained AS _INT, ;

Preferible definelo como LONG tambien

> LIB "ter16.dll"

El que se llame 16 es solo casualidad, o sera una DLL de 16 bits ? Una DLL de 16 bits no la puedes usar desde una aplicacion en 32 bits.

> 驴Ser铆a correcto?

Si :-)

> 驴Cuando ejecuto la aplicaci贸n debo realizar en su inicio Loadlibrary()?

No, no es necesario. DLL FUNCTION ... lo hace automaticamente. Solo hay que llamar a LoadLibrary() previamente cuando necesitemos mantener cargada (abierta) la DLL.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1445
Joined: Mon Oct 10, 2005 02:38 PM
DLL de terceros y definici贸n de funciones.
Posted: Tue Dec 09, 2008 11:58 PM
Antonio Linares wrote:Carlos,

> IsContained AS _INT, ;

Preferible definelo como LONG tambien

> LIB "ter16.dll"

El que se llame 16 es solo casualidad, o sera una DLL de 16 bits ? Una DLL de 16 bits no la puedes usar desde una aplicacion en 32 bits.

> 驴Ser铆a correcto?

Si :-)

> 驴Cuando ejecuto la aplicaci贸n debo realizar en su inicio Loadlibrary()?

No, no es necesario. DLL FUNCTION ... lo hace automaticamente. Solo hay que llamar a LoadLibrary() previamente cuando necesitemos mantener cargada (abierta) la DLL.


Gracias Antonio,

Ter16.dll ==>> el 16 es la versi贸n; coindicencias.

Ha funcionado; estoy maravillado. No habia experimentado antes en esto (DLL de terceros me refiero).

Saludos
Carlos G.

Un Saludo

Carlos G.



FiveWin 25.12 + Harbour 3.2.0dev (r2502110321), BCC 7.7 Windows 11 Home

Continue the discussion