Click here to Skip to main content
15,900,704 members
Home / Discussions / C#
   

C#

 
QuestionThe Server is not operational" when authenticating user to active directory Pin
krishna nimmalapudi17-May-06 7:31
krishna nimmalapudi17-May-06 7:31 
Question[DllImport] questen Pin
QzRz17-May-06 7:26
QzRz17-May-06 7:26 
AnswerRe: [DllImport] questen Pin
Office Lineman17-May-06 8:51
Office Lineman17-May-06 8:51 
AnswerRe: [DllImport] questen Pin
Sean8917-May-06 11:05
Sean8917-May-06 11:05 
GeneralRe: [DllImport] questen Pin
QzRz17-May-06 20:36
QzRz17-May-06 20:36 
Questionwindows title bar Pin
gonzalesman17-May-06 7:11
gonzalesman17-May-06 7:11 
AnswerRe: windows title bar Pin
NaNg1524117-May-06 7:47
NaNg1524117-May-06 7:47 
QuestionC# struct confusion Pin
thrakazog17-May-06 6:13
thrakazog17-May-06 6:13 
I'm trying to use some unmanaged code in my app. Right now i'm getting errors that indicate the struct i'm using is not correct. Below is the unmanaged struct i'm trying to use and following that is my C# implementation of it. Can anyone spot what i'm doing wrong in my struct and suggest how to fix it? Thanks.

Unmanaged version:

typedef struct _FAX_COVERPAGE_INFO {
DWORD SizeOfStruct;
LPCTSTR CoverPageName;
BOOL UseServerCoverPage;
LPCTSTR RecName;
LPCTSTR RecFaxNumber;
LPCTSTR RecCompany;
LPCTSTR RecStreetAddress;
LPCTSTR RecCity;
LPCTSTR RecState;
LPCTSTR RecZip;
LPCTSTR RecCountry;
LPCTSTR RecTitle;
LPCTSTR RecDepartment;
LPCTSTR RecOfficeLocation;
LPCTSTR RecHomePhone;
LPCTSTR RecOfficePhone;
LPCTSTR SdrName;
LPCTSTR SdrFaxNumber;
LPCTSTR SdrCompany;
LPCTSTR SdrAddress;
LPCTSTR SdrTitle;
LPCTSTR SdrDepartment;
LPCTSTR SdrOfficeLocation;
LPCTSTR SdrHomePhone;
LPCTSTR SdrOfficePhone;
LPCTSTR Note;
LPCTSTR Subject;
SYSTEMTIME TimeSent;
DWORD PageCount;
} FAX_COVERPAGE_INFO, *PFAX_COVERPAGE_INFO;

typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME,
*PSYSTEMTIME;


C# version:


[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public class FAX_COVERPAGE_INFO
{
public int SizeOfStruct = 0;
public String CoverPageName=null;
public bool UseServerCoverPage=true;
public String RecName = null;
public String RecFaxNumber = null;
public String RecCompany = null;
public String RecStreetAddress = null;
public String RecCity = null;
public String RecState = null;
public String RecZip = null;
public String RecCountry = null;
public String RecTitle = null;
public String RecDepartment = null;
public String RecOfficeLocation = null;
public String RecHomePhone = null;
public String RecOfficePhone = null;
public String SdrName = null;
public String SdrFaxNumber = null;
public String SdrCompany = null;
public String SdrAddress = null;
public String SdrTitle = null;
public String SdrDepartment = null;
public String SdrOfficeLocation = null;
public String SdrHomePhone = null;
public String SdrOfficePhone = null;
public String Note = null;
public String Subject = null;
public SystemTime TimeSent;
public int PageCount = 0;
}

[StructLayout(LayoutKind.Sequential)]
public class SystemTime
{
public ushort wYear;
public ushort wMonth;
public ushort wDayOfWeek;
public ushort wDay;
public ushort wHour;
public ushort wMinute;
public ushort wSecond;
public ushort wMilliseconds;
}
AnswerRe: C# struct confusion Pin
leppie17-May-06 8:51
leppie17-May-06 8:51 
QuestionCreate windows account (user) Pin
supercali17-May-06 6:11
supercali17-May-06 6:11 
QuestionRead/Write issues asap. Pin
DeepToot17-May-06 6:00
DeepToot17-May-06 6:00 
AnswerRe: Read/Write issues asap. Pin
Guffa17-May-06 8:18
Guffa17-May-06 8:18 
GeneralRe: Read/Write issues asap. Pin
DeepToot18-May-06 2:44
DeepToot18-May-06 2:44 
GeneralRe: Read/Write issues asap. Pin
Guffa18-May-06 7:44
Guffa18-May-06 7:44 
GeneralRe: Read/Write issues asap. Pin
DeepToot18-May-06 7:47
DeepToot18-May-06 7:47 
QuestionExcel.XlDirection problem Pin
StyleGuide17-May-06 5:56
StyleGuide17-May-06 5:56 
QuestionDate And Time Pin
| Muhammad Waqas Butt |17-May-06 5:55
professional| Muhammad Waqas Butt |17-May-06 5:55 
AnswerRe: Date And Time Pin
NaNg1524117-May-06 6:54
NaNg1524117-May-06 6:54 
AnswerRe: Date And Time Pin
NaNg1524118-May-06 2:37
NaNg1524118-May-06 2:37 
QuestionDataGridView - row height bigger than grid's height Pin
Pedro Miguel Pereira17-May-06 5:08
Pedro Miguel Pereira17-May-06 5:08 
Question2.0 gridview Pin
fmardani17-May-06 4:48
fmardani17-May-06 4:48 
QuestionPassing enum as a parameter Pin
dayakar_dn17-May-06 4:43
dayakar_dn17-May-06 4:43 
AnswerRe: Passing enum as a parameter Pin
NaNg1524117-May-06 5:07
NaNg1524117-May-06 5:07 
QuestionToolStripComboBox problem Pin
Wjousts17-May-06 3:47
Wjousts17-May-06 3:47 
QuestionCheckbox control Pin
jackalfb17-May-06 3:31
jackalfb17-May-06 3:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.