flat assembler
Message board for the users of flat assembler.
Index
> Windows > wether to use invoke or cinvoke for dll functions |
Author |
|
shutdownall 24 May 2012, 17:35
Maybe this question have been answered already but could not find relevant information with search function in adaquate time.
How do I know wether to use invoke or cinvoke macro to call a DLL function ? I think the MS DLL's are all compatible with the invoke macro but what about custom DLL's not designed by MS ? How can I obtain the calling procedure if not provided in documents ? Concrete case is for this API http://www.ftdichip.com/Support/Documents/ProgramGuides/D2XX_Programmer%27s_Guide%28FT_000071%29.pdf But would be good to know in general for future / other provided API's. Thanks for help. |
|||
24 May 2012, 17:35 |
|
LocoDelAssembly 24 May 2012, 18:30
By looking at FTD2XX.H in example 1 I'd say they are stdcall and therefore you must use invoke. The reason I think they are stdcall is because they are marked WINAPI (which is defined as __stdcall).
|
|||
24 May 2012, 18:30 |
|
revolution 24 May 2012, 20:46
Yes, you use invoke. This is from my code:
Code: invoke FT_SetBaudRate,[comm_handle],FT_BAUD_115200 |
|||
24 May 2012, 20:46 |
|
revolution 24 May 2012, 22:23
shutdownall wrote: But is there a general rule what macro to use under which circumstances ... cinvoke for ccall invoke for stdcall shutdownall wrote: ... (if documentation is not provided or not with that detail) ? ret = ccall ret imm = stdcall |
|||
24 May 2012, 22:23 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.