Search Tools Links Login

MSVBVM60.DLL API Calls


Much like kernel32.dll or user32.dll, MSVBVM60.DLL (or MSVBVM50 for VB5) contains a myriad of useful API function calls that you can utilise - although many of these are undocumented.
Just out of interest, I'd thought I'd post a few up here. Seeing as we all have to distribute that annoyingly chunky DLL with our apps, maybe we could start researching and put the thing to really good use!

Original Author: apidude

Inputs

Usually two or more Variants

Returns

A Variant

API Declarations

''add two variants together
Declare Function vbaVarAdd Lib "MSVBVM60.DLL" Alias "__vbaVarAdd" (var1 As Variant, var2 As Variant) As Variant
''subtract two variants
Declare Function vbaVarSub Lib "MSVBVM60.DLL" Alias "__vbaVarSub" (var1 As Variant, var2 As Variant) As Variant
''multiply two variants
Declare Function vbaVarMul Lib "MSVBVM60.DLL" Alias "__vbaVarMul" (var1 As Variant, var2 As Variant) As Variant
''concatenate two varients
Declare Function vbaVarCat Lib "MSVBVM60.DLL" Alias "__vbaVarCat" (var1 As Variant, var2 As Variant) As Variant

Code

''you'll need to stick a command button on your form
Private Sub Command1_Click()
  ''See what these functions return...
  MsgBox "1+2=" & Trim$(Str$(vbaVarAdd(2, 1)))
  MsgBox "10-5=" & Trim$(Str$(vbaVarSub(5, 10)))
  MsgBox "6*6=" & Trim$(Str$(vbaVarMul(6, 6)))
  MsgBox CStr(vbaVarCat("lo!", "Hel"))
End Sub

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 291 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.