how to convert C++ header to fpc

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to convert C++ header to fpc

Dennis Poon
I don't know much about c++ and but I got this dll with the following
header that I need to use its dll.


#define SPDLLCALL __stdcall

typedef void (SPDLLCALL *LoginReplyAddr)(long ret_code, char *ret_msg);

typedef void (SPDLLCALL *p_SPAPI_RegisterLoginReply)(LoginReplyAddr addr);


#endif

Can anyone kind enough to teach me how to translate them into pascal
interface?

Thanks a lot.

Dennis
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: how to convert C++ header to fpc

Виктор Матузенко

14.08.2014 19:31, Dennis Poon пишет:

> I don't know much about c++ and but I got this dll with the following
> header that I need to use its dll.
>
>
> #define SPDLLCALL __stdcall
>
> typedef void (SPDLLCALL *LoginReplyAddr)(long ret_code, char *ret_msg);
>
> typedef void (SPDLLCALL *p_SPAPI_RegisterLoginReply)(LoginReplyAddr
> addr);
>
>
> #endif
>
> Can anyone kind enough to teach me how to translate them into pascal
> interface?

type
LoginReplyAddr: procedure (ret_code: LongInt; ret_msg: PAnsiChar); stdcall;
p_SPAPI_RegisterLoginReply: procedure (addr: LoginReplyAddr); stdcall;

ret_code may be a parameter of type Int64 (it depends on how long type
interpreted by C++ compiler).

--
Victor Matuzenko (Виктор Матузенко)

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: how to convert C++ header to fpc

Dennis Poon


Victor Matuzenko wrote:

>
> 14.08.2014 19:31, Dennis Poon пишет:
>> I don't know much about c++ and but I got this dll with the following
>> header that I need to use its dll.
>>
>>
>> #define SPDLLCALL __stdcall
>>
>> typedef void (SPDLLCALL *LoginReplyAddr)(long ret_code, char *ret_msg);
>>
>> typedef void (SPDLLCALL *p_SPAPI_RegisterLoginReply)(LoginReplyAddr
>> addr);
>>
>>
>> #endif
>>
>> Can anyone kind enough to teach me how to translate them into pascal
>> interface?
>
> type
> LoginReplyAddr: procedure (ret_code: LongInt; ret_msg: PAnsiChar);
> stdcall;
> p_SPAPI_RegisterLoginReply: procedure (addr: LoginReplyAddr); stdcall;
>
> ret_code may be a parameter of type Int64 (it depends on how long type
> interpreted by C++ compiler).
>
Thanks so much.

Dennis

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal