DLL API 
Author Message
 DLL API

    Okay, I have this nice DLL that was made in C, designed to work with C++
and Delphi.  It is not a COM component, but a true, old-fashioned API system
(atleast that is what we were told).  I've been going around and around for
weeks on this project.  Under VB.NET, I can atleast get most of the API's to
work, but I'm getting snagged on the memory handles.  Here is the C
prototype of the API call, and after that is the code that I'm trying to
use:

'// C
SDSCAN_EXPORT     unsigned int      WINAPI    SDGetImages (
    HANDLE hSDHandle,
    HANDLE FAR *hDHIB1,
    HANDLE FAR *hDHIB2,
    HANDLE FAR *hDHIB3,
    HANDLE FAR *hDHIB4 );

'// VB.NET
Public Declare Function SDGetImages Lib "Sdadm.dll" (
    ByVal hSDHandle as Long,
    ByRef hDHIB1 as Long,
    ByRef hDHIB2 as Long,
    ByRef hDHIB3 as Long,
    ByRef hDHIB4 as Long ) As Integer

In one of the other API's, I see a variable defined as char far.  What is
this far {*filter*}and is that part of my problem?  I think this following bit of
code might be part of the problem too:

'//C
SDTIFF_EXPORT        unsigned int     WINAPI    SDDIBtoTIFF(
        HANDLE    hdib,
        char  FAR    *szFileName,
        unsigned int    uCompression,
        unsigned long  ulStripSize,
        unsigned int    fAppend  );

'// VB.NET
Public Declare Function SDDIBtoTIFF Lib "SDTiff32.dll" (ByRef hDIB as Long,
        ByRef szFileName as Char,
        ByVal uCompression as Integer,
        ByVal ulStrip as Long,
        ByVal fAppend as Integer) As Integer

Like I said, this is not a COM component, so that shouldn't be an issue.

Thanks in Advance
Tibmeister



Sun, 27 Nov 2005 21:59:43 GMT  
 DLL API
Hi,

            The unmanged integer is the same as the manged single.  The
unmanaged long is the same as the managed integer. Try replacing the old
longs with integers and the old integers with singles. I hope that helps.

Ken
----------------

Quote:
>     Okay, I have this nice DLL that was made in C, designed to work with
C++
> and Delphi.  It is not a COM component, but a true, old-fashioned API
system
> (atleast that is what we were told).  I've been going around and around
for
> weeks on this project.  Under VB.NET, I can atleast get most of the API's
to
> work, but I'm getting snagged on the memory handles.  Here is the C
> prototype of the API call, and after that is the code that I'm trying to
> use:

> '// C
> SDSCAN_EXPORT     unsigned int      WINAPI    SDGetImages (
>     HANDLE hSDHandle,
>     HANDLE FAR *hDHIB1,
>     HANDLE FAR *hDHIB2,
>     HANDLE FAR *hDHIB3,
>     HANDLE FAR *hDHIB4 );

> '// VB.NET
> Public Declare Function SDGetImages Lib "Sdadm.dll" (
>     ByVal hSDHandle as Long,
>     ByRef hDHIB1 as Long,
>     ByRef hDHIB2 as Long,
>     ByRef hDHIB3 as Long,
>     ByRef hDHIB4 as Long ) As Integer

> In one of the other API's, I see a variable defined as char far.  What is
> this far {*filter*}and is that part of my problem?  I think this following bit
of
> code might be part of the problem too:

> '//C
> SDTIFF_EXPORT        unsigned int     WINAPI    SDDIBtoTIFF(
>         HANDLE    hdib,
>         char  FAR    *szFileName,
>         unsigned int    uCompression,
>         unsigned long  ulStripSize,
>         unsigned int    fAppend  );

> '// VB.NET
> Public Declare Function SDDIBtoTIFF Lib "SDTiff32.dll" (ByRef hDIB as
Long,
>         ByRef szFileName as Char,
>         ByVal uCompression as Integer,
>         ByVal ulStrip as Long,
>         ByVal fAppend as Integer) As Integer

> Like I said, this is not a COM component, so that shouldn't be an issue.

> Thanks in Advance
> Tibmeister



Sun, 27 Nov 2005 22:12:04 GMT  
 DLL API
That gave me arithmitic overflow errors.  I think it's a combination of the
char far decleration and the HANDLES.  Sometimes I'll get invalid memory
pointer error returned from the API call.

Thanks
Tibmeister

Quote:
> Hi,

>             The unmanged integer is the same as the manged single.  The
> unmanaged long is the same as the managed integer. Try replacing the old
> longs with integers and the old integers with singles. I hope that helps.

> Ken
> ----------------


> >     Okay, I have this nice DLL that was made in C, designed to work with
> C++
> > and Delphi.  It is not a COM component, but a true, old-fashioned API
> system
> > (atleast that is what we were told).  I've been going around and around
> for
> > weeks on this project.  Under VB.NET, I can atleast get most of the
API's
> to
> > work, but I'm getting snagged on the memory handles.  Here is the C
> > prototype of the API call, and after that is the code that I'm trying to
> > use:

> > '// C
> > SDSCAN_EXPORT     unsigned int      WINAPI    SDGetImages (
> >     HANDLE hSDHandle,
> >     HANDLE FAR *hDHIB1,
> >     HANDLE FAR *hDHIB2,
> >     HANDLE FAR *hDHIB3,
> >     HANDLE FAR *hDHIB4 );

> > '// VB.NET
> > Public Declare Function SDGetImages Lib "Sdadm.dll" (
> >     ByVal hSDHandle as Long,
> >     ByRef hDHIB1 as Long,
> >     ByRef hDHIB2 as Long,
> >     ByRef hDHIB3 as Long,
> >     ByRef hDHIB4 as Long ) As Integer

> > In one of the other API's, I see a variable defined as char far.  What
is
> > this far {*filter*}and is that part of my problem?  I think this following
bit
> of
> > code might be part of the problem too:

> > '//C
> > SDTIFF_EXPORT        unsigned int     WINAPI    SDDIBtoTIFF(
> >         HANDLE    hdib,
> >         char  FAR    *szFileName,
> >         unsigned int    uCompression,
> >         unsigned long  ulStripSize,
> >         unsigned int    fAppend  );

> > '// VB.NET
> > Public Declare Function SDDIBtoTIFF Lib "SDTiff32.dll" (ByRef hDIB as
> Long,
> >         ByRef szFileName as Char,
> >         ByVal uCompression as Integer,
> >         ByVal ulStrip as Long,
> >         ByVal fAppend as Integer) As Integer

> > Like I said, this is not a COM component, so that shouldn't be an issue.

> > Thanks in Advance
> > Tibmeister



Sun, 27 Nov 2005 22:25:30 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Comdlg32.dll API Problem Under Win98

2. ODBC32.DLL API

3. MSAJT200.DLL API Declarations (Jet 2.5)

4. wsock32.dll api functions...where?

5. Managing Cookies with wininet.dll APIs

6. Newbie DLL/API Problem

7. Winsock - Writing To DLL / API

8. Wininet.dll API info for VB?

9. How can i play (.avi) indefinitely without ocx or dll - API code exist

10. NWCALLS.DLL API

11. Help Using Cards.DLL API calls.

12. Resource dll API question

 

 
Powered by phpBB® Forum Software