Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Client-Server using socket?

Client-Server using socket?

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++sysadmintutorialquestion
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    uresh hanmugam
    wrote on last edited by
    #1

    Hi, I want to build one MFC dll which will act as a server using socket or any other concepts... And then want to build one windows application using c# which will act as a client. If i click a button from the c# application, one of the server function want to invoke!.. Is it possible? If anybody know, please guide me... Thanx in advance Surez

    L CPalliniC I R 4 Replies Last reply
    0
    • U uresh hanmugam

      Hi, I want to build one MFC dll which will act as a server using socket or any other concepts... And then want to build one windows application using c# which will act as a client. If i click a button from the c# application, one of the server function want to invoke!.. Is it possible? If anybody know, please guide me... Thanx in advance Surez

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      $uresh $hanmugam wrote:

      Is it possible?

      Yes

      $uresh $hanmugam wrote:

      If anybody know, please guide me...

      Learn MFC, then learn C#, then write the two parts of your program and test them. If you have already written parts of these progrmas and have come across a problem then tell us what is wrong and we may be able to help.

      1 Reply Last reply
      0
      • U uresh hanmugam

        Hi, I want to build one MFC dll which will act as a server using socket or any other concepts... And then want to build one windows application using c# which will act as a client. If i click a button from the c# application, one of the server function want to invoke!.. Is it possible? If anybody know, please guide me... Thanx in advance Surez

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        Usually sockets are used for communications between remote machines, on the other hand, a C# application may interact (the way you depicted) with a DLL via interoperability, see for instance [^]. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        In testa che avete, signor di Ceprano?

        1 Reply Last reply
        0
        • U uresh hanmugam

          Hi, I want to build one MFC dll which will act as a server using socket or any other concepts... And then want to build one windows application using c# which will act as a client. If i click a button from the c# application, one of the server function want to invoke!.. Is it possible? If anybody know, please guide me... Thanx in advance Surez

          I Offline
          I Offline
          Iain Clarke Warrior Programmer
          wrote on last edited by
          #4

          As you are getting bits of advice... I DLL does not run in isolation - you need an exe to use that DLL. So, why not write a EXE server? As has been said, sockets are great for communicating between machine - on different OS's, on different continents too. If you know these processes will be on the same machine, there are simpler inter-process methods! http://www.flounder.com/kb192570.htm[^] may be of use to you. Iain. ps, if you have not worked it out by now, you're asking "I want to make a new car. Can anyone guide me" "well, it's a big question, what do you know now?"

          I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]

          1 Reply Last reply
          0
          • U uresh hanmugam

            Hi, I want to build one MFC dll which will act as a server using socket or any other concepts... And then want to build one windows application using c# which will act as a client. If i click a button from the c# application, one of the server function want to invoke!.. Is it possible? If anybody know, please guide me... Thanx in advance Surez

            R Offline
            R Offline
            Rajesh R Subramanian
            wrote on last edited by
            #5

            MFC has socket class implementations (Both synchronous and asynchronous). Use the asynchronous socket class to build your server and use synchronous socket class to connect to the server. Accept connections with the UI thread and use a threadpool to serve the clients. Hint: Synchronous = blocking = CSocket Asynchronous = non-blocking = CAsyncSocket Hint 2: Sockets are not programming language dependent.

            It is a crappy thing, but it's life -^ Carlo Pallini

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups