Solved

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

Posted on 2011-02-21
3
252 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 14

Expert Comment

by:Brook Braswell
ID: 34946737
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
ID: 34950677
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
ID: 34951229
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

738 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