Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Imhotep, opm), 785 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
work with DLL #477330
06/16/19 11:47
06/16/19 11:47
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
Hi,

I not clear, how to use dll.

from
Code
zmq_version	0x1003cd80	0x0003cd80	59 (0x3b)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	


I trying this code ( from sample in manual )
Code
#include <windows.h>

void __stdcall zmq_version(int *,int *,int *);  // line 101
API(zmq_version,libzmq);

void main (void) {
  int v1;
  int v2;
  int v3;
  zmq_version(v1,v2,v3);
  printf("\nversion: %d.%d.%d",v1,v2,v3);
}


but I get error:

hello compiling..
Error in 'line 101:
syntax error
< void __stdcall zmq_version(int *,int *,int *); >.

so, I also try:
Code
void __stdcall zmq_version(int *m,int *n,int *l);  // line 101
void __stdcall zmq_version(int m,int n,int l);      // line 101


for others this a work!!!
Code

void __stdcall zmq_version(int *,int *,int *)
API(zmq_version,libzmq);


I remove the semicolon


but now I get other error:
Code

0mq_zorro compiling....... ok

version: 4.2.0
Error 111: Crash in function

Last edited by Grat; 06/16/19 12:05.
Re: work with DLL [Re: Grat] #477331
06/16/19 12:03
06/16/19 12:03
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
Code
#include <windows.h>

void __stdcall zmq_version(int*, int*, int*);  
API(zmq_version,libzmq)

void main (void) {
  int v1;
  int v2;
  int v3;
  zmq_version(&v1,&v2,&v3);
  printf("\nversion: %d.%d.%d",v1,v2,v3);
}

Re: work with DLL [Re: Grat] #477332
06/16/19 12:11
06/16/19 12:11
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
Thanks Petra,

I found the problem - the semicolon.

Now I am trying find the error 111

I make on wrapper ZeroMq for Zorro. Maybe missing correct destroy.

Milan

Re: work with DLL [Re: Grat] #477333
06/16/19 12:47
06/16/19 12:47
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
Are you sure that __stdcall is right? Thats normally only used for system dlls. For writing an own DLL I would use __cdecl, not __stdcall.

Re: work with DLL [Re: Grat] #477339
06/17/19 06:05
06/17/19 06:05
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
Yes,

if I use __cdecl not __stdcall work without problem


Thanks


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1