none
newbie passing data between projects RRS feed

  • Question

  • Hallo to all.

    I have two separate wpf projects A and B. Each one of these is a complete project with Windows and different threads. Now i want to start B from project A with a buttonclick. So far so good. 

    What i want to achieve is for A to fire an event with its generated, this is a continous process. As soon as B start it should subscribe to this event so it can handle the data.

    What is the best way to accomplish this? Does anybody have some simple samples? I have been looking into WCF but its complicated and i still dont have a clue as how to even use it. I am only known with C# and WPF.


    Jc


    • Edited by bochelie Tuesday, February 11, 2014 3:26 PM
    Tuesday, February 11, 2014 3:25 PM

Answers

  • Hi,

    In your situation, you do not want to use the callback between the client and server, so I will recommand you to just use the a wcf service as in my second reply.

    It will be ok if you just want to use the two projects always in the same computer. The the service url can be something like this: http://localhost:8080/yourservice....

    There are many Tutorials about the wcf service in the MSDN, please try to check it:
    http://msdn.microsoft.com/en-us/library/bb386386.aspx .
     
    But the wcf duplex service is a good technology, so you can learn it as well, then it will help you a lot in the future.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, February 12, 2014 8:47 AM
    Moderator
  • Hi,

    From your description, I think you should use the wcf duplex service to accomplish it.

    In the wcf duplex service, not only the client can calling the function from the client, but also the service can call some function at the client:

    Duplex1.gif

    Here are some articles about the wcf duplex service which may help you to get start:
    #WCF Duplex Services:
    http://msdn.microsoft.com/en-us/library/ms731064(v=vs.110).aspx .

    #A Beginner's Guide to Duplex WCF:
    http://www.codeproject.com/Articles/491844/A-Beginners-Guide-to-Duplex-WCF .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by bochelie Wednesday, February 12, 2014 8:10 AM
    Wednesday, February 12, 2014 6:13 AM
    Moderator

All replies

  • Hi,

    From your description, I think you should use the wcf duplex service to accomplish it.

    In the wcf duplex service, not only the client can calling the function from the client, but also the service can call some function at the client:

    Duplex1.gif

    Here are some articles about the wcf duplex service which may help you to get start:
    #WCF Duplex Services:
    http://msdn.microsoft.com/en-us/library/ms731064(v=vs.110).aspx .

    #A Beginner's Guide to Duplex WCF:
    http://www.codeproject.com/Articles/491844/A-Beginners-Guide-to-Duplex-WCF .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by bochelie Wednesday, February 12, 2014 8:10 AM
    Wednesday, February 12, 2014 6:13 AM
    Moderator
  • Thanks, but i want only one of the projects to send data and never receive. The other one will only receive and never send back. This seems like a start. Its still a lot of information but i think i wil have to start with it. If anyone has a simpler solution its still welcome.

    Jc


    • Edited by bochelie Wednesday, February 12, 2014 8:10 AM
    Wednesday, February 12, 2014 8:09 AM
  • Hi,

    >>I want only one of the projects to send data and never receive. The other one will only receive and never send back.

    If so, then you can use the wcf duplex service without callback, or you can achieve it by just using the a wcf service. Then one will be the server side, the other will be the client side.

    The following artilce is about the upload and download data using the wcf service, although it is not similar to your requirement, but it will help you to understand more about the wcf service, please try to check it to have a start.
    http://www.codeproject.com/Articles/166763/WCF-Streaming-Upload-Download-Files-Over-HTTP .

    Best Regards,
    Amy Peng

     


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Wednesday, February 12, 2014 8:23 AM
    Moderator
  • One last question. This wil happen between two projects always in the same computer. I dont want to bother reading something about ip's and internet. Is it then better to just use the first one of your answers?

    Jc

    Wednesday, February 12, 2014 8:34 AM
  • Hi,

    In your situation, you do not want to use the callback between the client and server, so I will recommand you to just use the a wcf service as in my second reply.

    It will be ok if you just want to use the two projects always in the same computer. The the service url can be something like this: http://localhost:8080/yourservice....

    There are many Tutorials about the wcf service in the MSDN, please try to check it:
    http://msdn.microsoft.com/en-us/library/bb386386.aspx .
     
    But the wcf duplex service is a good technology, so you can learn it as well, then it will help you a lot in the future.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, February 12, 2014 8:47 AM
    Moderator
  • you can use System.Diagnostics for starting another process or exe. please refer following link..

    http://www.dotnetperls.com/process-start

    Wednesday, February 12, 2014 9:12 AM