Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > BOOK: Ivor Horton's Beginning Visual C++ 2010
|
BOOK: Ivor Horton's Beginning Visual C++ 2010
This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2010 by Ivor Horton; ISBN: 9780470500880
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2010 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 30th, 2014, 08:32 AM
Registered User
 
Join Date: Jul 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default pass string back from dll (c++) to application (vb.exe) for x64 platforms

my dll is and needs to be x64. I have in the past passed reference strings to a dll x32 but when I try to do the same thing it doesn't work.

more explicitly my vb declare is:

Declare Sub stringbyref_ Lib "c:\davids\directory_all_dlls\hiprec1.dll" (s As String)


and my c++ dll function is:

void FAR PASCAL stringbyref_(LPSTR*p_s)

{



}


when the code is run p_s is a bad pointer!

I note that I can pass a string forward into the dll just fine. its the passback that is the problem.

if you can help I would appreciate it.
 
Old April 30th, 2014, 04:06 PM
Registered User
 
Join Date: Jul 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default my error

my error! I apologize. it works as advertised.

the declaration that works in the dll is:

void FAR PASCAL stringbyref_(LPSTR p_s)

{

}

and the calling declaration from vb is:

Declare Sub stringbyref_ Lib "c:\davids\directory_all_dlls\hiprec1.dll" (s As String)

note that:

Declare Sub stringbyref_ Lib "c:\davids\directory_all_dlls\hiprec1.dll" (byref s As String)

crashes when returning from the dll.

sorry for inconvience,


david





Similar Threads
Thread Thread Starter Forum Replies Last Post
VB.NET On Other Platforms neogortex Pro Visual Basic 2005 1 June 12th, 2006 01:48 PM
VB dll/exe version compatibility pinkuisadear VB Components 8 July 20th, 2005 12:14 PM
How to Pass a UDT from ATL to VB via COM-EXE-SERVE polderudo C++ Programming 3 April 21st, 2005 07:57 AM
Urgent! How to make vb application to .exe? snowydust VB How-To 3 August 10th, 2004 11:25 AM
Pass active X control from c++ to VB DLL rraags Visual C++ 2 June 8th, 2004 02:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.