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. VB Callback function with string in VC DLL

VB Callback function with string in VC DLL

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
1 Posts 1 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.
  • M Offline
    M Offline
    Michael Olsen
    wrote on last edited by
    #1

    Hello all, I am writing a DLL that wraps another DLL in an interface that can be called from VB. the dll ahs a callback function defined as typedef int(_cdecl *cbfuncText)(int HisNodeID, char *str, void *arg); In my wrapper DLL i have a function that translates this into a new Callbac function that is defined as typedef int(__stdcall *cbWfuncText)(int HisNodeID, char* str, void *arg); When i use the C string directly as shown here VB gets an empty string. when i try to use a BSTR instead, the VB program crashes. The VB function i use in the 2 situations are Function TextCB(ByVal HisNodeID As Long, ByVal str As String, ByRef arg As Long) As Long and Function TextCB(ByVal HisNodeID As Long, ByRef str As String, ByRef arg As Long) As Long Can anybody tell me what i am doing wrong? and/or give me suggestions of how to solve this? In Advance thanks Michael

    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