1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to pass a pointer through a named pipe

Discussion in 'C++' started by Spogliani, Aug 31, 2008.

  1. Spogliani

    Spogliani New Member

    Joined:
    Jun 24, 2008
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Milano, Italy
    Hi, does anyone can tell me how to pass a pointer to a different process through a named pipe?

    I tried this but the receiver reads 4 0s
    Code:
    [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]* Data = ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]*)&Modules; [COLOR=seagreen]//pointer to a class[/COLOR]
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Size = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]sizeof[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2](Data);
    WriteFile(hPipe, Data, Size, &ReadCount[COLOR=seagreen]/*DWORD*/[/COLOR], NULL);
    
    [/SIZE]
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0

Share This Page