Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing an argument of type Byte from C++

Status
Not open for further replies.

onlyshiza

Programmer
May 14, 2003
18
0
0
US
HI everyone,

I am calling a VB COM dll server method from a C++ client. The VB method takes an argument of type Byte. It's defined as such:

Code:
Public sub myAverage(ByVal rate as Byte)

Now how I have to call this function from C++. After importing the dll into the C++ project the function is showing as this in the .tlh:
void myAverage(unsigned char* rate)

I can do this:
Code:
unsigned char one = 2;
double two = 0.0;
two = myInterfacePointer->myAverage(&one);

well, this compiles but I am not doing the right thing, because I am not passing the actual digit 2 to the function, I am passing the ASCII value of it, right? I am a bit confused here. Any commments appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top