troubleshooting Question

Problem with DHCPEnumSubnetClients

Avatar of JMFCAMPOS
JMFCAMPOS asked on
Programming
8 Comments1 Solution661 ViewsLast Modified:
Hi!
I'm using VB6 and I've a problem with DHCPEnumSubnetClinents API.

Declare Function DhcpEnumSubnetClients Lib "Dhcpsapi" (ByVal ServerIpAddress As String, _
                                                        ByVal SubnetAddress As Long, _
                                                        ByRef  ResumeHandle As Integer, _
                                                        ByRef PreferredMaximum As Integer, _
                                                        ByRef ClientInfo As Integer, _
                                                        ByRef ClientsRead As Integer, _
                                                        ByRef ClientsTotal As Integer) As Integer

The field SubnetAddress is supose to be a Long, but the decimal value for the my Subnet is actualy a double.The subnet address 255.255.255.0 decimal value is 4294967040# wich is a double not a long.
But if I change on the function the SubnetAdress data type to double I receive runtime error 49 'Bad  DLL Calling Convention'.
I've tried to change the field data type to "byVal SubnetAddress as Any" and pass the value as a string but then the function returns no values.
Can somenone help me with this?

Best Regards
JC
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros