Results 1 to 5 of 5

Thread: more DLL issues...

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Cool

    What is the equivalent to a float in VB, because I'm getting an error like "Bad DLL calling convention", or something like that, and I think that the data type maybe the problem...also, what else could it be besides the data type, any ideas??
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    C/C++ - VB
    char - byte
    short - integer
    int - long
    long - long
    float - single
    double - double

    Also, you need to make sure that you're using the __stdcall (two underscores) calling convention.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Two Underscores!?!

    Doh, that would probably do it too, huh? thanks Mike.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  4. #4

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Talking hey me again Parksie

    could you give me an example of what I'm supposed to do, I'm just getting back into C++ and the MSDN is confusing the hell outta me. Like some thing simple, a function that takes in two floats, and adds them and returns the result. With all the prototyping(is that what its called?) and all, so it would theoretically work in VB...thanks for your time and help...
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    mydll.cpp
    Code:
    float __stdcall myfunc(float input, float other) {
        return input + other;
    }
    mydll.def
    Code:
    LIBRARY "mydll.dll"
    
    EXPORTS
        myfunc
    Prototyping is only needed for C++, and only for compile-time dynamic linking.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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