Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,449 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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: 594
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 594
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: 594
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 594
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