[quote user="Darin Rodberg"]The problem is that one of the MDL functions seems to require a long in place of a string[/quote]
You've encountered one of the hurdles you must leap if you want to mix MDL and VBA.
MDL is a C language. It uses pointers extensively. C typically stores strings in an array of char...
char surname [] = "rodberg";
Where [] means array in C. We can refer to an array by a pointer in C ...
char* pSurname = surname;
If I want to refer to variable surname, I can do so using the pointer pSurname. Now suppose I have an MDL function that takes a pointer-to-string...
int Capitalise (char* pWord) { ... }
In C, I can pass pSurname to that function, which would do something with the contents of that pointer.
If I want to use that same function from VBA, what do I do? VBA has no concept of pointers. The work-around is to recognise that pointers are 32-bit integers. A 32-bit integer in VBA is called Long. So we substitute Long as the type of the pointer, and it just works!
That's what you're seeing in those mdlDim_xxx functions. You must write a Long where MDL wants a pointer.
[quote user="Darin Rodberg"]the user who wrote this code apparently used a custom function to convert it[/quote]
No custom function is required. MicroStation VBA usually does the right thing automatically when confronted with a pointer. In particular, it knows about strings and how to convert them to and from MDL. That's not always the case with pointers-to-other-things, and it's definitely not the case when C uses a pointer-to-pointer.
Microsoft created some special functions, such as StrPtr, to solve those unusual problems. They are not documented by Microsoft, although there is some unofficial documentation. If you search the Web for VBA StrPtr you may find something of interest.
[quote user="Darin Rodberg"]I can't check the documentation[/quote]
If you're referring to the MDL documentation, then you can download it from Bentley Systems' Fulfillment Center. It's delivered with the MicroStation Software Development Kit (SDK).
Most MDL functions that are documented also have the VBA declaration included. For example, the documentation for mdlDim_create() has this...
VBA Wrapper Declaration
- Declare Function mdlDim_create Lib "stdmdlbltin.dll" ( ByVal dim_ As Long , ByVal seed As Long , ByRef rMatrix As Matrix3d , ByVal dimType As Long , ByVal dimView As Long ) As Long
The first two parameters dim_ and seed are declared Long and refer to C pointers.