2009-09-20

推荐给用G1的朋友

将工作时的日历项自动推送到G1.

Option Explicit

Private WithEvents oCalendarItems As Outlook.Items
Private WithEvents oSentItems As Outlook.Items

Private Sub Application_Startup()
Dim objNS As NameSpace
Set objNS = Application.GetNamespace("MAPI")

'- hook the event to the Calendar folder:
Set oCalendarItems = Session.GetDefaultFolder(olFolderCalendar).Items
'- hook the event to the Sent folder:
Set oSentItems = Session.GetDefaultFolder(olFolderSentMail).Items

Set objNS = Nothing
End Sub

Private Sub oCalendarItems_ItemAdd(ByVal Item As Object)
Dim myolApp As Outlook.Application
Dim oForward As MailItem, strForwardTo As String
Dim newReq As AppointmentItem


'Make sure item is NOT a recurring appointment or provisional
If Item.RecurrenceState = olApptNotRecurring Then
If Item.Subject Like "*provisional*" Or Item.Subject Like "*Provisional*" Or Item.Subject Like "Provisional*" Then
'Do Nothing
Else
'Ensure that the item is an appointment
If TypeName(Item) = "AppointmentItem" Then

Set myolApp = CreateObject("Outlook.Application")
Set newReq = myolApp.CreateItem(olAppointmentItem)


With newReq
.Subject = Item.Subject
.Start = Item.Start
.End = Item.End
.Location = Item.Location
.Body = Item.Body

' make it a meeting request
.MeetingStatus = olMeeting
.RequiredAttendees = "xxxxxxx@gmail.com"
.Send
End With

Set myolApp = Nothing
Set newReq = Nothing
End If
End If

End If
End Sub


' disassociate global objects declared WithEvents
Private Sub Application_Quit()
Set oCalendarItems = Nothing
Set oSentItems = Nothing
End Sub

Failed to load data access DLL, 0x80004005

前一段时间在x86机器上分析一个64位机上取的dump时,遇到以下情况:

0:000> .load sos
0:000> !clrstack
Failed to load data access DLL, 0x80004005
Verify that 1) you have a recent build of the debugger (6.2.14 or
newer)
2) the file mscordacwks.dll that matches your version of
mscorwks.dll is
in the version directory
3) or, if you are debugging a dump file, verify that the
file
mscordacwks___.dll is on your
symbol path.
4) you are debugging on the same architecture as the dump
file.
For example, an IA64 dump file must be debugged on an
IA64
machine.

You can also run the debugger command .cordll to control the
debugger's
load of mscordacwks.dll. .cordll -ve -u -l will do a verbose reload.
If that succeeds, the SOS command should work on retry.

If you are debugging a minidump, you need to make sure that your
executable
path is pointing to mscorwks.dll as well.



Google了好几天,有解, 如下:



1.
.load wow64exts

2.
!sw

3.
.loadby sos mscorwks

4.
这里你可以执行sos里面的命令了。
!clrstack,
!thread,
!dumpheap -stat -type Exception //看异常比较有效
!pe, //看异常比较有效
!dso,
!do,
!GCRoot //分析ManagedHeap内在泄露比较有效。



严重推荐:
http://blogs.msdn.com/alejacma/archive/2009/08/24/managed-debugging-with-windbg-breaking-on-an-exception-part-1.aspx

2009-09-10

野性的呼唤

http://v.youku.com/v_show/id_XMjAxMzI5NDg=.html
看一下电影回味一下书