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 6205943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:21:43+00:00 2026-05-24T05:21:43+00:00

I’m using a library where they used paths to define input and output files

  • 0

I’m using a library where they used paths to define input and output files where data gets read from/written to.

App1 writes the input file, App2 reads that input file and creates an output file. Then, App1 reads the output and everyone is happy.

Now, we get the requirement that for the communication between App1 and App2, no files shall be created anymore. Therefore, App1 shall pass a buffer to App2 (a simple char*) along with a pre-allocated output buffer where App2 shall write the results to.

Unfortunately, throughout the library that is used in App2, a FILE* is used to read from/write to.

So, here’s the question: can I achieve – it without rewriting the library used by App2 – (or with minor changes) that I can use the buffers passed from App1 to App2 for information exchange? IMHO this would require that I could create a FILE* from a buffer without having that FILE* on the disk.

I read that for .NET I could use the System.IO.StringReader class, but since I’m using plain C++ and no .NET, I cannot use that stuff.


Extra Bonus:
The caller (i.e. App1) is managed code (C# application), the callee (i.e. App2) is a plain C++ DLL (i.e. App1 calls a function in that DLL).


Edit:
I’d favor answers where the data exchange could happen synchronously in a way that the caller passes buffers to the callee, the callee reads from the input buffer and writes to the output buffer, then the callee terminates and the caller could read the content of the buffers.

  • 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-05-24T05:21:45+00:00Added an answer on May 24, 2026 at 5:21 am

    For IPC you can use pipes, it is easy to make FILE* from winapi HANDLE created for pipe.

    This code will show how:

    HANDLE read_hnd;
    HANDLE write_hnd;
    //make sa (SECURITY_ATTRIBUTES)
    if(!CreatePipe(&read_hnd, &write_hnd, &sa, NULL))
    {
    //error
    }
    int fd = _open_osfhandle((intptr_t)read_hnd, _O_RDONLY|_O_TEXT);
    FILE *pipe_read_file = _fdopen(fd, "rt");
    

    For IPC you should use named pipes, but idea the same.

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

Sidebar

Related Questions

I have thousands of HTML files to process using Groovy/Java and I need to
I am using Paperclip to handle profile photo uploads in my app. They upload
I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

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.