I'm trying to call functions from a proprietary DLL but it's turned out to
be more difficult than I thought.
I have this W32.DLL which was written in C by USPS. They don't provide the
code so I only have the documentation.
I'm trying to call a function called z4date that, according to the docs,
returns the date as "an 8-byte character string in the "YYYYMMDD" format".
When I run it with this code I've written , I get "Can not marshal return
My real concern is that, if I'm having trouble with these functions that
return simple data types, how am I going to interact with functions that
return user-defined data types?
This is what I've written in the class so far:
/// Summary description for AMS.
public class AMS
public static extern int z4open(); //another function from the dll
[DllImport("C:\\zm7\\Developm\\DLL\\W32.DLL")] /* Do I need to use
DllImport for every fiunction I'm using? */
public static extern byte z4date();
public byte getDate()
myDate = new Byte;
myDate = z4date(); //function call where I receive error "Can not
marshal return value"
Any help is appreciated.