Click here to Skip to main content
15,919,358 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: VB6 & VS.NET Pin
Dave Kreskowiak24-Feb-04 19:17
mveDave Kreskowiak24-Feb-04 19:17 
GeneralRe: VB6 & VS.NET Pin
cnurse24-Feb-04 19:22
cnurse24-Feb-04 19:22 
GeneralFileSystemWatcher event handler Pin
WESHILL24-Feb-04 12:09
WESHILL24-Feb-04 12:09 
GeneralRe: FileSystemWatcher event handler Pin
John Kuhn24-Feb-04 14:25
John Kuhn24-Feb-04 14:25 
GeneralUrgent: WSDL problem with SAP R/3 Pin
Orkun GEDiK24-Feb-04 8:42
Orkun GEDiK24-Feb-04 8:42 
QuestionHow to retrieve network Drives/All Computers in Network Pin
Tasnim24-Feb-04 1:04
Tasnim24-Feb-04 1:04 
AnswerRe: How to retrieve network Drives/All Computers in Network Pin
John Kuhn24-Feb-04 14:33
John Kuhn24-Feb-04 14:33 
GeneralReportEvent fails Pin
alex120523-Feb-04 23:36
alex120523-Feb-04 23:36 
I was trying to write data in the event log. I found these lines of code somewhere:

Dim bRC As Boolean
Dim iNumStrings As Integer
Dim hEventLog As Long
Dim hMsgs As Long
Dim cbStringSize As Long
Dim iEventID As Integer
Dim sMessage As String
Dim sSource As String

sSource = "ErrLog"
sMessage = "Success Message"

hEventLog = RegisterEventSource("", sSource)

cbStringSize = Len(sMessage) + 1
hMsgs = GlobalAlloc(&H40, cbStringSize)
CopyMemory ByVal hMsgs, ByVal sMessage, cbStringSize
iNumStrings = 1

If ReportEvent(hEventLog, _
EVENTLOG_SUCCESS, 0, _
EBALOG_SUCCESS, 0&, _
iNumStrings, cbStringSize, _
hMsgs, hMsgs) = 0 Then
MsgBox "FAILED"
Else
'-- Sucessful
MsgBox "Success"
End If

Call GlobalFree(hMsgs)
DeregisterEventSource (hEventLog)

But it doesn't work, The function always returns 0. And it doesn't write anything on the log.

please help.

SDE
GeneralRe: ReportEvent fails Pin
Dave Kreskowiak24-Feb-04 5:20
mveDave Kreskowiak24-Feb-04 5:20 
GeneralCrystalViewer Formula Field in VB.net Pin
Tasnim23-Feb-04 22:31
Tasnim23-Feb-04 22:31 
GeneralRe: CrystalViewer Formula Field in VB.net Pin
John Kuhn24-Feb-04 15:00
John Kuhn24-Feb-04 15:00 
GeneralBut I am not using Report Document Pin
Tasnim24-Feb-04 19:52
Tasnim24-Feb-04 19:52 
GeneralRe: But I am not using Report Document Pin
Dave Kreskowiak25-Feb-04 6:39
mveDave Kreskowiak25-Feb-04 6:39 
GeneralRe: But I am not using Report Document Pin
John Kuhn25-Feb-04 10:10
John Kuhn25-Feb-04 10:10 
GeneralHelp me please... Pin
badaikeramat23-Feb-04 21:29
badaikeramat23-Feb-04 21:29 
GeneralRe: Help me please... Pin
Dave Kreskowiak24-Feb-04 6:13
mveDave Kreskowiak24-Feb-04 6:13 
GeneralSet Printer Stapling Pin
Edbert P23-Feb-04 19:39
Edbert P23-Feb-04 19:39 
GeneralRe: Set Printer Stapling Pin
Dave Kreskowiak24-Feb-04 5:48
mveDave Kreskowiak24-Feb-04 5:48 
GeneralRe: Set Printer Stapling Pin
Edbert P24-Feb-04 10:59
Edbert P24-Feb-04 10:59 
QuestionEmail "To" functionality - how to do? Pin
Malcolm Green23-Feb-04 19:19
Malcolm Green23-Feb-04 19:19 
AnswerRe: Email "To" functionality - how to do? Pin
Dave Kreskowiak24-Feb-04 5:50
mveDave Kreskowiak24-Feb-04 5:50 
QuestionHow to make the form moveable? Pin
younghand23-Feb-04 16:23
younghand23-Feb-04 16:23 
AnswerRe: How to make the form moveable? Pin
Dave Kreskowiak23-Feb-04 18:15
mveDave Kreskowiak23-Feb-04 18:15 
QuestionHow to use CallByName function in VB.NET Pin
bqdieu23-Feb-04 16:16
bqdieu23-Feb-04 16:16 
AnswerRe: How to use CallByName function in VB.NET Pin
Dave Kreskowiak23-Feb-04 17:59
mveDave Kreskowiak23-Feb-04 17:59 

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.