Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To 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 February 25th, 2005, 07:34 AM
Registered User
 
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Lookie
Default How to convert LPByte & LPCByte into VB

Hi again,

How do you convert LPByte and LPCByte into VB Data Type. I'm using winscard.dll and the functions i need to declare have these two data types which i can't find in MSDN. So if any of you kind knowledgeable souls know how to do this, help v much appreciated.:)

 
Old February 25th, 2005, 04:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

They are pointers, so their VB translation is Long
Marco
 
Old February 26th, 2005, 12:34 AM
Registered User
 
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Lookie
Default

Thanks for the reply Marco but just double checking. Not all C declarations that are pointers correspond to VB Long data type right? For example LPStr and LPCStr corresponds to passing a VB String Data type ByRef.

 Furthermore i found an article in msdn (http://support.microsoft.com/default...;en-us;q106553) titled "How to write C Dlls and call them from VB" and it said that LPByte corresponds with a String data type. So got me kinda confused.

Again any help or dicussions on this will be much appreciated.

Regards

 
Old February 28th, 2005, 06:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

VB and C store strings in a different way so a conversion is needed to pass them. If you declare the LPByte parameters "ByVal as String" (and probably LPCByte too, though I've never heard of this type) then VB will convert the string to C format and pass a pointer. For all other pointer types use ByRef.

hth
Phil





Similar Threads
Thread Thread Starter Forum Replies Last Post
convert dsr file from vb to vb.net Shashi001 VB Components 1 September 22nd, 2006 12:24 PM
Help me convert C# to VB minhtri Pro VB.NET 2002/2003 1 June 8th, 2006 01:32 PM
how to convert black & white image into binary? auxiora_nemesis PHP How-To 1 July 27th, 2004 11:09 PM
convert black & white image into binary codes auxiora_nemesis Beginning PHP 0 July 27th, 2004 10:58 PM





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