Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8356195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:06:45+00:00 2026-06-09T10:06:45+00:00

I created the following interface [ServiceContract] public interface IPlusFive { [OperationContract] int PlusFive(int value);

  • 0

I created the following interface

[ServiceContract]
public interface IPlusFive
{
    [OperationContract]
    int PlusFive(int value);
}

and the following server

class Program
{
    static void Main(string[] args)
    {
        using (ServiceHost host = new ServiceHost(typeof(PlusFiver),
            new Uri[] { new Uri("net.pipe://localhost") }))
        {
            host.AddServiceEndpoint(typeof(IPlusFive), new NetNamedPipeBinding(), "PipePlusFive");
            host.Open();
            Console.WriteLine("Service is Available. Press enter to exit.");
            Console.ReadLine();
            host.Close();
        }
    }
}

Then I created a C# client to test it and that works fine.

According to this blog post I need to read a memory mapped file to get the name of the pipe.

So I wrote the following to get the name

#include "stdafx.h"
#include "windows.h"
#include <iostream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
char pipeName[] = "EbmV0LnBpcGU6Ly8rL1BJUEVQTFVTRklWRS8=";

wcout << "Opening file map.."<< endl;
std::wstring mapFile;
mapFile.append(L"net.pipe:E");
mapFile.append(L"bmV0LnBpcGU6Ly8rLw==");
HANDLE fileMap = OpenFileMapping(FILE_MAP_READ, FALSE, mapFile.c_str());

if(fileMap == NULL)
{
    wcout << "Failed to connect to pipe" << endl;
    system("pause");
    return 1;
}

wcout << "map opened."<< endl;
wcout << "reading file map" << endl;
LPCTSTR pBuf = (LPTSTR)MapViewOfFile(fileMap,
    FILE_MAP_READ,
    0,
    0,
    0);

if(pBuf == NULL)
{
    wcout << "failed to read file map" << endl;
    CloseHandle(fileMap);
    system("pause");
    return 1;
}

wcout << "File map read successfully" << endl;

wcout << "pipe name: " << pBuf << endl;
MessageBox(NULL, pBuf, TEXT("test"),MB_OK);
system("pause");
UnmapViewOfFile(pBuf);
CloseHandle(fileMap);
return 0;
}

which gives the following output

Opening file map..
map opened.
reading file map
File map read successfully
pipe name: ☺
Press any key to continue . . .

It appears that the memory mapped file is there but it doesn’t look like it contains the name of the pipe. I’m new to C++ so I don’t know if I’m doing something wrong or if what I’m trying to do is wrong. Am I reading the file incorrectly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:06:47+00:00Added an answer on June 9, 2026 at 10:06 am

    A quote from the blog post you refer to:

    Inside these memory mapped files you will find the GUID in binary format starting at the 5th character

    You expect that the file is a text one which contains a string.
    In fact, the file is a binary one which contains GUID structure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a following class within a namespace Global namespace Global { public static
I created the following interface: <?php interface Action { public function execute(\requests\Request $request, array
So far I created the following interface: public interface IDirectoryInfoWrapper { public IFileInfoWrapper[] GetFiles(string
I have created the following class implementing a ListSelectionListener interface. This class should listen
I have some code similar to the following: public interface IMyClass { MyEnum Value
I have created the following interface public interface ISolutionSpace { public boolean isFeasible(); public
I created the following annotation: public @interface NavAnnotation { boolean addToAdminMenu() default false; }
Say I have the following service contract and two concrete implementations: [OperationContract] public interface
I created the following method for retrieving stored settings from the database: public String
I have created the following subclass to do some custom drawing: // DocumentIconView.h @interface

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.