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. ATL / WTL / STL
  4. How to Implement RPC in windows XP

How to Implement RPC in windows XP

Scheduled Pinned Locked Moved ATL / WTL / STL
c++helpsysadmintutorialquestion
16 Posts 3 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.
  • S Stuart Dootson

    Good point - I forgot that one. So long since I used VC6....since I moved to VS2003, I've always used a Visual Studio newer than my standard target (Windows 2000 - we've not managed to make the giant leap to XP or Vista at the company I work for).

    Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

    S Offline
    S Offline
    suthakar56
    wrote on last edited by
    #7

    Hi, I compiled the idl file and it creates server and client (ie client_c.c and server_s.c) stub files.Client stub file is working properly in application.But In server stub file Interface definition is not implemented(generated code).(I created idl file project type is ATL COM AppWizard and server type as Service). Regrads, Suthakar

    S 1 Reply Last reply
    0
    • S suthakar56

      Hi, I compiled the idl file and it creates server and client (ie client_c.c and server_s.c) stub files.Client stub file is working properly in application.But In server stub file Interface definition is not implemented(generated code).(I created idl file project type is ATL COM AppWizard and server type as Service). Regrads, Suthakar

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #8

      suthakar56 wrote:

      But In server stub file Interface definition is not implemented

      What do you mean by 'not implemented'? I just tried a quick sample of IDL, which I processed with midl /server stub /client stub a.idl - seemed to have the correct server marshalling code.

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      S 1 Reply Last reply
      0
      • S Stuart Dootson

        suthakar56 wrote:

        But In server stub file Interface definition is not implemented

        What do you mean by 'not implemented'? I just tried a quick sample of IDL, which I processed with midl /server stub /client stub a.idl - seemed to have the correct server marshalling code.

        Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

        S Offline
        S Offline
        suthakar56
        wrote on last edited by
        #9

        I just compiled .idl by vc++ editer itself.It creates the client and server stub files.I want to know that whether i should compile .idl file using midl compiler only or the the first is enough. Not implemented -->The function(idl) definition is implemented in server stub file (in my sample code).But original code it was not there.

        S 1 Reply Last reply
        0
        • S suthakar56

          I just compiled .idl by vc++ editer itself.It creates the client and server stub files.I want to know that whether i should compile .idl file using midl compiler only or the the first is enough. Not implemented -->The function(idl) definition is implemented in server stub file (in my sample code).But original code it was not there.

          S Offline
          S Offline
          Stuart Dootson
          wrote on last edited by
          #10

          suthakar56 wrote:

          I just compiled .idl by vc++ editer itself.It creates the client and server stub files.I want to know that whether i should compile .idl file using midl compiler only or the the first is enough.

          VC++ uses MIDL. That's fine.

          suthakar56 wrote:

          Not implemented -->The function(idl) definition is implemented in server stub file (in my sample code).But original code it was not there.

          Can you explain what you mean by 'But original code it was not there'

          Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

          S 1 Reply Last reply
          0
          • S Stuart Dootson

            suthakar56 wrote:

            I just compiled .idl by vc++ editer itself.It creates the client and server stub files.I want to know that whether i should compile .idl file using midl compiler only or the the first is enough.

            VC++ uses MIDL. That's fine.

            suthakar56 wrote:

            Not implemented -->The function(idl) definition is implemented in server stub file (in my sample code).But original code it was not there.

            Can you explain what you mean by 'But original code it was not there'

            Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

            S Offline
            S Offline
            suthakar56
            wrote on last edited by
            #11

            I am already having some sample code for RPC which executes perfectly.But my RPC server stub code, implementation of idl function definition (ie auto generated) was not there.

            S 1 Reply Last reply
            0
            • S suthakar56

              I am already having some sample code for RPC which executes perfectly.But my RPC server stub code, implementation of idl function definition (ie auto generated) was not there.

              S Offline
              S Offline
              Stuart Dootson
              wrote on last edited by
              #12

              So - do you mean there was no whatever_s.c file? Or that it was empty? Try posting your IDL, and look in your VC++ project settings for that file to see what the command line to compile the IDL is and post that.

              Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

              S 1 Reply Last reply
              0
              • S Stuart Dootson

                So - do you mean there was no whatever_s.c file? Or that it was empty? Try posting your IDL, and look in your VC++ project settings for that file to see what the command line to compile the IDL is and post that.

                Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                S Offline
                S Offline
                suthakar56
                wrote on last edited by
                #13

                Hi, now server is working fine but in client side it through an exception while running with breakpoints in client stub file.The idl file is as follows

                [ uuid (id),
                version(1.0),
                pointer_default(unique)
                ]
                interface myidl
                {
                typedef struct
                {
                int data;
                }DATA_ST;

                void function([out] [in] DATA_ST *,DATA_ST);
                }

                NdrNsGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, myidl__MIDL_AutoBindHandle ); while running this above function it through the exception " Runtime reported exception 0x6e2 = 1762.I want to know how the synchronization is maintained between client and server.

                S 1 Reply Last reply
                0
                • S suthakar56

                  Hi, now server is working fine but in client side it through an exception while running with breakpoints in client stub file.The idl file is as follows

                  [ uuid (id),
                  version(1.0),
                  pointer_default(unique)
                  ]
                  interface myidl
                  {
                  typedef struct
                  {
                  int data;
                  }DATA_ST;

                  void function([out] [in] DATA_ST *,DATA_ST);
                  }

                  NdrNsGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, myidl__MIDL_AutoBindHandle ); while running this above function it through the exception " Runtime reported exception 0x6e2 = 1762.I want to know how the synchronization is maintained between client and server.

                  S Offline
                  S Offline
                  Stuart Dootson
                  wrote on last edited by
                  #14

                  suthakar56 wrote:

                  I want to know how the synchronization is maintained between client and server.

                  By maintaining a single thread of control between client and server - the calling thread on the client side waits while an RPC call is made.

                  suthakar56 wrote:

                  void function([out] [in] DATA_ST *,DATA_ST);

                  Should that be

                  void function([out] DATA_ST *,[in] DATA_ST);

                  ?

                  suthakar56 wrote:

                  Runtime reported exception 0x6e2 = 1762

                  Error 1762 == RPC_S_NAME_SERVICE_UNAVAILABLE. Means it can't find the server, I think.

                  Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                  S 1 Reply Last reply
                  0
                  • S Stuart Dootson

                    suthakar56 wrote:

                    I want to know how the synchronization is maintained between client and server.

                    By maintaining a single thread of control between client and server - the calling thread on the client side waits while an RPC call is made.

                    suthakar56 wrote:

                    void function([out] [in] DATA_ST *,DATA_ST);

                    Should that be

                    void function([out] DATA_ST *,[in] DATA_ST);

                    ?

                    suthakar56 wrote:

                    Runtime reported exception 0x6e2 = 1762

                    Error 1762 == RPC_S_NAME_SERVICE_UNAVAILABLE. Means it can't find the server, I think.

                    Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                    S Offline
                    S Offline
                    suthakar56
                    wrote on last edited by
                    #15

                    Hi Stuart, The problem is solved.As a beginner,I missed the .acf file.So that the problem is created.Now this is working fine.Thank you for your replies.

                    S 1 Reply Last reply
                    0
                    • S suthakar56

                      Hi Stuart, The problem is solved.As a beginner,I missed the .acf file.So that the problem is created.Now this is working fine.Thank you for your replies.

                      S Offline
                      S Offline
                      Stuart Dootson
                      wrote on last edited by
                      #16

                      Good! Well done for sorting it out!

                      suthakar56 wrote:

                      As a beginner,I missed the .acf file

                      I've never used an acf file when I've used MS-RPC - I guess the situations where I've used RPC have been simple enough for me to get away without one.

                      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                      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