473,386 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

'
Oct 19 '06 #1
4 3084
"DirkMS" <ms**@nowhere.comschrieb:
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
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
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Oct 19 '06 #2
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
///

--
M S Herfried K. Wagner

Hi Herfried,

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


Oct 20 '06 #3
"DirkMS" <ms@nowhere.comschrieb:
>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?
Unfortunately I do not know a good source for API declarations I could
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
VB.NET?
Unfortunately no, but if you need additional function declarations
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/>

Oct 20 '06 #4
>
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
///
Hi Herfried,

thank you, with IntPtr it works!
Nov 2 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Brad Ford | last post by:
I see posts concerning the use of Whidbey, I am new to MSDN, and I would very much like to try it out. There is even a "hands on tutorial", but the requirement is that you have Whidbey installed...
11
by: DraguVaso | last post by:
Hi, I want to download Visual Studio 2005 Beta 1 Refresh, but on the site of Microsoft they say it is only for MSDN subscribers? what is a MSDN subscriber and how do I get it? When I try to...
3
by: Max A. Bündchen | last post by:
My enterprise is a Registered Microsoft Partner and we would to acquire a MSDN Universal subscription under the Empower ISV Program to start a new project in .Net (today we dev under VFP 7). ...
33
by: news.microsoft.com | last post by:
To Microsoft and fellow MSDN Universal subscribers... Regarding new MSDN Universal (I mean Premier) price and level changes: 1) Way too expensive for the small and medium developer Universal...
0
by: DirkMS | last post by:
Dear Support, I am looking for a working example to get mailslots running in VB.NET from CreateMailslot i get something looking like a handle but if i try to do something with it, i get an error...
0
by: frostbb | last post by:
1st I know about the new DataGridView control. For various reasons we need the IsSelected( ) method of the old DataGrid to work in the upgraded apps. I have a small test app that illustrates the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.