FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour DllPreparecall
Posts: 129
Joined: Sun Oct 09, 2011 03:50 PM
DllPreparecall
Posted: Sun Nov 18, 2012 10:21 PM

Where can I get documentation ?

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: DllPreparecall
Posted: Mon Nov 19, 2012 11:42 AM

There are two ways to use a DLL:

  1. Static linking
  2. Dynamic linking

In order to use static linking you have to create an import library from the DLL. You can use libdef.exe or libimp.exe:
impdef.exe mydll.def mydll.dll
or
implib.exe mydll.lib mydll.dll

implib.exe will create the lib. impdef.exe will create a def file (ascii file) and then you can create the lib from it.

Then you create a C function that calls the DLL C function and link the import library.

HB_FUNC( THE_FUNCTION_TO_CALL )
{
TheCalledCfunction();
}

From your app:

The_Function_to_Call()

  1. Dynamic link:

There is no need to create an import library. The DLL is loaded at rutime and unloaded once it is used. FWH provides the following command to use the functions from the DLL:

DLL FUNCTION FuncionName( param AS TYPE ) AS RESULT_TYPE FROM FunctionName LIB DLLName

in example:

DLL FUNCTION Shell_NotifyIcon( nMsg AS LONG, pNID AS LPSTR ) AS BOOL PASCAL ;
FROM "Shell_NotifyIconA" LIB "shell32.dll"

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: DllPreparecall
Posted: Mon Nov 19, 2012 11:53 AM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 129
Joined: Sun Oct 09, 2011 03:50 PM
Re: DllPreparecall
Posted: Mon Nov 19, 2012 08:54 PM
DLL FUNCTION Shell_NotifyIcon( nMsg AS LONG, pNID AS LPSTR ) AS BOOL PASCAL ;
FROM "Shell_NotifyIconA" LIB "shell32.dll"


Thanks but It gives me error in straight HB3 w/o FW/ What is the Harbour syntax?
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: DllPreparecall
Posted: Mon Nov 19, 2012 09:19 PM

Thats a FWH command, are you using #include "FiveWin.ch" ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 129
Joined: Sun Oct 09, 2011 03:50 PM
Re: DllPreparecall
Posted: Mon Nov 19, 2012 09:30 PM
Antonio Linares wrote:Thats a FWH command, are you using #include "FiveWin.ch" ?


No I am trying to do it in HB3 w/o fw
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: DllPreparecall
Posted: Tue Jan 08, 2013 01:01 PM

Hi Antonio,

Is it possible to use dll that is created c# .net platform?

Thanks

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: DllPreparecall
Posted: Tue Dec 29, 2015 10:03 AM
mosh1 wrote:
DLL FUNCTION Shell_NotifyIcon( nMsg AS LONG, pNID AS LPSTR ) AS BOOL PASCAL ;
FROM "Shell_NotifyIconA" LIB "shell32.dll"


Hi Antonio,

Is this function alive?. I have tried like below. It did not worked.

Shell_NotifyIcon("testtesttest")
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: DllPreparecall
Posted: Tue Dec 29, 2015 10:11 AM
Hakan,

Windows API function Shell_NotifyIcon() expects different parameters:

https://msdn.microsoft.com/en-us/library/windows/desktop/bb762159%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

You can not call it providing it a string
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: DllPreparecall
Posted: Tue Dec 29, 2015 10:30 AM
Antonio Linares wrote:Hakan,

Windows API function Shell_NotifyIcon() expects different parameters:

https://msdn.microsoft.com/en-us/library/windows/desktop/bb762159%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

You can not call it providing it a string


Hi Antonio,

I just want to write a message in 5 seconds like msgwait() function at right corner of window desktop like w10.

Is there any function?
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: DllPreparecall
Posted: Tue Dec 29, 2015 10:32 AM

Why don't you use Msgwait() ?

You can change its source code to place it where you want

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: DllPreparecall
Posted: Tue Dec 29, 2015 10:40 AM
Antonio Linares wrote:Why don't you use Msgwait() ?

You can change its source code to place it where you want


in w10, the messages can be read in systray notify center. thats why.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: DllPreparecall
Posted: Tue Dec 29, 2015 11:22 AM

Do you want it just for Windows 10 ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: DllPreparecall
Posted: Tue Dec 29, 2015 01:05 PM
Antonio Linares wrote:Do you want it just for Windows 10 ?


Of course not. :-)
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: DllPreparecall
Posted: Tue Dec 29, 2015 07:16 PM

So better implement your own version that will work on all Windows versions :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion