473,770 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enum problem

HI

Public Enum WindowStyles As UInteger
WS_OVERLAPPED = 0x00000000
WS_POPUP = 0x80000000
WS_CHILD = 0x40000000
end enum
In the above i get an error at
0x00000000 , 0x80000000 , 0x40000000
message "End of statement expected"

how do i correct them

TIA
Barry
Apr 3 '07
11 6959
Hi
>
This is part of a C# code i am trying to convert to VB.NET

Here is the errornous code, upto 0x0016 is show as error (underlined)
at design-time, rest are ok

<snip/>

ok and here is the corrected code.

-------------------------------------------------------------
Public Enum Msgs
WM_NULL = &H0
WM_CREATE = &H1
WM_DESTROY = &H2
WM_MOVE = &H3
WM_SIZE = &H5
WM_ACTIVATE = &H6
WM_SETFOCUS = &H7
WM_KILLFOCUS = &H8
WM_ENABLE = &HA
WM_SETREDRAW = &HB
WM_SETTEXT = &HC
WM_GETTEXT = &HD
WM_GETTEXTLENGT H = &HE
WM_PAINT = &HF
WM_CLOSE = &H10
WM_QUERYENDSESS ION = &H11
WM_QUIT = &H12
WM_QUERYOPEN = &H13
WM_ERASEBKGND = &H14
WM_SYSCOLORCHAN GE = &H15
WM_ENDSESSION = &H16
WM_SHOWWINDOW = &H18
WM_WININICHANGE = &H1A
WM_SETTINGCHANG E = &H1A
WM_DEVMODECHANG E = &H1B
WM_ACTIVATEAPP = &H1C
WM_FONTCHANGE = &H1D
WM_TIMECHANGE = &H1E
WM_CANCELMODE = &H1F
WM_SETCURSOR = &H20
WM_MOUSEACTIVAT E = &H21
WM_CHILDACTIVAT E = &H22
WM_QUEUESYNC = &H23
WM_GETMINMAXINF O = &H24
WM_PAINTICON = &H26
WM_ICONERASEBKG ND = &H27
WM_NEXTDLGCTL = &H28
WM_SPOOLERSTATU S = &H2A
WM_DRAWITEM = &H2B
WM_MEASUREITEM = &H2C
WM_DELETEITEM = &H2D
WM_VKEYTOITEM = &H2E
WM_CHARTOITEM = &H2F
WM_SETFONT = &H30
WM_GETFONT = &H31
WM_SETHOTKEY = &H32
WM_GETHOTKEY = &H33
WM_QUERYDRAGICO N = &H37
WM_COMPAREITEM = &H39
WM_GETOBJECT = &H3D
WM_COMPACTING = &H41
WM_COMMNOTIFY = &H44
WM_WINDOWPOSCHA NGING = &H46
WM_WINDOWPOSCHA NGED = &H47
WM_POWER = &H48
WM_COPYDATA = &H4A
WM_CANCELJOURNA L = &H4B
WM_NOTIFY = &H4E
WM_INPUTLANGCHA NGEREQUEST = &H50
WM_INPUTLANGCHA NGE = &H51
WM_TCARD = &H52
WM_HELP = &H53
WM_USERCHANGED = &H54
WM_NOTIFYFORMAT = &H55
WM_CONTEXTMENU = &H7B
WM_STYLECHANGIN G = &H7C
WM_STYLECHANGED = &H7D
WM_DISPLAYCHANG E = &H7E
WM_GETICON = &H7F
WM_SETICON = &H80
WM_NCCREATE = &H81
WM_NCDESTROY = &H82
WM_NCCALCSIZE = &H83
WM_NCHITTEST = &H84
WM_NCPAINT = &H85
WM_NCACTIVATE = &H86
WM_GETDLGCODE = &H87
WM_SYNCPAINT = &H88
WM_NCMOUSEMOVE = &HA0
WM_NCLBUTTONDOW N = &HA1
WM_NCLBUTTONUP = &HA2
WM_NCLBUTTONDBL CLK = &HA3
WM_NCRBUTTONDOW N = &HA4
WM_NCRBUTTONUP = &HA5
WM_NCRBUTTONDBL CLK = &HA6
WM_NCMBUTTONDOW N = &HA7
WM_NCMBUTTONUP = &HA8
WM_NCMBUTTONDBL CLK = &HA9
WM_KEYDOWN = &H100
WM_KEYUP = &H101
WM_CHAR = &H102
WM_DEADCHAR = &H103
WM_SYSKEYDOWN = &H104
WM_SYSKEYUP = &H105
WM_SYSCHAR = &H106
WM_SYSDEADCHAR = &H107
WM_KEYLAST = &H108
WM_IME_STARTCOM POSITION = &H10D
WM_IME_ENDCOMPO SITION = &H10E
WM_IME_COMPOSIT ION = &H10F
WM_IME_KEYLAST = &H10F
WM_INITDIALOG = &H110
WM_COMMAND = &H111
WM_SYSCOMMAND = &H112
WM_TIMER = &H113
WM_HSCROLL = &H114
WM_VSCROLL = &H115
WM_INITMENU = &H116
WM_INITMENUPOPU P = &H117
WM_MENUSELECT = &H11F
WM_MENUCHAR = &H120
WM_ENTERIDLE = &H121
WM_MENURBUTTONU P = &H122
WM_MENUDRAG = &H123
WM_MENUGETOBJEC T = &H124
WM_UNINITMENUPO PUP = &H125
WM_MENUCOMMAND = &H126
WM_CTLCOLORMSGB OX = &H132
WM_CTLCOLOREDIT = &H133
WM_CTLCOLORLIST BOX = &H134
WM_CTLCOLORBTN = &H135
WM_CTLCOLORDLG = &H136
WM_CTLCOLORSCRO LLBAR = &H137
WM_CTLCOLORSTAT IC = &H138
WM_MOUSEMOVE = &H200
WM_LBUTTONDOWN = &H201
WM_LBUTTONUP = &H202
WM_LBUTTONDBLCL K = &H203
WM_RBUTTONDOWN = &H204
WM_RBUTTONUP = &H205
WM_RBUTTONDBLCL K = &H206
WM_MBUTTONDOWN = &H207
WM_MBUTTONUP = &H208
WM_MBUTTONDBLCL K = &H209
WM_MOUSEWHEEL = &H20A
WM_PARENTNOTIFY = &H210
WM_ENTERMENULOO P = &H211
WM_EXITMENULOOP = &H212
WM_NEXTMENU = &H213
WM_SIZING = &H214
WM_CAPTURECHANG ED = &H215
WM_MOVING = &H216
WM_DEVICECHANGE = &H219
WM_MDICREATE = &H220
WM_MDIDESTROY = &H221
WM_MDIACTIVATE = &H222
WM_MDIRESTORE = &H223
WM_MDINEXT = &H224
WM_MDIMAXIMIZE = &H225
WM_MDITILE = &H226
WM_MDICASCADE = &H227
WM_MDIICONARRAN GE = &H228
WM_MDIGETACTIVE = &H229
WM_MDISETMENU = &H230
WM_ENTERSIZEMOV E = &H231
WM_EXITSIZEMOVE = &H232
WM_DROPFILES = &H233
WM_MDIREFRESHME NU = &H234
WM_IME_SETCONTE XT = &H281
WM_IME_NOTIFY = &H282
WM_IME_CONTROL = &H283
WM_IME_COMPOSIT IONFULL = &H284
WM_IME_SELECT = &H285
WM_IME_CHAR = &H286
WM_IME_REQUEST = &H288
WM_IME_KEYDOWN = &H290
WM_IME_KEYUP = &H291
WM_MOUSEHOVER = &H2A1
WM_MOUSELEAVE = &H2A3
WM_CUT = &H300
WM_COPY = &H301
WM_PASTE = &H302
WM_CLEAR = &H303
WM_UNDO = &H304
WM_RENDERFORMAT = &H305
WM_RENDERALLFOR MATS = &H306
WM_DESTROYCLIPB OARD = &H307
WM_DRAWCLIPBOAR D = &H308
WM_PAINTCLIPBOA RD = &H309
WM_VSCROLLCLIPB OARD = &H30A
WM_SIZECLIPBOAR D = &H30B
WM_ASKCBFORMATN AME = &H30C
WM_CHANGECBCHAI N = &H30D
WM_HSCROLLCLIPB OARD = &H30E
WM_QUERYNEWPALE TTE = &H30F
WM_PALETTEISCHA NGING = &H310
WM_PALETTECHANG ED = &H311
WM_HOTKEY = &H312
WM_PRINT = &H317
WM_PRINTCLIENT = &H318
WM_HANDHELDFIRS T = &H358
WM_HANDHELDLAST = &H35F
WM_AFXFIRST = &H360
WM_AFXLAST = &H37F
WM_PENWINFIRST = &H380
WM_PENWINLAST = &H38F
WM_APP = &H8000
WM_USER = &H400
End Enum
-------------------------------------------------------------

All I have done is to replace '0x' with '&h' as we have indicated.

VB has removed unneeded digits on it's own.

--
Rory
Apr 5 '07 #11
Thanks for your efforts
"Rory Becker" <Ro********@new sgroup.nospamwr ote in message
news:b0******** *************** **@msnews.micro soft.com...
>Hi

This is part of a C# code i am trying to convert to VB.NET

Here is the errornous code, upto 0x0016 is show as error (underlined)
at design-time, rest are ok


<snip/>

ok and here is the corrected code.

-------------------------------------------------------------
Public Enum Msgs
WM_NULL = &H0
WM_CREATE = &H1
WM_DESTROY = &H2
WM_MOVE = &H3
WM_SIZE = &H5
WM_ACTIVATE = &H6
WM_SETFOCUS = &H7
WM_KILLFOCUS = &H8
WM_ENABLE = &HA
WM_SETREDRAW = &HB
WM_SETTEXT = &HC
WM_GETTEXT = &HD
WM_GETTEXTLENGT H = &HE
WM_PAINT = &HF
WM_CLOSE = &H10
WM_QUERYENDSESS ION = &H11
WM_QUIT = &H12
WM_QUERYOPEN = &H13
WM_ERASEBKGND = &H14
WM_SYSCOLORCHAN GE = &H15
WM_ENDSESSION = &H16
WM_SHOWWINDOW = &H18
WM_WININICHANGE = &H1A
WM_SETTINGCHANG E = &H1A
WM_DEVMODECHANG E = &H1B
WM_ACTIVATEAPP = &H1C
WM_FONTCHANGE = &H1D
WM_TIMECHANGE = &H1E
WM_CANCELMODE = &H1F
WM_SETCURSOR = &H20
WM_MOUSEACTIVAT E = &H21
WM_CHILDACTIVAT E = &H22
WM_QUEUESYNC = &H23
WM_GETMINMAXINF O = &H24
WM_PAINTICON = &H26
WM_ICONERASEBKG ND = &H27
WM_NEXTDLGCTL = &H28
WM_SPOOLERSTATU S = &H2A
WM_DRAWITEM = &H2B
WM_MEASUREITEM = &H2C
WM_DELETEITEM = &H2D
WM_VKEYTOITEM = &H2E
WM_CHARTOITEM = &H2F
WM_SETFONT = &H30
WM_GETFONT = &H31
WM_SETHOTKEY = &H32
WM_GETHOTKEY = &H33
WM_QUERYDRAGICO N = &H37
WM_COMPAREITEM = &H39
WM_GETOBJECT = &H3D
WM_COMPACTING = &H41
WM_COMMNOTIFY = &H44
WM_WINDOWPOSCHA NGING = &H46
WM_WINDOWPOSCHA NGED = &H47
WM_POWER = &H48
WM_COPYDATA = &H4A
WM_CANCELJOURNA L = &H4B
WM_NOTIFY = &H4E
WM_INPUTLANGCHA NGEREQUEST = &H50
WM_INPUTLANGCHA NGE = &H51
WM_TCARD = &H52
WM_HELP = &H53
WM_USERCHANGED = &H54
WM_NOTIFYFORMAT = &H55
WM_CONTEXTMENU = &H7B
WM_STYLECHANGIN G = &H7C
WM_STYLECHANGED = &H7D
WM_DISPLAYCHANG E = &H7E
WM_GETICON = &H7F
WM_SETICON = &H80
WM_NCCREATE = &H81
WM_NCDESTROY = &H82
WM_NCCALCSIZE = &H83
WM_NCHITTEST = &H84
WM_NCPAINT = &H85
WM_NCACTIVATE = &H86
WM_GETDLGCODE = &H87
WM_SYNCPAINT = &H88
WM_NCMOUSEMOVE = &HA0
WM_NCLBUTTONDOW N = &HA1
WM_NCLBUTTONUP = &HA2
WM_NCLBUTTONDBL CLK = &HA3
WM_NCRBUTTONDOW N = &HA4
WM_NCRBUTTONUP = &HA5
WM_NCRBUTTONDBL CLK = &HA6
WM_NCMBUTTONDOW N = &HA7
WM_NCMBUTTONUP = &HA8
WM_NCMBUTTONDBL CLK = &HA9
WM_KEYDOWN = &H100
WM_KEYUP = &H101
WM_CHAR = &H102
WM_DEADCHAR = &H103
WM_SYSKEYDOWN = &H104
WM_SYSKEYUP = &H105
WM_SYSCHAR = &H106
WM_SYSDEADCHAR = &H107
WM_KEYLAST = &H108
WM_IME_STARTCOM POSITION = &H10D
WM_IME_ENDCOMPO SITION = &H10E
WM_IME_COMPOSIT ION = &H10F
WM_IME_KEYLAST = &H10F
WM_INITDIALOG = &H110
WM_COMMAND = &H111
WM_SYSCOMMAND = &H112
WM_TIMER = &H113
WM_HSCROLL = &H114
WM_VSCROLL = &H115
WM_INITMENU = &H116
WM_INITMENUPOPU P = &H117
WM_MENUSELECT = &H11F
WM_MENUCHAR = &H120
WM_ENTERIDLE = &H121
WM_MENURBUTTONU P = &H122
WM_MENUDRAG = &H123
WM_MENUGETOBJEC T = &H124
WM_UNINITMENUPO PUP = &H125
WM_MENUCOMMAND = &H126
WM_CTLCOLORMSGB OX = &H132
WM_CTLCOLOREDIT = &H133
WM_CTLCOLORLIST BOX = &H134
WM_CTLCOLORBTN = &H135
WM_CTLCOLORDLG = &H136
WM_CTLCOLORSCRO LLBAR = &H137
WM_CTLCOLORSTAT IC = &H138
WM_MOUSEMOVE = &H200
WM_LBUTTONDOWN = &H201
WM_LBUTTONUP = &H202
WM_LBUTTONDBLCL K = &H203
WM_RBUTTONDOWN = &H204
WM_RBUTTONUP = &H205
WM_RBUTTONDBLCL K = &H206
WM_MBUTTONDOWN = &H207
WM_MBUTTONUP = &H208
WM_MBUTTONDBLCL K = &H209
WM_MOUSEWHEEL = &H20A
WM_PARENTNOTIFY = &H210
WM_ENTERMENULOO P = &H211
WM_EXITMENULOOP = &H212
WM_NEXTMENU = &H213
WM_SIZING = &H214
WM_CAPTURECHANG ED = &H215
WM_MOVING = &H216
WM_DEVICECHANGE = &H219
WM_MDICREATE = &H220
WM_MDIDESTROY = &H221
WM_MDIACTIVATE = &H222
WM_MDIRESTORE = &H223
WM_MDINEXT = &H224
WM_MDIMAXIMIZE = &H225
WM_MDITILE = &H226
WM_MDICASCADE = &H227
WM_MDIICONARRAN GE = &H228
WM_MDIGETACTIVE = &H229
WM_MDISETMENU = &H230
WM_ENTERSIZEMOV E = &H231
WM_EXITSIZEMOVE = &H232
WM_DROPFILES = &H233
WM_MDIREFRESHME NU = &H234
WM_IME_SETCONTE XT = &H281
WM_IME_NOTIFY = &H282
WM_IME_CONTROL = &H283
WM_IME_COMPOSIT IONFULL = &H284
WM_IME_SELECT = &H285
WM_IME_CHAR = &H286
WM_IME_REQUEST = &H288
WM_IME_KEYDOWN = &H290
WM_IME_KEYUP = &H291
WM_MOUSEHOVER = &H2A1
WM_MOUSELEAVE = &H2A3
WM_CUT = &H300
WM_COPY = &H301
WM_PASTE = &H302
WM_CLEAR = &H303
WM_UNDO = &H304
WM_RENDERFORMAT = &H305
WM_RENDERALLFOR MATS = &H306
WM_DESTROYCLIPB OARD = &H307
WM_DRAWCLIPBOAR D = &H308
WM_PAINTCLIPBOA RD = &H309
WM_VSCROLLCLIPB OARD = &H30A
WM_SIZECLIPBOAR D = &H30B
WM_ASKCBFORMATN AME = &H30C
WM_CHANGECBCHAI N = &H30D
WM_HSCROLLCLIPB OARD = &H30E
WM_QUERYNEWPALE TTE = &H30F
WM_PALETTEISCHA NGING = &H310
WM_PALETTECHANG ED = &H311
WM_HOTKEY = &H312
WM_PRINT = &H317
WM_PRINTCLIENT = &H318
WM_HANDHELDFIRS T = &H358
WM_HANDHELDLAST = &H35F
WM_AFXFIRST = &H360
WM_AFXLAST = &H37F
WM_PENWINFIRST = &H380
WM_PENWINLAST = &H38F
WM_APP = &H8000
WM_USER = &H400
End Enum
-------------------------------------------------------------

All I have done is to replace '0x' with '&h' as we have indicated.

VB has removed unneeded digits on it's own.

--
Rory


Apr 6 '07 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
37094
by: Alexander Grigoriev | last post by:
Not quite new version of GCC that I have to use, craps with the following code: enum E; enum E { e }; That is, it doesn't accept forward declaration of enum. C++ standard text doesn't explicitly say about enum's forward declaration, but one example shows it in 18.2.1, clause 4:
0
1745
by: Vaclav Haisman | last post by:
Motivation: I have been working on some project recently that uses lots of enums with disjunctive intervals of values because it is rather convenient way to define series of constants with consecutive values. The problem is that some functions should only accept some of the ranges. To store values of more than one range/enum in variable one has to use int as storage which imho compromises type safety because any function that wants to...
6
796
by: James Brown | last post by:
Hi, I have the following enum declared: enum TOKEN { TOK_ID = 1000, TOK_NUMBER, TOK_STRING, /*lots more here*/ }; What I am trying to do is _also_ represent ASCII values 0-127 as TOKENs (this is why I started the TOKEN enum off at '1000' so I had plenty of space at the
21
4603
by: Andreas Huber | last post by:
Hi there Spending half an hour searching through the archive I haven't found a rationale for the following behavior. using System; // note the missing Flags attribute enum Color {
18
11368
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! I have created an enum list like this: enum myEnum : int { This = 2, That, NewVal = 10, LastItm
13
12392
by: Don | last post by:
How do I get an Enum's type using only the Enum name? e.g. Dim enumType as System.Type Dim enumName as String = "MyEnum" enumType = ???(enumName)
10
23611
by: kar1107 | last post by:
Hi all, Can the compiler chose the type of an enum to be signed or unsigned int? I thought it must be int; looks like it changes based on the assigned values. Below if I don't initialize FOO_STORE to be, say -10, I get a warning about unsigned comparison and I'm seeing an infinite loop. If I do initialize FOO_STORE = -10, I don't see any warnings. No infinite loop.
8
1934
by: tony | last post by:
Hello! I have below a for loop and a switch in the for loop. I have also a enum called colBlowStep with some values. I have also an array called m_columnBlowStep with some strings. All items in the array m_columnBlowStep is string because I have used ToString on each enum item as you can see. I want to use enum in the case statment in the switch. I know I can use string but I rather want to use enum.
13
18152
by: toton | last post by:
Hi, I have some enum (enumeration ) defined in some namespace, not inside class. How to use the enum constant's in some other namespace without using the whole namespace. To say in little detail, the enum is declared as, namespace test{ enum MyEnum{ VALUE1,VALUE2 };
3
12271
by: Cmtk Software | last post by:
I'm trying to define an enum which will be used from unmanaged c++, C++/CLI managed c++ and from C#. I defined the following enum in a VS dll project set to be compiled with the /clr switch: public enum Days { Sunday };
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8929
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.