VBA 64位API声明语句第010讲

B站影视 欧美电影 2025-06-03 18:49 1

摘要:跟我学VBA,我这里专注VBA, 授人以渔。我98年开始,从源码接触VBA已经20余年了,随着年龄的增长,越来越觉得有必要把这项技能传递给需要这项技术的职场人员。希望职场和数据打交道的朋友,都来学习VBA,利用VBA,起码可以提高自己的工作效率,可以有时间多陪

跟我学VBA,我这里专注VBA, 授人以渔。我98年开始,从源码接触VBA已经20余年了,随着年龄的增长,越来越觉得有必要把这项技能传递给需要这项技术的职场人员。希望职场和数据打交道的朋友,都来学习VBA,利用VBA,起码可以提高自己的工作效率,可以有时间多陪陪父母,多陪陪家人,何乐而不为呢?我的教程一共九套,从入门开始一直讲到程序的分发,是学习利用VBA的实用教程。这份API资料是随高级教程赠送的.

这讲我们继续学习VBA 64位API声明语句第010讲,这些内容是MS的权威资料,看似枯燥,但对于想学习API函数的朋友是非常有用的。

【分享成果,随喜正能量】162 修行,不是让你什么都顺,而是让你知道为什么不顺?心里执着的多,磨难就越多,越想得到什么,就会失去什么。修行,不是等待菩萨来救赎,而是需要自渡,去向内求,提升自己的内在认知,修正自己的贪、嗔、痴、慢、疑,圆满自己,利益他人。

当学员学习到高级阶段,如果引用API,这个资料可以直接查到64位写法。大多数情况下我们是将低版本的程序文件升级到高版本,这时您就不必为如下的错误提示所困扰了:

End Type

Type EXIT_THREAD_DEBUG_INFO

dwExitCode As Long

End Type

Type EXIT_PROCESS_DEBUG_INFO

dwExitCode As Long

End Type

Type LOAD_DLL_DEBUG_INFO

hFile As LongPtr

lpBaseOfDll As LongPtr

dwDebugInfoFileOffset As Long

nDebugInfoSize As Long

lpImageName As LongPtr

fUnicode As Integer

End Type

Type UNLOAD_DLL_DEBUG_INFO

End Type

Type OUTPUT_DEBUG_STRING_INFO

lpDebugStringData As String

fUnicode As Integer

nDebugStringLength As Integer

End Type

Type RIP_INFO

dwError As Long

dwType As Long

End Type

' GetDriveType return values

Const DRIVE_REMOVABLE = 2

Const DRIVE_FIXED = 3

Const DRIVE_REMOTE = 4

Const DRIVE_CDROM = 5

Const DRIVE_RAMDISK = 6

Const FILE_TYPE_UNKNOWN = &H0

Const FILE_TYPE_DISK = &H1

Const FILE_TYPE_CHAR = &H2

Const FILE_TYPE_PIPE = &H3

Const FILE_TYPE_REMOTE = &H8000&

Const STD_INPUT_HANDLE = -10&

Const STD_OUTPUT_HANDLE = -11&

Const STD_ERROR_HANDLE = -12&

Const NOPARITY = 0

Const ODDPARITY = 1

Const EVENPARITY = 2

Const MARKPARITY = 3

Const SPACEPARITY = 4

Const ONESTOPBIT = 0

Const ONE5STOPBITS = 1

Const TWOSTOPBITS = 2

Const IGNORE = 0 ' Ignore signal

Const INFINITE = &HFFFFFFFF ' Infinite timeout

' Comm Baud Rate indices

Const CBR_110 = 110

Const CBR_300 = 300

Const CBR_600 = 600

Const CBR_1200 = 1200

Const CBR_2400 = 2400

Const CBR_4800 = 4800

Const CBR_9600 = 9600

Const CBR_14400 = 14400

Const CBR_19200 = 19200

Const CBR_38400 = 38400

Const CBR_56000 = 56000

Const CBR_57600 = 57600

Const CBR_115200 = 115200

Const CBR_128000 = 128000

Const CBR_256000 = 256000

' Error Flags

Const CE_RXOVER = &H1 ' Receive Queue overflow

Const CE_OVERRUN = &H2 ' Receive Overrun Error

Const CE_RXPARITY = &H4 ' Receive Parity Error

Const CE_FRAME = &H8 ' Receive Framing error

Const CE_BREAK = &H10 ' Break Detected

Const CE_TXFULL = &H100 ' TX Queue is full

