DllPreparecall

DllPreparecall

Postby mosh1 » Sun Nov 18, 2012 10:21 pm

Where can I get documentation ?
mosh1
 
Posts: 129
Joined: Sun Oct 09, 2011 3:50 pm

Re: DllPreparecall

Postby Antonio Linares » 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()

2. 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: DllPreparecall

Postby Antonio Linares » Mon Nov 19, 2012 11:53 am

regards, saludos

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

Re: DllPreparecall

Postby mosh1 » Mon Nov 19, 2012 8: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?
Last edited by mosh1 on Mon Nov 19, 2012 9:28 pm, edited 1 time in total.
mosh1
 
Posts: 129
Joined: Sun Oct 09, 2011 3:50 pm

Re: DllPreparecall

Postby Antonio Linares » Mon Nov 19, 2012 9:19 pm

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

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

Re: DllPreparecall

Postby mosh1 » Mon Nov 19, 2012 9: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
mosh1
 
Posts: 129
Joined: Sun Oct 09, 2011 3:50 pm

Re: DllPreparecall

Postby Horizon » Tue Jan 08, 2013 1: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.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: DllPreparecall

Postby Horizon » 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.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: DllPreparecall

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

Re: DllPreparecall

Postby Horizon » 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.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: DllPreparecall

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

Re: DllPreparecall

Postby Horizon » 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.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: DllPreparecall

Postby Antonio Linares » Tue Dec 29, 2015 11:22 am

Do you want it just for Windows 10 ?
regards, saludos

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

Re: DllPreparecall

Postby Horizon » Tue Dec 29, 2015 1:05 pm

Antonio Linares wrote:Do you want it just for Windows 10 ?


Of course not. :oops:
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: DllPreparecall

Postby Antonio Linares » Tue Dec 29, 2015 7:16 pm

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

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 40 guests