A
abhijeet
Hi,
I am having some problem for getting values in struct from the c dll.
I have following definition
Type MBRINFO
szMember As String * 80 ' member name array
usLevel As Integer
End Type
I am passing this struct to c dll for getting back the values filled
from the dll
Declare Function GetMemberInfo Lib "xyz" (pInfo As MBRINFO) As Long
On c side I have code as following
struct MBRINFO
{
char szMember[80];
int usLevel;
}
long GetMemberInfo(MBRINFO * info)
{
long sts = 0;
memset(info,0,sizeof(MBRINFO ));
szMember(info->szMember,"Something");
info->usLevel = 10;
return sts;
}
The definition is exported from the xyz.dll for acess.
But, when I get value back on vb side, I noticed the value for szMember
is filled with assigned value which is "Something" folloed by lot of
space characters. Can somebody help me figure out how to avoid this
issue.
Thanks,
Abhijeet
I am having some problem for getting values in struct from the c dll.
I have following definition
Type MBRINFO
szMember As String * 80 ' member name array
usLevel As Integer
End Type
I am passing this struct to c dll for getting back the values filled
from the dll
Declare Function GetMemberInfo Lib "xyz" (pInfo As MBRINFO) As Long
On c side I have code as following
struct MBRINFO
{
char szMember[80];
int usLevel;
}
long GetMemberInfo(MBRINFO * info)
{
long sts = 0;
memset(info,0,sizeof(MBRINFO ));
szMember(info->szMember,"Something");
info->usLevel = 10;
return sts;
}
The definition is exported from the xyz.dll for acess.
But, when I get value back on vb side, I noticed the value for szMember
is filled with assigned value which is "Something" folloed by lot of
space characters. Can somebody help me figure out how to avoid this
issue.
Thanks,
Abhijeet