Valhalla Legends Forums Archive | Visual Basic Programming | VB TypeDefs? Converting C++ to VisualBasic

AuthorMessageTime
Dyndrilliac
[code]typedef char* (*SomeRandomFunction1)();
typedef int (*SomeRandomFunction2)(long);
typedef int (*SomeRandomFunction3)();
typedef int (*SomeRandomFunction4)();[/code]

I need to convert the above code into the Visual Basic equivalent. Now, because VB (AFAIK) does not have prototypes or pointers, I'm at a loss on how to go about doing this.

I tried to do it myself and came up with this:[code]Private CStr(SomeRandomFunction1) As String[/code]But that's hopelessly wrong. Can anyone point me in the right direct?
June 26, 2005, 12:26 AM
Adron
As long as you just want to declare a variable to hold such a pointer, this works as an equivalent:

Dim SomeRandomFunction1 As Long

On 32-bit windows, those statements allocate space for a 4-byte value. Now if you want to actually *use* them in some way....
June 26, 2005, 12:28 AM
Dyndrilliac
Well, yes - those variables are going to be used with GetProcAddress to get a few functions from a library I've loaded, and I want to be able to use them to call the functions as I would in C++. Is this not possible in VB?
June 26, 2005, 12:33 AM
Dyndrilliac
Problem resolved.
June 26, 2005, 8:37 AM

Search