[DllImport("winfax.dll", SetLastError = true, EntryPoint = "FaxCompleteJobParamsW")]
static extern bool FaxCompleteJobParams (out IntPtr JobParams, out IntPtr CoverpageInfo);
//If you use FAX_JOB_PARAM and FAX_COVERPAGE_INFO as a CLASS !
[DllImport("winfax.dll", SetLastError = true, EntryPoint = "FaxCompleteJobParamsW")]
static extern bool FaxCompleteJobParams (out FAX_JOB_PARAM JobParams, out FAX_COVERPAGE_INFO CoverpageInfo);
Declare Function FaxCompleteJobParams Lib "winfax.dll" (TODO) As TODO
None.
Be careful ! Don't miss the EntryPoint attribute, beacause string in structures will be in bad format (ANSI).
Use Marshal.GetLastWin32Error() function to get the last error if the function return false.
I advice you that you declare FAX_JOB_PARAM and FAX_COVERPAGE_INFO as a CLASS !
//Use this sample code with FAX_JOB_PARAM and FAX_COVERPAGE_INFO as a CLASS !
FAX_JOB_PARAM job;
FAX_COVERPAGE_INFO cover;
if (FaxCompleteJobParams(out job, out cover) == true))
{
//You can now use, job and cover classes...
}
IntPtr pJob;
IntPtr pCover;
if (FaxCompleteJobParams(out pJob, out pCover) == true))
{
FAX_JOB_PARAM job;
FAX_COVERPAGE_INFO cover;
job = (FAX_JOB_PARAM)Marshal.PtrToStructure(pJob, typeof(FAX_JOB_PARAM));
cover = (FAX_COVERPAGE_INFO)Marshal.PtrToStructure(pCover, typeof(FAX_COVERPAGE_INFO));
//You can now use, job and cover structures...
}
Gilles TOURREAU (French)
gilles.tourreau@microgil.com
03-10-2006 : (By Gilles TOURREAU)
- Add function syntax with using classes
- Add 2 samples
- Add notes and tips
Do you know one? Please contribute it!