DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Help with using CeRapiInvoke to call another Dll, from VB6!

  1. #1
    Join Date
    Sep 2009
    Posts
    2

    Help with using CeRapiInvoke to call another Dll, from VB6!

    Hi everyone,

    I'm trying to declare and use the CeRapiInvoke function from my VB6 app, and I'm getting a "Bad Dll Calling Convention" error. I'm declaring the function as:

    Public Declare Function CeRapiInvoke Lib "rapi.dll" (ByVal pDllPath As String, _
    ByVal pFunctionName As String, _
    ByVal cbInput As Long, _
    ByVal pInput As Byte, _
    ByVal pcbOutput As Long, _
    ByVal ppOutput As Byte, _
    ByVal ppIRAPIStream As Long, _
    ByVal dwReserved As Long) As Long


    ...and using it like this:
    Dim lLNumOutBytes As Long
    Dim labOutput(64) As Byte
    Dim lLNumBytesIn As Long

    lLNumBytesIn = 0
    lLNumOutBytes = UBound(labOutput)

    CeRapiInvoke "\Windows\CeGetDeviceID_Dll.dll", "CeGetDeviceID", lLNumBytesIn, vbNull, lLNumOutBytes, labOutput, 0, 0


    I'd be very grateful to anyone who can help me out with this - isn't the "CeRapiInvoke" function using the __stdcall calling convention, or do I need to write some kine of 'wrapper' Dll that uses __stdcall, and which in turn calls CeRapiInvoke?

    Thanks,

    Tony.

  2. #2
    Join Date
    Sep 2009
    Posts
    2

    Update - Help with using CeRapiInvoke to call another Dll, from VB6!

    Hi all,

    just to save anyone from unecessarily replying, I've now got around this problem by writing a C++ dll that in turn calls CeRapiInvoke, so that my VB6 app doesn't have to! The C++ dll then just returns what data I need back to the VB6 app.

    Cheers,

    T.

Similar Threads

  1. Call a 16-bit DLL in Win32
    By MaRiŲ in forum VB Classic
    Replies: 1
    Last Post: 09-04-2002, 12:28 PM
  2. VB6 vs VB.NET...Procedure Calling Syntax
    By Patrick Troughton in forum .NET
    Replies: 78
    Last Post: 08-13-2002, 11:18 AM
  3. Register a DLL in code and Call a function by address?
    By Sean Woods in forum VB Classic
    Replies: 0
    Last Post: 01-11-2002, 05:10 PM
  4. How to create and Use remote Activex DLL with VB6
    By Mamun Seraji in forum VB Classic
    Replies: 3
    Last Post: 12-10-2001, 10:36 AM
  5. Replies: 0
    Last Post: 01-04-2001, 03:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center