Click here to Skip to main content
15,921,884 members
Home / Discussions / C#
   

C#

 
AnswerRe: struct and array? Pin
Guffa28-Dec-08 23:53
Guffa28-Dec-08 23:53 
AnswerRe: struct and array? Pin
Brij29-Dec-08 0:27
mentorBrij29-Dec-08 0:27 
AnswerRe: struct and array? [modified] Pin
Lev Danielyan29-Dec-08 4:35
Lev Danielyan29-Dec-08 4:35 
GeneralRe: struct and array? Pin
Guffa29-Dec-08 10:28
Guffa29-Dec-08 10:28 
GeneralRe: struct and array? Pin
Lev Danielyan29-Dec-08 18:53
Lev Danielyan29-Dec-08 18:53 
GeneralRe: struct and array? Pin
dec8229-Dec-08 19:02
dec8229-Dec-08 19:02 
GeneralRe: struct and array? Pin
Lev Danielyan29-Dec-08 19:06
Lev Danielyan29-Dec-08 19:06 
QuestionRead HTML tags in XML Reader Pin
jhuerta28-Dec-08 22:55
jhuerta28-Dec-08 22:55 
AnswerRe: Read HTML tags in XML Reader Pin
N a v a n e e t h28-Dec-08 23:11
N a v a n e e t h28-Dec-08 23:11 
GeneralRe: Read HTML tags in XML Reader Pin
jhuerta29-Dec-08 3:33
jhuerta29-Dec-08 3:33 
Questionproblem in datagridview Pin
SreejithKumar M28-Dec-08 22:39
SreejithKumar M28-Dec-08 22:39 
AnswerRe: problem in datagridview Pin
rah_sin28-Dec-08 22:47
professionalrah_sin28-Dec-08 22:47 
GeneralRe: problem in datagridview Pin
SreejithKumar M28-Dec-08 22:54
SreejithKumar M28-Dec-08 22:54 
GeneralRe: problem in datagridview Pin
rah_sin28-Dec-08 23:02
professionalrah_sin28-Dec-08 23:02 
GeneralRe: problem in datagridview Pin
SreejithKumar M28-Dec-08 23:07
SreejithKumar M28-Dec-08 23:07 
QuestionHow to send shutdown-restart command with TCP/IP Pin
Member 465172928-Dec-08 22:31
Member 465172928-Dec-08 22:31 
AnswerRe: How to send shutdown-restart command with TCP/IP Pin
Dave Kreskowiak29-Dec-08 1:51
mveDave Kreskowiak29-Dec-08 1:51 
GeneralRe: How to send shutdown-restart command with TCP/IP Pin
Member 465172929-Dec-08 3:43
Member 465172929-Dec-08 3:43 
First of all many thanks for your help.

I changed my code like;

[DllImport("aygshell.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool ExitWindowsEx([MarshalAs(UnmanagedType.U4)]uint dwFlags, [MarshalAs(UnmanagedType.U4)]uint dwReserved);

[DllImport("aygshell.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool ExitWindowsEx([MarshalAs(UnmanagedType.U4)] ExitWindowsAction uFlags, [MarshalAs(UnmanagedType.U4)] uint dwReserved);

enum ExitWindowsAction : uint
{
EWX_LOGOFF = 0,
EWX_SHUTDOWN = 1,
EWX_REBOOT = 2,
EWX_FORCE = 4,
EWX_POWEROFF = 8
}

And I called the method

ExitWindowsEx(ExitWindowsAction.EWX_REBOOT, 0);

firstly I had an error "unable to load DLL" -0X8007007E-

and I found 'aygshell.dll' dll and copied it to C:\Windows\System32\aygshell.dll and also where my exe is.

And secondly I had an another error "An attempt was made to load a program with an incorret format" -0X8007000E-

What can I do, where is the wrong?
GeneralRe: How to send shutdown-restart command with TCP/IP Pin
Dave Kreskowiak29-Dec-08 3:50
mveDave Kreskowiak29-Dec-08 3:50 
GeneralRe: How to send shutdown-restart command with TCP/IP Pin
Member 465172929-Dec-08 4:57
Member 465172929-Dec-08 4:57 
GeneralRe: How to send shutdown-restart command with TCP/IP Pin
Member 465172930-Dec-08 0:39
Member 465172930-Dec-08 0:39 
QuestionRe: How to send shutdown-restart command with TCP/IP Pin
Member 46517292-Jan-09 1:42
Member 46517292-Jan-09 1:42 
AnswerRe: How to send shutdown-restart command with TCP/IP Pin
Member 46517292-Jan-09 2:37
Member 46517292-Jan-09 2:37 
QuestionI have Macros in Excel and I want it to run through my application in .NET Pin
sejal12328-Dec-08 21:45
sejal12328-Dec-08 21:45 
AnswerRe: I have Macros in Excel and I want it to run through my application in .NET Pin
Member 447035429-Dec-08 8:43
Member 447035429-Dec-08 8:43 

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.