How to change C++ Const to VB Const

Posted on 2000-03-05
Medium Priority
Last Modified: 2010-05-02
I need to change some C++ constants to VB constants (Which do not appear in the API32.text)

In C++ CCS_Adjustable would be defined as

 #define CCS_ADJUSTABLE   0x00000020L

In VB It would be
 Public Const CCS_Adjustable = &H??????

How do I perform the conversion? I need to do this to many constants
Question by:orbitaltech
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 32

Accepted Solution

Erick37 earned 200 total points
ID: 2585151
Public Const CCS_Adjustable = &H20

I usually do a search and replace:
"#define" to "Const"
"0x" to "= &H"

Then manually remove the trailing "L"

Author Comment

ID: 2585171
That's what i had done. But is that "L" needed? What does it reference?

LVL 32

Expert Comment

ID: 2585223
L means Long in C

If you wish, you could write:
Public Const CCS_Adjustable = &H20&

Which specifies that CCS_Adjustable is a Long.

Author Comment

ID: 2585226
My hunch exactly.. Thanks for your help
LVL 32

Expert Comment

ID: 2585260
You're welcome. :-)

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question