UGN Security Forums
My ProfileMember DirectoryLogin
Search our ForumsView our FAQView our Site Rules
View our CalendarView our Active TopicsGo to our Main Page

UGN Security Store
 

Network Sites UGN Security, Elite Web Gamers, Back of the Web, EveryDay Helper, VNC Web Design & Development
July
Su M Tu W Th F Sa
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Our Sponsors
Latest Postings
Geek Code Write in 1993 I like it
by Gizmo
07/18/08 11:05 PM
Miss mash of urban ledgends told so well
by Gizmo
07/18/08 11:04 PM
I read this and laughed
by Gizmo
07/18/08 10:58 PM
Vote for President
by IceMyst
07/18/08 06:38 AM
question about IE and CSS
by Gizmo
07/17/08 11:28 PM
XBox Live Port Forwarding
by Gizmo
07/14/08 09:41 AM
EeePC Delivery
by Gizmo
07/14/08 03:18 AM
Pre Login message?
by Shinobi
07/13/08 10:44 PM
Comcast upgrades Upload Speed!
by Gizmo
07/11/08 12:39 AM
Robert Moore aka MooreR PC Magazine Subscription
by Gizmo
06/22/08 01:36 PM
Topic Options
#17526 - 11/19/03 03:55 PM Cannot access DLL
pavi Offline
Junior Member

Registered: 11/19/03
Posts: 2
Hi AVi here,

I'am new on this board.
I'am dealing with a dll written in C.

De function is declered in C as follows:

int IOTSVC_API iotsvc_Open(unsigned long *pulHandle, char *csTarget, iotlayout_t *pLayout);

How should i declare this function within VB6 and how can i access the functioncall.

Hopefully someone can help me further with this.

AVI

Top
Our Sponsors
Sponsor Our Sponsors

Top  
#17527 - 11/20/03 01:48 PM Re: Cannot access DLL
alchemist Offline
Junior Member

Registered: 10/14/03
Posts: 17
Loc: melbourne Australia
something like this...

Private Declare Function iotsvc_Open Lib "dll's
name.." (pulHandle as long, csTarget as char,
pLayout as iotlayout_t)

this probly won't work but it should look like this
u might have to play with it abit...

Top
#17528 - 11/22/03 09:42 PM Re: Cannot access DLL
SilentRage Offline
DollarDNS Owner

Registered: 03/04/02
Posts: 1273
Loc: OH, USA
Not quite, this is the VB declaration:

Private Declare iotsvc_Open Lib "dllname.dll" (pulHandle As Long, ByVal csTarget As String, pLayout As iotlayout_t) As Long

There is no such thing as type 'char' in VB6 and strings must ALWAYS be declared ByVal so that the pointer to the string is passed and not the pointer to the variable.
_________________________
Domain Registration, Hosting, Management
http://www.dollardns.net

Top
#17529 - 11/24/03 02:02 PM Re: Cannot access DLL
pavi Offline
Junior Member

Registered: 11/19/03
Posts: 2
Hi,

I'am still having difficulties in VB with the use of a function call in a certain C DLL.

The DLL function is described below. There is a struct in it aswell.
Hopefully you have an answer to this. I tried a lot but nothing will work.

int IOTSVC_API iotsvc_Open(unsigned long *pulHandle, char *csTarget, iotlayout_t *pLayout);

typedef struct
{
unsigned char ucType;
char csName[16];
unsigned short usTotalNoInputs;
unsigned short usNoAnalogeInputs;
unsigned short usNoDigitalInputs;
unsigned short usTotalNoOutputs;
unsigned short usNoAnalogeOutputs;
unsigned short usNoDigitalOutputs;
} iotmodule_t;

typedef struct
{
unsigned short usTotalNoInputs;
unsigned short usTotalNoOutputs;
unsigned short usNoIOmodules;
iotmodule_t IOmoduleInfo[MAX_NO_IO_MODULES];
} iotlayout_t;

How should i declare this in VB ??
and how can i access the C function in VB ??

Thank for your help

AVI

Top
#17530 - 11/24/03 05:58 PM Re: Cannot access DLL
SilentRage Offline
DollarDNS Owner

Registered: 03/04/02
Posts: 1273
Loc: OH, USA
I already stated the function declaration in my previous post. Here's the structure declarations:

Private Type iotmodule_t
ucType As Byte
csName As String * 16
usTotalNoInputs As Integer
usNoAnalogeInputs As Integer
usNoDigitalInputs As Integer
usTotalNoOutputs As Integer
usNoAnalogeOutputs As Integer
usNoDigitalOutputs As Integer
End Type

Private Type iotlayout_t
usTotalNoInputs As Integer
usTotalNoOutputs As Integer
usNoIOmodules As Integer
IOmoduleInfo(MAX_NO_IO_MODULES) As iotmodule_t
End Type
_________________________
Domain Registration, Hosting, Management
http://www.dollardns.net

Top



Forum Stats
6904 Members
44 Forums
10241 Topics
44953 Posts

Max Online: 677 @ 06/30/07 10:06 PM
Top Posters
Gizmo 6909
§intå× 3246
UGN Security 3232
IceMyst 1448
SilentRage 1273
Ice 1146
pergesu 1134
Infinite 1039
jonconley 954
Girlie 903
Newest Members
naskweeky, DJ ODEN, Maurino, alfred1964, sadasd
6903 Registered Users
Who's Online
0 Registered (), 5 Guests and 7 Spiders online.
Key: Admin, Global Mod, Mod
Latest News
New Update Humpday
by Gizmo
07/17/08 08:21 AM
IRC Restored
by Gizmo
07/15/08 12:50 AM
IRC Server Funding
by Gizmo
07/01/08 02:48 PM
Fixed: Front Page - News Display
by Gizmo
06/25/08 11:25 AM


Donate

Get the Google FireFox Toolbar
Get Firefox!
Get FireFox!