Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21243

Calling External Function

$
0
0
Does anyone know if im wrong declaring the following function because i get a very big 'BAD DLL CALLING CONVENTION' error:

I ported it from C++:
Code:

SCRAPERDLL_API void OverrideScraper(SScraperState *state)

struct SScraperState
{
        char                        title[512];
        unsigned int        card_common[5];
        unsigned int        card_player[10][2];
        unsigned int        card_player_for_display[2];
        bool                        dealer[10];
        bool                        sitting_out[10];
        CString                seated[10];
        CString                active[10];
        CString                name[10];
        double                balance[10];
        bool                        name_good_scrape[10];
        bool                        balance_good_scrape[10];
        double                bet[10];
        double                pot[10];
        CString                button_state[10];
        CString                i86X_button_state[10];
        CString                i86_button_state;
        CString                button_label[10];
        double                sblind;
        double                bblind;
        double                bbet;
        double                ante;
        LimitType                limit;
        double                handnumber;
        bool                        istournament;
};

Into this one:
Code:

Public Type SState
    Title(512) As String
    Card_common(5) As Single
    Card_player(10) As Single
    Card_player_for_display(2) As Single
    Dealer(10) As Integer
    Sitting_out(10) As Single
    Seated(10) As String
    Active(10) As String
    PName(10) As String
    Balance(10) As Double
    Name_good_scrape(10) As Boolean
    Balance_good_scrape(10) As Boolean
    Bet(10) As Double
    Pot(10) As Double
    Button_state As String
    i86X_button_state(10) As String
    i86_button_state As String
    button_label(10) As String
    SBlind As Double
    BBlind As Double
    BBet As Double
    Ante As Double
    Limit As String
    HandNumber As Double
    IsTournament As Boolean
End Type

Public Declare Sub OverrideScraper Lib "c:\scraper.dll" (ByRef SScraperState As SState)
   
Public Sub Command1_Click()
  Dim SS As SState
  OverrideScraper SS

  msgbox SS.HandNumber
End Sub


Viewing all articles
Browse latest Browse all 21243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>