471,325 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Need MailSlot sample

Hi NG,

I am working on a project in VS2005 that has to comunicate with an older
application, using MailSlots.
As far as I know, I have to use pInvoke to achieve this.
It would be greate, to have a little sample on how to do this, please not
only the C# signature like:

[DllImport("kernel32.dll")]
static extern IntPtr CreateMailslot(string lpName, uint nMaxMessageSize,
uint lReadTimeout, IntPtr SecurityAttributes);

It would be greate to have a simple comlete sample that does a
create,write,read !

Regards
Rainer Queck
Dec 13 '05 #1
4 6958
Rainer,

Well, once you have the IntPtr which represents the mail slot, you can
pass that to the constructor of the FileStream class to read/write to the
mail slot. You don't need to be shown how to use that class, do you? =)

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Rainer Queck" <Ra****@noemail.noemail> wrote in message
news:uI*************@tk2msftngp13.phx.gbl...
Hi NG,

I am working on a project in VS2005 that has to comunicate with an older
application, using MailSlots.
As far as I know, I have to use pInvoke to achieve this.
It would be greate, to have a little sample on how to do this, please not
only the C# signature like:

[DllImport("kernel32.dll")]
static extern IntPtr CreateMailslot(string lpName, uint nMaxMessageSize,
uint lReadTimeout, IntPtr SecurityAttributes);

It would be greate to have a simple comlete sample that does a
create,write,read !

Regards
Rainer Queck

Dec 13 '05 #2
Hi Rainer,
Welcome to MSDN Newsgroup!

I browse some following articles (including samples) from internet. I think
they are you want and hope it's useful for you,
Title: Using a Mailslot to read/write data over a network
URL: http://www.codeproject.com/internet/mailslots.asp

Title: Using Mailslots for Interprocess Communication
URL: http://www.codeproject.com/cpp/mailslots.asp

If you have any questions or concerns, please let me know. I am standing by
to help you. Thanks again and have a nice day!

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Dec 14 '05 #3
Hi Terri,
I browse some following articles (including samples) from internet. I
think
they are you want and hope it's useful for you,

Thanks, yes they were useful.

Regards
Rainer
Dec 14 '05 #4
Hi Rainer,
I am glad to know it's helpful for you.
Thanks for participating the community!

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Dec 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by franklini | last post: by
reply views Thread by aherzallah | last post: by
1 post views Thread by aherzallah | last post: by
1 post views Thread by vertigo | last post: by
1 post views Thread by vertigo | last post: by
reply views Thread by vertigo | last post: by
reply views Thread by Hennie Coertze | last post: by
reply views Thread by rosydwin | last post: by

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.