Help: DLL Function returns handle 
Author Message
 Help: DLL Function returns handle

Maybe someone can help me.  A DLL function I am calling returns a Handle to
a complex structure, which will then be used for other calls in the same DLL
function list.  How do I trick VB in letting the Function return a handle
without giving me a type mismatch at Run-time.  In C the fucntions would
look something like this:

Handle RfmHandle

RfmHandle = rfmOpen()

rfmWrite(RfmHandle,80)
rfmRead(RfmHandle,80)

What do I Declare rfmOpen as to return the handle and then how do I use that
handle for the other two functions when I call them??

Thanx much if you can help me!!!



Fri, 08 Dec 2000 03:00:00 GMT  
 Help: DLL Function returns handle

    The handle is a long, just declare a long variable is ok.


Quote:
>Maybe someone can help me.  A DLL function I am calling returns a Handle to
>a complex structure, which will then be used for other calls in the same
DLL
>function list.  How do I trick VB in letting the Function return a handle
>without giving me a type mismatch at Run-time.  In C the fucntions would
>look something like this:

>Handle RfmHandle

>RfmHandle = rfmOpen()

>rfmWrite(RfmHandle,80)
>rfmRead(RfmHandle,80)

>What do I Declare rfmOpen as to return the handle and then how do I use
that
>handle for the other two functions when I call them??

>Thanx much if you can help me!!!



Sat, 09 Dec 2000 03:00:00 GMT  
 Help: DLL Function returns handle

Quote:

>Maybe someone can help me.  A DLL function I am calling returns a Handle to
>a complex structure, which will then be used for other calls in the same DLL
>function list.  How do I trick VB in letting the Function return a handle
>without giving me a type mismatch at Run-time.  In C the fucntions would
>look something like this:

>Handle RfmHandle

>RfmHandle = rfmOpen()

>rfmWrite(RfmHandle,80)
>rfmRead(RfmHandle,80)

>What do I Declare rfmOpen as to return the handle and then how do I use that
>handle for the other two functions when I call them??

>Thanx much if you can help me!!!

declare function  rfmOpen lib "your dll" as long

declare sub rfmWrite  lib "your dll" (byval RfmHandle as long,byval
variable1 as long)

....

Jacky Kwok





Sat, 09 Dec 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. DLL handle & DLL Function handle

2. Help How to get MS C++ DLL function to return string to VB

3. Returning function name for error handling?

4. handling C function return in VB

5. PRIVATE DECLARE ... Handling returns (DLL)

6. Problems w/handling HRESULT returned from a DLL

7. How to handle a return pointer to an array from a DLL

8. Dll returns a Handle to a DIB how can I display in picture box

9. Calling DLL functions with type HANDLE

10. Passing a windows handle to a DLL-function

11. Return values from VB CallBack Function to VC Dll

12. .DLL function returns pointer to a double?

 

 
Powered by phpBB® Forum Software