Hi,
I am trying to use the WINAPI function: GetColorDirectory which is located in mscms.dll. I have done the DLLImport statement properly and i can get one of the buffers to fill. The spec for this function is:
BOOL WINAPI GetColorDirectory(
PCTSTR pMachineName,
PTSTR pBuffer,
PDWORD pdwSize
);
My code to import it is:
[DllImport("mscms.dll"
]
public static extern bool GetColorDirectory(
string pMachineName,
ref string pBuffer,
ref int pdwSize);
Then i call it using:
int i = 0;
string str = "";
GetColorDirectory (null, ref str, ref i);
What happens is i is filled with an int correctly, but i can never get a result in str.
I know this is simple but i can't see what i'm doing wrong.
Thanks in advance
quilmes
I am trying to use the WINAPI function: GetColorDirectory which is located in mscms.dll. I have done the DLLImport statement properly and i can get one of the buffers to fill. The spec for this function is:
BOOL WINAPI GetColorDirectory(
PCTSTR pMachineName,
PTSTR pBuffer,
PDWORD pdwSize
);
My code to import it is:
[DllImport("mscms.dll"
public static extern bool GetColorDirectory(
string pMachineName,
ref string pBuffer,
ref int pdwSize);
Then i call it using:
int i = 0;
string str = "";
GetColorDirectory (null, ref str, ref i);
What happens is i is filled with an int correctly, but i can never get a result in str.
I know this is simple but i can't see what i'm doing wrong.
Thanks in advance
quilmes