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. C / C++ / MFC
  4. DLL Function in VB

DLL Function in VB

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++comworkspace
2 Posts 2 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.
  • T Offline
    T Offline
    Tim Rymer
    wrote on last edited by
    #1

    Hey, I've created an ATL object in a .dll, and i am trying to call the function dynamically. How do i need to setup my functions to get them to not give back crappy values (my BSTR="?????????????????????????????") i tried __stdcall or _export but nothing is working. i also have "ByVal" for the parameter in my function definition in the VB section. ~Timothy T. Rymer www.digipen.edu tim.xpertz.com

    P 1 Reply Last reply
    0
    • T Tim Rymer

      Hey, I've created an ATL object in a .dll, and i am trying to call the function dynamically. How do i need to setup my functions to get them to not give back crappy values (my BSTR="?????????????????????????????") i tried __stdcall or _export but nothing is working. i also have "ByVal" for the parameter in my function definition in the VB section. ~Timothy T. Rymer www.digipen.edu tim.xpertz.com

      P Offline
      P Offline
      Paul M Watt
      wrote on last edited by
      #2

      Is the ATL object a COM object, if so then you simply need to declare your class inside of the type library that is created in your idl file of your project. Then you can go to the Project | references menu item in your VB project in order to reference your COM object. From there you can use that object in VB just like any other object. If you are actually exporting an object like you say rather than a function, you would need to instantiate an instance of this object before it can be used, and I do not know of a way to use a C++ object in VB except through COM. If this is what is happening, I am surprised that your program is not crashing.

      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