Re: [go-nuts] Golang calling Windows DLL function with more than 18 arguments

2021-06-03 Thread Ian Lance Taylor
On Thu, Jun 3, 2021 at 9:20 AM George Vanev  wrote:
>
> The function is from a Chinese  SDK and I don't have the source code:
> int HDAPI Hd_Rt_SendRealTimeText(int nSendType, void *pStrParams, int 
> nRealTimeAreaIndex, int nMaxPageCount, int nColor, int nGray, int nX, int nY, 
> int nWidth, int nHeight,
> void *pText, int nTextColor, int nBackGroupColor, int nStyle, void 
> *pFontName, int nFontHeight, int nShowEffect, int nShowSpeed,int nStayTime, 
> int nLiveTime,
> int bSaveToFlash, void *pDeviceGUID);

OK, well, that is fairly dreadful.

As far as I know the only workaround is to use cgo.

Please open an issue to ask for Syscall21 and Syscall24.  Thanks.

Ian


> On Thursday, June 3, 2021 at 7:10:05 PM UTC+3 Ian Lance Taylor wrote:
>>
>> On Thu, Jun 3, 2021 at 8:42 AM George Vanev  wrote:
>> >
>> > I have an external 64 bit .DLL and I have to pass 22 arguments to one of 
>> > the functions. Go (go1.16.4 windows/amd64) allows up to 18 arguments. Is 
>> > there any workaround?
>> > I've tried to make Syscall22 in dll_windows.go, link it with 
>> > syscall_Syscall22 in src/runtime/syscall_windows.go and rebuilt: go 
>> > install -a runtime. But it give me errors when trying to call the function
>>
>> There is currently no support for more than 18 arguments.
>>
>> What is the function you are trying to call?
>>
>> Ian
>
> --
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/afbc4719-6a81-4e3d-a888-8789b9b46c40n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcV%3DaFcHremESsqx-FCWUSH6HK8k2JdSAT_pvgH2mdjqdQ%40mail.gmail.com.


Re: [go-nuts] Golang calling Windows DLL function with more than 18 arguments

2021-06-03 Thread George Vanev
The function is from a Chinese  SDK and I don't have the source code:
int HDAPI Hd_Rt_SendRealTimeText(int nSendType, void *pStrParams, int 
nRealTimeAreaIndex, int nMaxPageCount, int nColor, int nGray, int nX, int 
nY, int nWidth, int nHeight, 
void *pText, int nTextColor, int nBackGroupColor, int nStyle, void 
*pFontName, int nFontHeight, int nShowEffect, int nShowSpeed,int nStayTime, 
int nLiveTime, 
int bSaveToFlash, void *pDeviceGUID); 

On Thursday, June 3, 2021 at 7:10:05 PM UTC+3 Ian Lance Taylor wrote:

> On Thu, Jun 3, 2021 at 8:42 AM George Vanev  wrote:
> >
> > I have an external 64 bit .DLL and I have to pass 22 arguments to one of 
> the functions. Go (go1.16.4 windows/amd64) allows up to 18 arguments. Is 
> there any workaround?
> > I've tried to make Syscall22 in dll_windows.go, link it with 
> syscall_Syscall22 in src/runtime/syscall_windows.go and rebuilt: go install 
> -a runtime. But it give me errors when trying to call the function
>
> There is currently no support for more than 18 arguments.
>
> What is the function you are trying to call?
>
> Ian
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/afbc4719-6a81-4e3d-a888-8789b9b46c40n%40googlegroups.com.


Re: [go-nuts] Golang calling Windows DLL function with more than 18 arguments

2021-06-03 Thread Ian Lance Taylor
On Thu, Jun 3, 2021 at 8:42 AM George Vanev  wrote:
>
> I have an external 64 bit .DLL and I have to pass 22 arguments to one of the 
> functions. Go (go1.16.4 windows/amd64) allows up to 18 arguments. Is there 
> any workaround?
> I've tried to make Syscall22 in dll_windows.go, link it with 
> syscall_Syscall22 in src/runtime/syscall_windows.go and rebuilt: go install 
> -a runtime. But it give me errors when trying to call the function

There is currently no support for more than 18 arguments.

What is the function you are trying to call?

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcWhqbZeM4N2SekbOXEk1bCC%3D_2HDV7ozu_OsTGAjVVcLA%40mail.gmail.com.


[go-nuts] Golang calling Windows DLL function with more than 18 arguments

2021-06-03 Thread George Vanev
I have an external 64 bit .DLL and I have to pass 22 arguments to one of 
the functions. Go (go1.16.4 windows/amd64) allows up to 18 arguments. Is 
there any workaround?
I've tried to make Syscall22 in dll_windows.go, link it with 
syscall_Syscall22 in src/runtime/syscall_windows.go and rebuilt: go install 
-a runtime. But it give me errors when trying to call the function

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/918a1099-14f2-4f08-a71a-81c48de7e783n%40googlegroups.com.