marshal string data from unmanaged to managed

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: zDog (zDog_at_discussions.microsoft.com)
Date: 10/19/04


Date: Tue, 19 Oct 2004 11:49:06 -0700

I found a lot of information on passing data from C# to a C++ dll
What I cannot find is a way to return C++ structs of TCHAR string data back
to the C# managed code!

typedef struct // C++ data that needs to be returned to the caller (C#)
    {
    short snOperParams;
    TCHAR szNFPath[PATH_SIZE];
    TCHAR szSSFile[PATH_SIZE];
    TCHAR szExeFile[PATH_SIZE];
    TCHAR szOpLibIFile[PATH_SIZE];
    TCHAR szOpLibMFile[PATH_SIZE];
    TCHAR szDefaultIFile[PATH_SIZE];
    TCHAR szDefaultMFile[PATH_SIZE];
    TCHAR szMiscFile[PATH_SIZE];
    TCHAR szAuxFile[PATH_SIZE];
    TCHAR szSuffix[PATH_SIZE];
    } files;



Relevant Pages

  • Some DLL problems
    ... How would I go about passing data into a DLL? ... from one of my executables and I would like it to pass information into ... DLL could retrieve information about which process it was loaded into ...
    (microsoft.public.vc.mfc)
  • Re: data passing
    ... I need your professional opinion about this (the project is C++ but it ... doesn't realy matter): ... We handle big structs of data. ... As it turned out, passing data via files proved contagious, for now ...
    (comp.programming)
  • data passing
    ... I need your professional opinion about this (the project is C++ but it ... doesn't realy matter): ... We handle big structs of data. ... As it turned out, passing data via files proved contagious, for now ...
    (comp.programming)