Const CE_PTO = &H200 ' LPTx Timeout

Const CE_IOE = &H400 ' LPTx I/O Error

Const CE_DNS = &H800 ' LPTx Device not selected

Const CE_OOP = &H1000 ' LPTx Out-Of-Paper

Const CE_MODE = &H8000& ' Requested mode unsupported

Const IE_BADID = (-1) ' Invalid or unsupported id

Const IE_OPEN = (-2) ' Device Already Open

Const IE_NOPEN = (-3) ' Device Not Open

Const IE_MEMORY = (-4) ' Unable to allocate queues

Const IE_DEFAULT = (-5) ' Error in default parameters

Const IE_HARDWARE = (-10) ' Hardware Not Present

Const IE_ByteSIZE = (-11) ' Illegal Byte Size

Const IE_BAUDRATE = (-12) ' Unsupported BaudRate

' Events

Const EV_RXCHAR = &H1 ' Any Character received

Const EV_RXFLAG = &H2 ' Received certain character

Const EV_TXEMPTY = &H4 ' Transmitt Queue Empty

Const EV_CTS = &H8 ' CTS changed state

Const EV_DSR = &H10 ' DSR changed state

Const EV_RLSD = &H20 ' RLSD changed state

Const EV_BREAK = &H40 ' BREAK received

Const EV_ERR = &H80 ' Line status error occurred

Const EV_RING = &H100 ' Ring signal detected

Const EV_PERR = &H200 ' Printer error occured

Const EV_RX80FULL = &H400 ' Receive buffer is 80 percent full

Const EV_EVENT1 = &H800 ' Provider specific event 1

Const EV_EVENT2 = &H1000 ' Provider specific event 2

' Escape functions

Const SETXOFF = 1 ' Simulate XOFF received

Const SETXON = 2 ' Simulate XON received

Const SETRTS = 3 ' Set RTS high

Const CLRRTS = 4 ' Set RTS low

Const SETDTR = 5 ' Set DTR high

Const CLRDTR = 6 ' Set DTR low

Const RESETDEV = 7 ' Reset device if possible

Const SETBREAK = 8 'Set the device break line

Const CLRBREAK = 9 ' Clear the device break line

' PURGE function flags.

Const PURGE_TXABORT = &H1 ' Kill the pending/current writes to the comm port.

Const PURGE_RXABORT = &H2 ' Kill the pending/current reads to the comm port.

Const PURGE_TXCLEAR = &H4 ' Kill the transmit queue if there.

Const PURGE_RXCLEAR = &H8 ' Kill the typeahead buffer if there.

Const LPTx = &H80 ' Set if ID is for LPT device

' Modem Status Flags

Const MS_CTS_ON = &H10&

Const MS_DSR_ON = &H20&

Const MS_RING_ON = &H40&

Const MS_RLSD_ON = &H80&

' WaitSoundState Constants

Const S_QUEUEEMPTY = 0

Const S_THRESHOLD = 1

Const S_ALLTHRESHOLD = 2

' Accent Modes

Const S_NORMAL = 0

Const S_LEGATO = 1

Const S_STACCATO = 2

' SetSoundNoise Sources

Const S_PERIOD512 = 0 ' Freq = N/512 high pitch, less coarse hiss

Const S_PERIOD1024 = 1 ' Freq = N/1024

Const S_PERIOD2048 = 2 ' Freq = N/2048 low pitch, more coarse hiss

Const S_PERIODVOICE = 3 ' Source is frequency from voice channel (3)

Const S_WHITE512 = 4 ' Freq = N/512 high pitch, less coarse hiss

Const S_WHITE1024 = 5 ' Freq = N/1024

Const S_WHITE2048 = 6 ' Freq = N/2048 low pitch, more coarse hiss

Const S_WHITEVOICE = 7 ' Source is frequency from voice channel (3)

Const S_SERDVNA = (-1) ' Device not available

Const S_SEROFM = (-2) ' Out of memory

Const S_SERMACT = (-3) ' Music active

Const S_SERQFUL = (-4) ' Queue full

Const S_SERBDNT = (-5) ' Invalid note

Const S_SERDLN = (-6) ' Invalid note length

Const S_SERDCC = (-7) ' Invalid note count

Const S_SERDTP = (-8) ' Invalid tempo

Const S_SERDVL = (-9) ' Invalid volume

我20多年的VBA实践经验,全部浓缩在下面的各个教程中:

来源:VBA语言专业教育

相关推荐