|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Integer Pointer
I have a VB GUI talking to a DLL written in C++ and one of the C++ function requires a pointer to an integer. The program is called but the pointer is NULL.
(#1) How do I define an integer pointer in Visual Basic to pass to a C++ routine? (#2) How do I make the pointer such that it is not null in Visual Basic? |
|
#2
|
|||
|
|||
|
1. Just declare the variable as Long on the VB side (since VB Long is the same as C++ int).
2. In the function declaration, declare the variable as passed ByRef. That will pass the address of the VB variable, rather than the value. Code:
Declare Function SomeFunc Lib "somelib" Alias _ "SomeFuncA" (ByRef hfoo As Long) As Long
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Integer Pointer |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|