Solved

Hexadecimal value arrives in front of string parameter passed to VB6 class

Posted on 2011-02-21
3
245 Views
Last Modified: 2012-05-11
Hi...

I have this Windows Process project written in VB.Net 2003, which calls a couple of functions from a VB6 class I wrote, with string parameters in both of them

Weird thing is that, when debugging the application, I found that the parameters I send to the class arrive with an hexadecimal value in front of the actual value

Example: I send "0009" and the class receives this: 0x001b6ab4 "0009"

Any hints??

Thanks
0
Comment
Question by:JohnP_Realini
  • 2
3 Comments
 
LVL 14

Expert Comment

by:Brook Braswell
Comment Utility
Could you show the code you use to define and call your class in .net

and show the class with the defined parameter in vb6

It is hard to discern what your potential problem is without knowing how your parameter is defined in vb6.  If it is not defined with any type then it will assume Variant.
0
 
LVL 3

Author Comment

by:JohnP_Realini
Comment Utility
Thanks for getting into this

In .Net first I add the class as a reference, then I do an Import (Import BioIDdll) and last  instance the class (Private Bio as New BioIDdll.BioID)

Then I start calling the methods sending parameters (all are string) and I receive them in the class with "ByVal", and for what I have been investigatin, the hexadecimal value I am receiving is the memory position pointer

If I change the way I receive it (using ByRef) I only get the pointer, and not the data

The question now is... How do I handle that information, so I can use the data stored in that memory position

Thanks!
0
 
LVL 14

Accepted Solution

by:
Brook Braswell earned 500 total points
Comment Utility
I am not sure why you are getting the pointer, but perhaps you can mod the vb6 portion to parse out the pointer and keep the value...
Seeing that the value is in double quotes, parsing should be easy.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now