"Bad DLL calling convention" errors occur when you declare your API functions with incorrect datatypes or with too few or too many parameters.

You did not provide enough information so I looked it up. Apparently the z4opencfg function has optional parameters. I think you need to leave that alone. The VB declaration is this:

Public Declare Function z4opencfg Lib "zip4_w32.dll" Alias "z4opencfgSTD" (lpOpenParm As Z4OPEN_PARM)

And here's the structures to be filled and passed to that function:

C structures

typedef struct
{
char *address1;
char *addrindex;
char *cdrom;
char *citystate;
char *crossref;
char *system;
char *elot;
char *elotindex;
char *ewspath;
}CONFIG_PARM;

typedef struct
{
char rsvd1[50];
short status;
char *fname;
CONFIG_PARM config;
char elotflag;
char rsvd2[50];
}Z4OPEN_PARM

VB structures

Public Type CONFIG_PARM
address1 As String
addrindex As String
cdrom As String
citystate As String
crossref As String
system As String
elot As String
elotindex As String
ewspath As String
End Type

Public Type Z4OPEN_PARM
rsvd1 As String * 50
status As Integer
fname As String
config As CONFIG_PARM
elotflag As Byte
rsvd2 As String * 50
End Type
_________________________
Domain Registration, Hosting, Management
http://www.dollardns.net