Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. using vc++ dll

using vc++ dll

Scheduled Pinned Locked Moved Visual Basic
c++helpquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aarontan
    wrote on last edited by
    #1

    I am using a vc++ dll in a vb program. The function require a pass byref single type. because in vc++ it require a floating point pointer. However, the values I'm getting is wrong. Anyone got any idea what could be wrong? I guessing the values are read in the wrong direction. Thanks for any help. Aaron

    T 1 Reply Last reply
    0
    • A aarontan

      I am using a vc++ dll in a vb program. The function require a pass byref single type. because in vc++ it require a floating point pointer. However, the values I'm getting is wrong. Anyone got any idea what could be wrong? I guessing the values are read in the wrong direction. Thanks for any help. Aaron

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      float* is not equal to single byref. byref means the value is passed by reference, where pointers don't. it should be float& instead... moreover, i'm not certain that float is the equivalent to single. isn't float (vb type) better ?


      TOXCCT >>> GEII power
      [toxcct][VisualCalc]

      A 1 Reply Last reply
      0
      • T toxcct

        float* is not equal to single byref. byref means the value is passed by reference, where pointers don't. it should be float& instead... moreover, i'm not certain that float is the equivalent to single. isn't float (vb type) better ?


        TOXCCT >>> GEII power
        [toxcct][VisualCalc]

        A Offline
        A Offline
        aarontan
        wrote on last edited by
        #3

        I have check on msdn, there is no float type for vb 6.0. Not sure about .net. I've look up several papers saying that when the vc function in the dll is using a pointer as a parameter, the vb-side of calling the function should be using byref. Aaron

        C D 2 Replies Last reply
        0
        • A aarontan

          I have check on msdn, there is no float type for vb 6.0. Not sure about .net. I've look up several papers saying that when the vc function in the dll is using a pointer as a parameter, the vb-side of calling the function should be using byref. Aaron

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          aarontan wrote: I have check on msdn, there is no float type for vb 6.0. Not sure about .net. Surely VB6 has a type for floating point numbers ? Christian Graus - Microsoft MVP - C++

          1 Reply Last reply
          0
          • A aarontan

            I have check on msdn, there is no float type for vb 6.0. Not sure about .net. I've look up several papers saying that when the vc function in the dll is using a pointer as a parameter, the vb-side of calling the function should be using byref. Aaron

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            The C/C++ float data type is equivalent to a VB6 Single. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups