Click here to Skip to main content
15,887,350 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionRe: TimeOut with Data Set Pin
Eddy Vluggen4-Jul-13 4:58
professionalEddy Vluggen4-Jul-13 4:58 
SuggestionRe: TimeOut with Data Set Pin
Richard Deeming4-Jul-13 5:17
mveRichard Deeming4-Jul-13 5:17 
GeneralRe: TimeOut with Data Set Pin
nagham_4ng4-Jul-13 19:23
nagham_4ng4-Jul-13 19:23 
GeneralRe: TimeOut with Data Set Pin
Eddy Vluggen5-Jul-13 7:07
professionalEddy Vluggen5-Jul-13 7:07 
GeneralRe: TimeOut with Data Set Pin
nagham_4ng5-Jul-13 19:48
nagham_4ng5-Jul-13 19:48 
GeneralRe: TimeOut with Data Set Pin
nagham_4ng8-Jul-13 21:12
nagham_4ng8-Jul-13 21:12 
GeneralRe: TimeOut with Data Set Pin
Eddy Vluggen9-Jul-13 8:44
professionalEddy Vluggen9-Jul-13 8:44 
Question[Solved] Message Queue, sending a class including a bitmap Pin
bas-man823-Jul-13 0:06
bas-man823-Jul-13 0:06 
Hi, I want to use message queues to send a class, which includes a bitmap. Creating, connecting and sending is no problem and receiving in the same application works just as well. But the same code in an other application throws a "SerializationException"

The code I use for the server application:
C#
private void MainLoad(object sender, EventArgs e)
{
    MessageQueue.Create(@"MYPC\MyQueue", false);
    MessageQueue queue = new MessageQueue(queueName);
    queue.BeginPeek(TimeSpan.FromDays(10.0),messagenumber++, new AsyncCallback(MyPeekCompleted));
}

private void MyPeekCompleted(IAsyncResult asyncResult)
{
    MessageQueue queue = new MessageQueue(@"MYPC\MyQueue");
    queue.Formatter = new BinaryMessageFormatter();
    System.Messaging.Message msg = queue.Receive(TimeSpan.FromDays(10.0));
    Protocol p = (Protocol)msg.Body;
    queue.BeginPeek(TimeSpan.FromDays(10.0), messagenumber++, new AsyncCallback(MyPeekCompleted));
}

private void ButtonSendClick(object sender, EventArgs e)
{
    MessageQueue queue = new MessageQueue(@"MYPC\MyQueue");
    Bitmap bmp = new Bitmap(@"D:\lena.gif");
    Protocol p = new Protocol();
    p.text = "test";
    p.sender = senderID;
    p.receiver = "Client";
    p.bitmap = bmp;

    System.Messaging.Message m = new System.Messaging.Message(p, new BinaryMessageFormatter());
    queue.Send(m);
}


Protocol is a class:
C#
[Serializable()]
public class Protocol
{
    public string sender;
    public string receiver;
    public string text;
    public System.Drawing.Image bitmap;
}


The code I use for the client application:
C#
private void MainLoad(object sender, EventArgs e)
{
    MessageQueue queue = new MessageQueue(@"MYPC\MyQueue");
    queue.BeginPeek(TimeSpan.FromDays(10.0),messagenumber++, new AsyncCallback(MyPeekCompleted));
}

private void MyPeekCompleted(IAsyncResult asyncResult)
{
    MessageQueue queue = new MessageQueue(@"MYPC\MyQueue");
    queue.Formatter = new BinaryMessageFormatter();
    System.Messaging.Message msg = queue.Receive(TimeSpan.FromSeconds(10.0));
    Protocol p = (Protocol)msg.Body;
    queue.BeginPeek(TimeSpan.FromDays(10.0), messagenumber++, new AsyncCallback(MyPeekCompleted));
}


modified 4-Jul-13 4:51am.

AnswerRe: Message Queue, sending a class including a bitmap Pin
bas-man823-Jul-13 22:50
bas-man823-Jul-13 22:50 
QuestionMessage Queue Pin
Member 997471330-Jun-13 1:06
Member 997471330-Jun-13 1:06 
AnswerRe: Message Queue Pin
Pete O'Hanlon30-Jun-13 10:57
mvePete O'Hanlon30-Jun-13 10:57 
GeneralRe: Message Queue Pin
Member 997471330-Jun-13 23:19
Member 997471330-Jun-13 23:19 
GeneralRe: Message Queue Pin
Pete O'Hanlon1-Jul-13 3:01
mvePete O'Hanlon1-Jul-13 3:01 
QuestionCan not move controls over a user control Pin
dSolariuM29-Jun-13 9:53
dSolariuM29-Jun-13 9:53 
QuestionDiscussion on Screen Size and MDI Pin
Ron Beyer26-Jun-13 12:20
professionalRon Beyer26-Jun-13 12:20 
AnswerRe: Discussion on Screen Size and MDI Pin
Sergey Alexandrovich Kryukov26-Jun-13 13:33
mvaSergey Alexandrovich Kryukov26-Jun-13 13:33 
GeneralRe: Discussion on Screen Size and MDI Pin
Ron Beyer26-Jun-13 14:03
professionalRon Beyer26-Jun-13 14:03 
GeneralRe: Discussion on Screen Size and MDI Pin
Sergey Alexandrovich Kryukov26-Jun-13 16:55
mvaSergey Alexandrovich Kryukov26-Jun-13 16:55 
SuggestionRe: Discussion on Screen Size and MDI Pin
TnTinMn27-Jun-13 8:00
TnTinMn27-Jun-13 8:00 
GeneralRe: Discussion on Screen Size and MDI Pin
Ron Beyer27-Jun-13 8:39
professionalRon Beyer27-Jun-13 8:39 
GeneralRe: Discussion on Screen Size and MDI Pin
TnTinMn27-Jun-13 13:47
TnTinMn27-Jun-13 13:47 
QuestionCan not load dlls in project Pin
Nooredin25-Jun-13 23:49
Nooredin25-Jun-13 23:49 
AnswerRe: Can not load dlls in project Pin
Eddy Vluggen26-Jun-13 0:11
professionalEddy Vluggen26-Jun-13 0:11 
GeneralRe: Can not load dlls in project Pin
Nooredin26-Jun-13 0:24
Nooredin26-Jun-13 0:24 
GeneralRe: Can not load dlls in project Pin
Eddy Vluggen26-Jun-13 1:12
professionalEddy Vluggen26-Jun-13 1:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.