Results 1 to 3 of 3

Thread: Cards.DLL & VB.NET

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2003
    Posts
    2

    Cards.DLL & VB.NET

    I'm new to game programming in VB.NET. I need some help porting a card game from VB6 to VB.NET. I'd appreciate any help you can give.

    I get an error the first time I call cdtInit. The error says "Object reference not set to an instance of an object".

    I declare the cdtInit function in a global module & call it from my main form.load event.

    Declaration is:

    Declare Function cdtInit Lib "Cards.Dll" (ByVal dX As Long, ByVal dY As Long) As Long

    Call is:

    Dim X As Long, Y As Long
    cdtInit(X, Y)

    This sound so simple. What am I doing wrong?

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    I think you are supposed to use:
    VB Code:
    1. Declare [b]Ansi[/b] Function ...
    To import regular DLL functions. VB.NET DLLs don't require the Ansi, I believe.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2003
    Posts
    2
    I think you're right that the ANSI is not required. I get the error with or without it in the function declaration.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width