|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Searching desparately for createmailslot example in VB.NET (MSDN universal Subscriber)Hi,
Declare Function CreateMailslot Lib "kernel32.dll" _ Alias "CreateMailslotA" ( _ ByVal lpName As String, _ ByVal nMaxMessageSize As Long, _ ByVal lReadTimeout As Long, _ ByVal lpSecurityAttributes As SECURITY_ATTRIBUTES) As Long Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long ' "DirkMS" <m***@nowhere.com> schrieb: Your declarations are wrong. Use these instead:> Declare Function CreateMailslot Lib "kernel32.dll" _ > Alias "CreateMailslotA" ( _ > ByVal lpName As String, _ > ByVal nMaxMessageSize As Long, _ > ByVal lReadTimeout As Long, _ > ByVal lpSecurityAttributes As SECURITY_ATTRIBUTES) As Long > > Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As > Long) As Long \\\ Private Declare Auto Function CreateMailslot Lib "kernel32.dll" ( _ ByVal lpName As String, _ ByVal nMaxMessageSize As Int32, _ ByVal lReadTimeout As Int32, _ ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES _ ) As IntPtr Private Declare Function CloseHandle Lib "kernel32.dll" ( _ ByVal hObject As IntPtr _ ) As Boolean /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Show quote
Hide quote
> Your declarations are wrong. Use these instead: Hi Herfried,> > \\\ > Private Declare Auto Function CreateMailslot Lib "kernel32.dll" ( _ > ByVal lpName As String, _ > ByVal nMaxMessageSize As Int32, _ > ByVal lReadTimeout As Int32, _ > ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES _ > ) As IntPtr > > Private Declare Function CloseHandle Lib "kernel32.dll" ( _ > ByVal hObject As IntPtr _ > ) As Boolean > /// > > -- > M S Herfried K. Wagner thank you very much, i will try it as soon I'm back in office. I found 5 or more variants of declarations (but not this one). Is there a good source or book for correct API declarations in VB.NET? Do you know a link to further informations about using mailslots in VB.NET? Thanks and have a nice weekend. DirkMS
Show quote
Hide quote
"DirkMS" <m*@nowhere.com> schrieb: Unfortunately I do not know a good source for API declarations I could >> Your declarations are wrong. Use these instead: >> >> \\\ >> Private Declare Auto Function CreateMailslot Lib "kernel32.dll" ( _ >> ByVal lpName As String, _ >> ByVal nMaxMessageSize As Int32, _ >> ByVal lReadTimeout As Int32, _ >> ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES _ >> ) As IntPtr >> >> Private Declare Function CloseHandle Lib "kernel32.dll" ( _ >> ByVal hObject As IntPtr _ >> ) As Boolean >> /// >> > > I found 5 or more variants of declarations (but not this one). Is there a > good source or book for correct API declarations in VB.NET? recommend. The declaration I have posted has been created by manually translating the C function prototype to VB. Note that there are many differences between API declarations for VB6 and VB.NET. Converting the declarations is not a straightforward process. Instead it's often necessary to completely rewrite the declarations because VB.NET provides some additional features to access API functions which VB6 does not provide. > Do you know a link to further informations about using mailslots in Unfortunately no, but if you need additional function declarations > VB.NET? translated to VB.NET, feel free to ask. There's nothing worse than code which uses invalid function declarations. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Show quote
Hide quote
> Hi Herfried,> Your declarations are wrong. Use these instead: > > \\\ > Private Declare Auto Function CreateMailslot Lib "kernel32.dll" ( _ > ByVal lpName As String, _ > ByVal nMaxMessageSize As Int32, _ > ByVal lReadTimeout As Int32, _ > ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES _ > ) As IntPtr > > Private Declare Function CloseHandle Lib "kernel32.dll" ( _ > ByVal hObject As IntPtr _ > ) As Boolean > /// thank you, with IntPtr it works!
main menu disappearred
If comparision operator is one of these or contains ? Question about walking the file system Show ToolTip on every Control continuously Starting process using shell execute returns nothing Incomplete Escaping Functionality?? Transparent listview Checked List Box check in program windows service + vb.net + windows 2003 |
|||||||||||||||||||||||