Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have in C++ used the message parameter lParam to see the result of an operation.

 

example :

 

byte status = (byte) lParam

 

if (status == ANSWER_ACCEPTED)

etc..

 

Now I would like to do the simalar in C#. Are there any method I can use or do I have do wrap the win32 ??

Posted

I was just interesting to know if there where any method to use when you want to know the result of an operation. There must be !

 

Or do I have to wrap [DllImport("user32")] to get the benefits of SendMessage.

  • Administrators
Posted

It really depends on what you are trying to do, if you are calling the windows API you will need to continue using the same techniques as always to get status / error codes back.

If you want to use the SendMessage API you will need to use DllImport to be able to call it.

 

However if you gave more details about what you are trying to acheive there may be a .Net way to do it.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

I think that using MessageQueueTransaction I obtain the same thing as SendMessage, but I am not sure !!!!

 

public void OperationCompleted(System.Messaging.Message msg)

{

MessageQueueTransaction mqtx = new MessageQueueTransaction();

 

if(mqtx.Status == MessageQueueTransactionStatus.Pending)

{

mqtx.abort;

}

else

if(mqtx.Status == MyCodeStatus)

{

statusfield.Text("This is my code status");

}

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...