473,804 Members | 3,953 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Incorrect name of named pipe (LPTSTR -> ?)

Hi!

I've piece of code like follow:

<code>

LPTSTR lpszPipename = (LPTSTR) "\\\\.\\pipe\\t estpipe";

hPipe = CreateNamedPipe (

lpszPipename, // pipe name

PIPE_ACCESS_DUP LEX | // read/write access

FILE_FLAG_OVERL APPED,

PIPE_TYPE_MESSA GE | // message type pipe

PIPE_READMODE_M ESSAGE | // message-read mode

PIPE_WAIT, // blocking mode

1, // number of instances (max. instances - PIPE_UNLIMITED_ INSTANCES)

BUFSIZE, // output buffer size

BUFSIZE, // input buffer size

PIPE_TIMEOUT, // client time-out

NULL);

<code>

When I had first line like this:

LPTSTR lpszPipename = "\\\\.\\pipe\\t estpipe";

Compiler show an error:

C2440: 'initializing' : cannot convert from 'const char [18]' to 'LPTSTR'
Types pointed to are unrelated; conversion requires reinterpret_cas t,
C-style cast or function-style cast

so i change it into:
LPTSTR lpszPipename = (LPTSTR) "\\\\.\\pipe\\t estpipe";

Now build process end properly but while i execute application I get an
error 123 "The file name, directory name, or volume label syntax is
incorrect." So, name of named pipe is wrong, I suppose.
That code is part of NT Service application, so I develop it under
Managed/Unmanaged C++. What should I do?

Thanks in advance for any help
Best regards,
Pawe³ Chmielarz
/software engineer/
Nov 17 '05 #1
1 2620
OK. I've managed. "_T" helps.

Best regards,
Pawel.
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
7467
by: Rajarshi Guha | last post by:
Hi, I'm having a little trouble when I read from a named pipe. I create a pipe by os.mkfifo('/tmp/mypipe') and then open it for reading with fin = open('/tmp/mypipe','r+')
5
17426
by: richard | last post by:
I have a simple test to pass information from a client to a server using named pipe. what I really want is: when I type a line on the client, the server will output the line immediately. but to my surprise, I always have to terminate the client to get the server in action, i.e. prints out what I typed. anything I missed? I am compiling using gcc without any option. thanks, ---RICH
0
1553
by: Spiros | last post by:
Hi everybody I am creating an application using VC++ that runs on a terminal server with 30 end users. The end users will use thin clients as front end machines. The application consists of a main menu executeble that opens other executables depending on the user selection. In order to establish that communication I use named pipes. Actually I use 1 named pipe as the main tube for data transfer. What happens is that sometimes the session of...
3
2640
by: EricR | last post by:
I am trying to use .NET to "tap into" a named pipe created by a non .NET 3rd party application. Specifically, the application is a table loading utility. It opens a named pipe and waits for input. Does anybody know how I can write to the named pipe from a .NET program. I have tried using the traditional file access methods, and it appears that pipes have a problem with file streams. I have tried API calls, but since I do not have the...
2
5069
by: FB's .NET Dev PC | last post by:
I am writing two services in VB.NET, one of which needs to send text strings to the other. After reading, I decided (perhaps incorrectly) that named pipes would be the best interprocess communication method for this task. I set about creating, on the pipe's server side, a new thread which would instantiate a blocking inbound message pipe, and the client side which would write to that pipe when needed. Being on the same PC, security is...
0
1218
by: EricR | last post by:
I am trying to use .NET to "tap into" a named pipe created by a non .NET 3rd party application. Specifically, the application is a table loading utility. It opens a named pipe and waits for input. Does anybody know how I can write to the named pipe from a .NET program. I have tried using the traditional file access methods, and it appears that pipes have a problem with file streams. I have tried API calls, but since I do not have the...
0
2916
by: olaf.dietsche | last post by:
Hi, The system is Windows XP and DB2 v8.1.7. I'm trying to load a text file via named pipe into a table. I have two programs: the first program creates the named pipe, waits for a client and writes the text file into the named pipe. the second program is doing the db2Load() call.
3
5030
by: a | last post by:
Hi everybody, Is it possible to open a named pipe from a php script on Windows? More specifically, I have a Windows service that receives commands through a named pipe, and I'd like to open the client end of the pipe directly from php rather than creating an intermediate process. Thanks,
0
1464
by: jeb2000 | last post by:
I am rather new to pipes, but I have two c# programs that are communicating via a named pipe. This is working fine on two of my XP Pro SP2 machines. However, when I port to a third machine (also XP Pro SP2), I cannot connect to my named pipe. Are there any simple permission/access issues that need to be considered with named pipes? The pipe is being accessed locally, so I don't need to access it accross a network. The code for creating my...
0
9582
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10580
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9157
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5652
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3821
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.