Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is my syntax wrong...?
Message
From
07/12/2006 11:22:21
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01175586
Message ID:
01175702
Views:
6
>Ok, i tried a different approach to the actual DECLARE statement of the API function. I changed my general DECLARE statement to:
>
>
>    <DllImport("dnsapi", EntryPoint:="DnsQuery_W", CharSet:=CharSet.Unicode, SetLastError:=True, ExactSpelling:=True)> _
>    Private Shared Function DnsQuery(<MarshalAs(UnmanagedType.VBByRefStr)> _
>        ByRef pszName As String, ByVal wType As QueryTypes, ByVal options As QueryOptions, ByVal aipServers As Integer, ByRef ppQueryResults As IntPtr, ByVal pReserved As Integer) As Integer
>    End Function
>
>    <DllImport("dnsapi", CharSet:=CharSet.Auto, SetLastError:=True)> _
>        Private Shared Sub DnsRecordListFree(ByVal pRecordList As IntPtr, ByVal FreeType As Integer)
>    End Sub
>
>
>This seemed to do the trick. Now of course, I don't know why, because I thought DLLImport and Declare was the same thing in essence. Yet apparently, DLLImport worked whereas Declare did not.

Check the page you bookmarked recently:) You need DllImport attribute for any win32API you declare.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform