Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (MadJack, AndrewAMD, Quad), 540 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 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