MAKELANGID Macro 
Author Message
 MAKELANGID Macro

I need to port the MAKELANGID Macro into VB. It's defined like this:

#define MAKELANGID(p, s)       ((((WORD  )(s)) << 10) | (WORD  )(p))

I know there's alot of weirdness surrounding bitshifting in VB, if anyone
has a good solution that would at least work in this case alone it would be
much appreciated.

Regards,
Anand Nathan
Programmer, Multi-Health Systems



Sun, 23 Feb 2003 02:24:04 GMT  
 MAKELANGID Macro
Public Function MakeLong(ByVal aKeyCode As Integer, ByVal aKeyShift As
Integer)
 As Long
 ' aKeyShift - hiWord,  aKeyCode - lowWord
     MakeLong = CLng(aKeyShift) * &H10000 + aKeyCode
 End Function



Quote:

> I need to port the MAKELANGID Macro into VB. It's defined like this:

> #define MAKELANGID(p, s)       ((((WORD  )(s)) << 10) | (WORD  )(p))

> I know there's alot of weirdness surrounding bitshifting in VB, if anyone
> has a good solution that would at least work in this case alone it would
be
> much appreciated.

> Regards,
> Anand Nathan
> Programmer, Multi-Health Systems



Sun, 23 Feb 2003 04:25:36 GMT  
 MAKELANGID Macro

Thanx...how do I use it?


Quote:
> Public Function MakeLong(ByVal aKeyCode As Integer, ByVal aKeyShift As
> Integer)
>  As Long
>  ' aKeyShift - hiWord,  aKeyCode - lowWord
>      MakeLong = CLng(aKeyShift) * &H10000 + aKeyCode
>  End Function



> > I need to port the MAKELANGID Macro into VB. It's defined like this:

> > #define MAKELANGID(p, s)       ((((WORD  )(s)) << 10) | (WORD  )(p))

> > I know there's alot of weirdness surrounding bitshifting in VB, if
anyone
> > has a good solution that would at least work in this case alone it would
> be
> > much appreciated.

> > Regards,
> > Anand Nathan
> > Programmer, Multi-Health Systems



Sun, 23 Feb 2003 03:43:33 GMT  
 MAKELANGID Macro

Excerpt from _Internationalization_with_Visual_Basic_ (URL below):

Public Function MakeLangId(ByVal lgidPrimary As Long, _
 ByVal lgidSub As Long) As Long
    MakeLangId = (LLeftShift(lgidSub, 10) Or lgidPrimary)
End Function

Public Function LLeftShift(ByVal lNum As Long, _
 ByVal lShift As Long) As Long
    LLeftShift = lNum * (2 ^ lShift)
End Function

--
MichKa

random junk of dubious value at the
multilingual http://www.trigeminal.com/ and
a new book on internationalization in VB at
http://www.i18nWithVB.com/


Quote:
> I need to port the MAKELANGID Macro into VB. It's defined like this:

> #define MAKELANGID(p, s)       ((((WORD  )(s)) << 10) | (WORD  )(p))

> I know there's alot of weirdness surrounding bitshifting in VB, if anyone
> has a good solution that would at least work in this case alone it would
be
> much appreciated.

> Regards,
> Anand Nathan
> Programmer, Multi-Health Systems



Sun, 23 Feb 2003 04:15:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. macro box pops up when no macros exist

2. macro changing code in another macro

3. macro to change code in another macro

4. How to make changes in macros with help of anather macro

5. Word Macro runs then gets Macro Not Found

6. Removing the [ENABLE MACROS] [DISABLE MACROS] popup window

7. Word 97 Macros > Word XP Macros

8. MACROS: copying macro from one PC to another

9. disabling the macro security to execute a macro

10. Create or Delete a Macro from another Macro

11. Macro to create a Macro

12. Word 97/how to delete a macro by a macro

 

 
Powered by phpBB® Forum Software