Skip to content

Instantly share code, notes, and snippets.

@xxdoc
xxdoc / mdExcel.bas
Created December 10, 2016 10:21 — forked from wqweto/mdExcel.bas
Write to Excel using ADO
Option Explicit
Public Function WriteToExcel( _
rsSrc As Recordset, _
sFileName As String, _
Optional Workbook As String) As Recordset
Const FUNC_NAME As String = "WriteToExcel"
Dim cn As ADODB.Connection
Dim sSQL As String
Dim oFld As ADODB.Field
@xxdoc
xxdoc / mdMain.bas
Created December 10, 2016 10:30 — forked from wqweto/mdMain.bas
VB6 surrogate linker
Attribute VB_Name = "mdMain"
Option Explicit
'=========================================================================
' API
'=========================================================================
Private Const INVALID_FILE_ATTRIBUTES As Long = -1
Private Declare Function GetFileAttributes Lib "kernel32" Alias "GetFileAttributesA" (ByVal lpFileName As String) As Long
@xxdoc
xxdoc / Module1.bas
Created December 10, 2016 10:31 — forked from wqweto/Module1.bas
[VB6] How to get friendly name, bus reported device description or "location information" for HID devices
Attribute VB_Name = "Module1"
Option Explicit
'--- for GetRawInputDeviceInfo
Private Const RIDI_DEVICENAME As Long = &H20000007
Private Const RIM_TYPEKEYBOARD As Long = 1
'--- for setupapi
Private Const DIGCF_PRESENT As Long = &H2
Private Const DIGCF_ALLCLASSES As Long = &H4
Private Const DIGCF_PROFILE As Long = &H8
@xxdoc
xxdoc / mdJson.bas
Created December 10, 2016 10:33 — forked from wqweto/mdJson.bas
JSON parsing and dumping functions in VB6
Option Explicit
DefObj A-Z
Private Const MODULE_NAME As String = "mdJson"
'=========================================================================
' API
'=========================================================================
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
@xxdoc
xxdoc / gist:b195ecac7c93797c11839a0addcae254
Created December 10, 2016 10:33 — forked from wqweto/gist:7952402
Scripting.Dictionary supports For Each enumeration through IEnumVARIANT on DISPID_NEWENUM, not by using Variant array default property.
Option Explicit
Private Const LOCALE_SYSTEM_DEFAULT As Long = &H800
Private Const S_OK As Long = 0
Private Type DISPPARAMS
rgPointerToVariantArray As Long
rgPointerToLongNamedArgs As Long
cArgs As Long
cNamedArgs As Long
@xxdoc
xxdoc / cWebBrowserExtension
Created December 10, 2016 10:34 — forked from wqweto/cWebBrowserExtension
VB6 impl of IDocHostUIHandler for WebBrowser site
Option Explicit
DefObj A-Z
Private Const STR_MODULE_NAME As String = "cWebBrowserExtension"
...
Private WithEvents m_oCtl As DirectWebBrowser
Private WithEvents m_oCtlExt As VBControlExtender
Private m_uHook As UcsDocHostHookData
Private m_oExternal As Object
@xxdoc
xxdoc / BbCode2Rtf.bas
Created December 10, 2016 10:42 — forked from wqweto/BbCode2Rtf.bas
Convert BBCode to RTF
Option Explicit
'
' BbCodes supported:
' b, i, u
' size={FontSize}
' color={ColorNameOrValue}
' font={FontName}
' table={Col1_Width},{Col2_Width}, ...[;[TableLeftOffset],[ColumnLeftOffset]]
' row={Col1_BackColor},{Col2_BackColor}, ...;<<col1_border>>;<<col2_border>>;...]
' <<colN_border>>:=[BorderLeftColor] [BorderLeftWidth],[BorderTopColor] [BorderTopWidth],[BorderRightColor] [BorderRightWidth],[BorderBottomColor] [BorderBottomWidth]
@xxdoc
xxdoc / cVbzlib.cls
Created June 14, 2017 05:16 — forked from wqweto/cVbzlib.cls
VB6 Deflate/Inflate with thunks
Option Explicit
'=========================================================================
' Thunk data
'=========================================================================
' Auto-generated on 29.3.2017 17:59:42, CodeSize=6048, DataSize=987, ALIGN_SIZE=16
Private Const STR_THUNK1 As String = _
"Vot0JAho/I8DAIsG/1AYi9CF0nUCXsOJVgSNSgK+AIAAAIPI/2aJQQJmiQFmiUH+g8EGTnXvV426BIADALn7AwAA86tmq1/HggCAAwAAAAAAx4L4jwMAAAAAALgBAAAAXsOQkJCQkJCQkJCQkJCQkItEJASLiACAAwCNDEmNFEhmi0xIAmaD+f90Dg+/yY0USWbHBFD//+sXZotSBGaD+v90DQ+/ymbHhEgEgAMA//+LiACAAwBXjRRJi0wkEGaJTFAEi5AAgAMAjRRSZsdEUAL//4uQAIADAGaLvEgEgAMAjRRSZok8UIuQAIADAGaLuACAAwCNFFIPvxRQZom8SASAAwCD+v9fdA+NDFJmi5AAgAMAZolUSAKLiACAAwCKVCQIiJQIAAADAIuIAIADAEGB4f9/AACJiACAAwDDkJCB7CgBAACLhCQsAQAAU1VWV4t4BIsAM/aLj/iPAwCJRCQ0hckPjv8AAACNh/KPAwCJRCQQi5wkRAEAAIvRK9YD" & _
"04P6Aw+MtgAAAIvejUQkKDPSK9iJXCQUjUQUKAPDO8F9C4tsJBAzwIoEKusWi6wkQAEAAIvaK9kD3jPAigQri1wkFIhEFChCg/oDfMuLTCQpi1wkKIHh/wAAAIvBweAFA8HB4AMrwYtMJCqB4f8AAACNFEmNFJKNFNLR4ivRi8uB4f8AAAADwovRweIIA9G59
Option Explicit
Private Declare Function WindowFromAccessibleObject Lib "oleacc.dll" ( _
ByVal IAcessible As Object, _
ByRef hwnd As LongPtr _
) As Long
Private Declare _
Function SetWindowLongW Lib "user32.dll" ( _
ByVal hwnd As LongPtr, _
@xxdoc
xxdoc / email.vb
Created January 24, 2018 08:31 — forked from rwjblue/email.vb
Generate and Send an Email with CDO from VB6
' From http://www.vbknowledgebase.com/?Id=21&Desc=Send-Email(E-Mail)-from-VB6-using-CDO
'****************************************************************
'* Purpose : To Send eMail
'*
'* Inputs : strRecipient(String) Recipient comma seperated
'* strSubject(String) Subject
'* strBody Body
'* colAttachments Collection of attachments
'* file paths.