Click here to Skip to main content
15,902,189 members
Home / Discussions / C#
   

C#

 
GeneralPassing null Pin
Nnamdi Onyeyiri2-Sep-02 8:09
Nnamdi Onyeyiri2-Sep-02 8:09 
GeneralRe: Passing null Pin
Paul Riley2-Sep-02 8:17
Paul Riley2-Sep-02 8:17 
GeneralRe: Passing null Pin
Nnamdi Onyeyiri2-Sep-02 8:25
Nnamdi Onyeyiri2-Sep-02 8:25 
GeneralRe: Passing null Pin
leppie2-Sep-02 9:17
leppie2-Sep-02 9:17 
GeneralRe: Passing null Pin
Nnamdi Onyeyiri2-Sep-02 9:23
Nnamdi Onyeyiri2-Sep-02 9:23 
GeneralRe: Passing null Pin
leppie2-Sep-02 12:11
leppie2-Sep-02 12:11 
GeneralRe: Passing null Pin
Rickard Andersson202-Sep-02 10:45
Rickard Andersson202-Sep-02 10:45 
GeneralDisplay Mode Pin
Nnamdi Onyeyiri2-Sep-02 2:22
Nnamdi Onyeyiri2-Sep-02 2:22 
have geen trying to get he current displaymode but have been unable, my latest attmpt was to try[^] and convert this articles code, but i had a little difficulty. I found the content of the DEVMODE struct on MSDN and put it into my code. I declare the EnumDisplaySettings like this

[DllImport("User32.dll")]<br />
public static extern bool EnumDisplaySettings(string lpszDeviceName, int iModeNum, DEVMODE lpDevMode);


then use it in code like this:
DEVMODE dm = new DEVMODE();
EnumDisplaySettings(null, -1, dm);
but i get the exception 'object reference not set to an instance of an object' yet clearly, a DEVMODE object has been initiated. Confused | :confused:

any help would be appreciated.

*sudden thought* in the decleration of the DEVMODE struct, on MSDN, a couple of the members where of tpye TCHAR, declared like this.
TCHAR  dmDeviceName[CCHDEVICENAME];<br />
TCHAR  dmFormName[CCHFORMNAME];


i couldnt find what CCHFORMNAME is so i just used the MarshalAs Attribute like this
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)]  
public string  dmDeviceName;
for both, could that be the problem?


Suspicious | :suss: Email: theeclypse@hotmail.com   URL: http://www.onyeyiri.co.uk
Suspicious | :suss: "All programmers are playwrights and all computers are lousy actors."


GeneralRe: Display Mode Pin
leppie2-Sep-02 3:00
leppie2-Sep-02 3:00 
GeneralRe: Display Mode Pin
Nnamdi Onyeyiri2-Sep-02 3:16
Nnamdi Onyeyiri2-Sep-02 3:16 
GeneralRe: Display Mode Pin
leppie2-Sep-02 3:31
leppie2-Sep-02 3:31 
GeneralRe: Display Mode Pin
Nnamdi Onyeyiri2-Sep-02 3:39
Nnamdi Onyeyiri2-Sep-02 3:39 
GeneralRe: Display Mode - SOLUTION :) Pin
leppie2-Sep-02 4:02
leppie2-Sep-02 4:02 
GeneralRe: Display Mode - SOLUTION :) Pin
Nnamdi Onyeyiri2-Sep-02 4:51
Nnamdi Onyeyiri2-Sep-02 4:51 
GeneralRe: Display Mode - SOLUTION :) Pin
leppie2-Sep-02 5:02
leppie2-Sep-02 5:02 
GeneralRe: Display Mode - SOLUTION :) Pin
Paul Riley2-Sep-02 5:57
Paul Riley2-Sep-02 5:57 
GeneralRe: Display Mode - SOLUTION :) Pin
leppie2-Sep-02 6:12
leppie2-Sep-02 6:12 
GeneralRe: Display Mode - SOLUTION :) Pin
Paul Riley2-Sep-02 8:00
Paul Riley2-Sep-02 8:00 
GeneralRe: Display Mode - SOLUTION :) Pin
Paul Ingles2-Sep-02 7:52
Paul Ingles2-Sep-02 7:52 
GeneralRe: Display Mode - SOLUTION :) Pin
James T. Johnson2-Sep-02 9:38
James T. Johnson2-Sep-02 9:38 
GeneralRe: Display Mode - SOLUTION :) Pin
Paul Riley2-Sep-02 9:52
Paul Riley2-Sep-02 9:52 
QuestionArray of strings to old DLL? Pin
EdgarBM1-Sep-02 23:25
EdgarBM1-Sep-02 23:25 
AnswerRe: Array of strings to old DLL? Pin
Stephane Rodriguez.1-Sep-02 23:38
Stephane Rodriguez.1-Sep-02 23:38 
GeneralRe: Array of strings to old DLL? Pin
EdgarBM2-Sep-02 1:14
EdgarBM2-Sep-02 1:14 
GeneralRe: Array of strings to old DLL? Pin
Stephane Rodriguez.2-Sep-02 1:33
Stephane Rodriguez.2-Sep-02 1:33 

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.