Option Infer Off help

StewartBW 845 Reputation points
2024-07-16T15:03:40.04+00:00

Hello,

I am getting some errors when Option Infer Off and need to eliminate them, all becuase of data type declaration, since they belong to COM objects I've no idea set them to which data type?

For Hhctrl.ocx:

Dim Const HH_DISPLAY_TOPIC = &H0
Dim Const HH_HELP_FINDER = &H0
Dim Const HH_DISPLAY_TOC = &H1
Dim Const HH_DISPLAY_INDEX = &H2
Dim Const HH_DISPLAY_SEARCH = &H3
Dim Const HH_SET_WIN_TYPE = &H4
Dim Const HH_GET_WIN_TYPE = &H5
Dim Const HH_GET_WIN_HANDLE = &H6
Dim Const HH_ENUM_INFO_TYPE = &H7
Dim Const HH_SET_INFO_TYPE = &H8
Dim Const HH_SYNC = &H9
Dim Const HH_RESERVED1 = &HA
Dim Const HH_RESERVED2 = &HB
Dim Const HH_RESERVED3 = &HC
Dim Const HH_KEYWORD_LOOKUP = &HD
Dim Const HH_DISPLAY_TEXT_POPUP = &HE
Dim Const HH_HELP_CONTEXT = &HF
Dim Const HH_TP_HELP_CONTEXTMENU = &H10
Dim Const HH_TP_HELP_WM_HELP = &H11
Dim Const HH_CLOSE_ALL = &H12
Dim Const HH_ALINK_LOOKUP = &H13
Dim Const HH_GET_LAST_ERROR = &H14
Dim Const HH_ENUM_CATEGORY = &H15
Dim Const HH_ENUM_CATEGORY_IT = &H16
Dim Const HH_RESET_IT_FILTER = &H17
Dim Const HH_SET_INCLUSIVE_FILTER = &H18
Dim Const HH_SET_EXCLUSIVE_FILTER = &H19
Dim Const HH_INITIALIZE = &H1C
Dim Const HH_UNINITIALIZE = &H1D
Dim Const HH_SET_QUERYSERVICE = &H1E
Dim Const HH_PRETRANSLATEMESSAGE = &HFD
Dim Const HH_SET_GLOBAL_PROPERTY = &HFC
Dim Const HH_SAFE_DISPLAY_TOPIC = &H20
And Advapi32.dll:

Dim Const SERVICE_BOOT_START = &H0
Dim Const SERVICE_SYSTEM_START = &H1
Dim Const SERVICE_AUTO_START = &H2
Dim Const SERVICE_DEMAND_START = &H3
Dim Const SERVICE_DISABLED = &H4

Anyone can help please? :)

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,659 questions
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 28,946 Reputation points Microsoft Vendor
    2024-07-17T03:03:39.1633333+00:00

    Hi @StewartBW ,

    Hexadecimal values are typically represented as integers in VB.NET.

    For the constants provided, the data type should be explicitly declared as Integer.

    Option Infer Off
    
    Const HH_DISPLAY_TOPIC As Integer = &H0
    Const HH_HELP_FINDER As Integer = &H0
    Const HH_DISPLAY_TOC As Integer = &H1
    ...
    
    

    Best Regards.

    Jiachen Li


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    You found this answer helpful.

0 additional answers

Sort by: Most helpful