Click here to Skip to main content
15,922,696 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: select case Pin
nlarson1116-Nov-06 3:57
nlarson1116-Nov-06 3:57 
AnswerRe: select case [modified] Pin
Yona Low16-Nov-06 4:17
Yona Low16-Nov-06 4:17 
GeneralRe: select case Pin
nlarson1116-Nov-06 4:34
nlarson1116-Nov-06 4:34 
GeneralRe: select case Pin
Yona Low16-Nov-06 4:44
Yona Low16-Nov-06 4:44 
Questionhow to logoff using Windows Service Pin
BSRK16-Nov-06 1:39
BSRK16-Nov-06 1:39 
AnswerRe: how to logoff using Windows Service Pin
Dave Sexton16-Nov-06 3:16
Dave Sexton16-Nov-06 3:16 
AnswerRe: how to logoff using Windows Service Pin
Dave Sexton16-Nov-06 3:43
Dave Sexton16-Nov-06 3:43 
GeneralRe: how to logoff using Windows Service Pin
Dave Kreskowiak16-Nov-06 4:15
mveDave Kreskowiak16-Nov-06 4:15 
You've unbalanced the stack because your using the wrong data types for the parameters and return values. I'll make an educated guess and say that you lifted some VB6 code and tried to use it under VB.NET without any modification.

Under VB6, the Long type is a 32-bit signed integer, while under VB.NET, the Long type is a 64-bit signed integer. This is why the stack is unbalanced. If you're going to use VB6 code, you have to change all the Long's to Integers under VB.NET:
Public Const EWX_LOGOFF As Integer = &H0
Public Const EWX_POWEROFF As Integer = &H8
Public Const EWX_REBOOT As Integer = &H2
Public Const EWX_RESTARTAPPS As Integer = &H40
Public Const EWX_SHUTDOWN As Integer = &H1
 
Public Const EWX_FORCE As Integer = &H4
Public Const EWX_FORCEIFHUNG As Integer = &H10
 
Declare Function ExitWindowsEx Lib "user32" _
    (ByVal uFlags As Integer, ByVal dwReserved As Integer) As Integer

Oh! You also don't need the 'Alias' clause if the name you gave the function matches the name in the library.




Dave Kreskowiak
Microsoft MVP - Visual Basic


GeneralRe: how to logoff using Windows Service Pin
Yona Low16-Nov-06 4:21
Yona Low16-Nov-06 4:21 
GeneralRe: how to logoff using Windows Service Pin
Dave Sexton16-Nov-06 19:34
Dave Sexton16-Nov-06 19:34 
GeneralThanks to kulazfuk and Dave Pin
BSRK17-Nov-06 18:41
BSRK17-Nov-06 18:41 
QuestionShared Memory Pin
PlescaSorin16-Nov-06 0:52
PlescaSorin16-Nov-06 0:52 
AnswerRe: Shared Memory Pin
nlarson1116-Nov-06 4:01
nlarson1116-Nov-06 4:01 
AnswerRe: Shared Memory Pin
Dave Kreskowiak16-Nov-06 6:15
mveDave Kreskowiak16-Nov-06 6:15 
QuestionWhats the meaning of 2 declarations. Pin
ashwath197915-Nov-06 23:05
ashwath197915-Nov-06 23:05 
AnswerRe: Whats the meaning of 2 declarations. Pin
The ANZAC15-Nov-06 23:06
The ANZAC15-Nov-06 23:06 
AnswerRe: Whats the meaning of 2 declarations. Pin
Dave Kreskowiak16-Nov-06 4:03
mveDave Kreskowiak16-Nov-06 4:03 
GeneralRe: Whats the meaning of 2 declarations. Pin
ashwath197916-Nov-06 19:16
ashwath197916-Nov-06 19:16 
QuestionHow can i replace all apostrophes on DataSet? Pin
murat_turhan15-Nov-06 23:01
murat_turhan15-Nov-06 23:01 
AnswerRe: How can i replace all apostrophes on DataSet? Pin
_mubashir16-Nov-06 0:27
_mubashir16-Nov-06 0:27 
GeneralRe: How can i replace all apostrophes on DataSet? Pin
murat_turhan16-Nov-06 3:22
murat_turhan16-Nov-06 3:22 
QuestionWhats the meaning of below declarations Pin
ashwath197915-Nov-06 22:28
ashwath197915-Nov-06 22:28 
QuestionIs there something wrong with this line...? Pin
penguin500015-Nov-06 21:57
penguin500015-Nov-06 21:57 
AnswerRe: Is there something wrong with this line...? Pin
Christian Graus15-Nov-06 22:06
protectorChristian Graus15-Nov-06 22:06 
QuestionRe: Is there something wrong with this line...? Pin
penguin500016-Nov-06 10:33
penguin500016-Nov-06 10: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.