Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 20:44

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[C++/Vb.net] Pipes

Discussion on [C++/Vb.net] Pipes within the General Coding forum part of the Coders Den category.

Closed Thread
 
Old   #1



 
Shawak's Avatar
 
elite*gold: 0
The Black Market: 259/0/0
Join Date: Apr 2010
Posts: 10,289
Received Thanks: 3,613
[C++/Vb.net] Pipes

Hallo ich versuche eine Pipe Verbindung zwischen c++ und vb.net herzustellen, aber leider bekomme ich keine verbindung, hier der code:

c++ client
Code:
#include <windows.h>
#include <stdio.h>
#include <iostream>

using namespace std;

LPCWSTR GetPipeName()
{
    return L"\\\\.\\pipe\\Log";
}

string message = "Version: 1.0.0.0";

int main()
{
 while (true)
 {
  HANDLE pipe = CreateNamedPipe(GetPipeName(), PIPE_ACCESS_INBOUND | PIPE_ACCESS_OUTBOUND , PIPE_WAIT, 1, 1024, 1024, 120 * 1000, NULL);

  if (pipe == INVALID_HANDLE_VALUE)
  {
   cout << "Error: " << GetLastError();
  }

  char data[100];
  DWORD numRead;

  ConnectNamedPipe(pipe, NULL);

  ReadFile(pipe, data, 100, &numRead, NULL);

  if (numRead > 0)
  {
   cout << data << endl;
  } 

  CloseHandle(pipe);
 }

}

vb.net server
Code:
    Private Sub startServer()
        pipestop = False

        Dim server As IO.Pipes.NamedPipeServerStream = New IO.Pipes.NamedPipeServerStream("\\.\pipe\Log", IO.Pipes.PipeDirection.InOut)
        server.WaitForConnection()

        Dim writer As New IO.StreamWriter(server)
        writer.AutoFlush = True
        Do Until pipestop
            writer.WriteLine("test")
            Application.DoEvents()
        Loop


    End Sub
Wäre demjenigen der mir weiterhilft sehr dankbar.

mfG,
Shawak

Edit:

Kann geschlossen werde hat sich erledigt.

Für alle die wissen wollen wiel:

Code:
    Private Sub startClient()

        Dim client As IO.Pipes.NamedPipeClientStream = New IO.Pipes.NamedPipeClientStream(".", "Test", IO.Pipes.PipeDirection.Out)
        client.Connect()

        Dim writer As New IO.StreamWriter(client)
        writer.AutoFlush = True
        writer.WriteLine("Test Message")
        writer.Close()

    End Sub
Kann geschlossen werde hat sich erledigt.

Für alle die wissen wollen wiel:

Code:
    Private Sub startClient()

        Dim client As IO.Pipes.NamedPipeClientStream = New IO.Pipes.NamedPipeClientStream(".", "Test", IO.Pipes.PipeDirection.Out)
        client.Connect()

        Dim writer As New IO.StreamWriter(client)
        writer.AutoFlush = True
        writer.WriteLine("Test Message")
        writer.Close()

    End Sub
Shawak is offline  
Closed Thread


Similar Threads Similar Threads
Minecraft Modserver: Rp, BC, IC2, Forestry, Computercraft, teleport pipes
06/02/2012 - Minecraft Server Advertising - 4 Replies
Hallo zusammen, ich würde euch gerne meinen kleinen Modserver vorstellen wie schon in der Überschrift sind ne menge Mods drauf und wenn jemand für diese Mods noch addons Vorschlagen würd guck ich sie mir auch gern an :). Im Moment sind es nur 4 Slots aber wenn sich mehr leute finden erhöhe Ich. Es ist ein Vanilla Server mit den Aktuellsten Versionen des jeweiligen Mods und no-White list). Regeln gibt es eigentlich kaum. Gegrieft wird natürlich nicht. Also wenn jemand lust hatt zu kommen...
[C++] Interprozesskommunikation: Windows Pipes
04/10/2012 - Coding Tutorials - 4 Replies
Abend liebe Community, Ich habe hier ein sehr interessantes Thema für euch: Kommunikation zwischen zwei Prozessen auf dem selben Computer. Das heißt, wie können zwei Programme, die auf einem System laufen, Daten untereinander austauschen? Dazu gibt es erstmal mehrere Möglichkeiten und ich habe mir da jetzt mal die Pipes rausgepickt. Die Frage, was ein Pipe ist, lasse ich mal durch Wikipedia klären. Dazu bitte HIER mal nachschauen. Um für euch den Umgang mit den Pipes einfach zu gestalten...
Get into Mana Pipes
05/11/2007 - WoW Exploits, Hacks, Tools & Macros - 6 Replies
Heya lovely people of xxxxx I was looking a bit around, and noticed quite a few bugs/exploits concentrates around the "Auto-Unstuck" feature. So I thought " wonder if you can get int othe mana pipes in Netherstorm", and I did get into them :P 1. Simply, just drop down infront of one. http://images7.pictiger.com/images/39/142e...5f34 f223039.jpg 2. Use the Auto-Unstuck feature, found under GM help issues (Subject: "Stuck")



All times are GMT +1. The time now is 20:44.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.