Need MailSlot sample

  • Thread starter Thread starter Rainer Queck
  • Start date Start date
R

Rainer Queck

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
 
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.
 
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.)
 
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
 
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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top