473,499 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

unsigned char * problem

2 New Member
hello all
i am new to this forum, i have some knowledge in c++. I am developing a win32 dll using vc++ 6.0 in winxp sp2 using a third party SDK my problem is
the sdk is having a few structures
1)
Expand|Select|Wrap|Line Numbers
  1. typedef struct SKYETEK_ID 
  2. {
  3.     unsigned char   *id;
  4.     unsigned int    length;
  5. } SKYETEK_ID, *LPSKYETEK_ID;
2)
Expand|Select|Wrap|Line Numbers
  1. typedef struct SKYETEK_TAG 
  2. {
  3.   SKYETEK_TAGTYPE     type;
  4.   LPSKYETEK_ID        id;
  5.   unsigned short      afi;
  6.   unsigned short      session;
  7.   unsigned char       rf;
  8.   TCHAR                friendly[128];
  9.   void                *user;
  10.   void                *internal;
  11. } SKYETEK_TAG, *LPSKYETEK_TAG;
3)
Expand|Select|Wrap|Line Numbers
  1. unsigned char SelectLoopCallBack(LPSKYETEK_TAG lpTag, void *user)
  2. {
  3.     char* tid;
  4.     unsigned char *ttype;
  5.     if( !isStop )
  6.     {
  7.         if (lpTag!=NULL)
  8.             {
  9.  
  10.             tid=(SkyeTek_GetTagTypeNameFromType(lpTag->type));
  11.             ttype=lpTag->id; 
  12.             MessageBox(0,ttype,"test",0);
  13.  
  14.             USES_CONVERSION;
  15.             MyTagid =A2BSTR(tid);
  16.             MyTagType=A2BSTR(ttype); 
  17.             SkyeTek_FreeTag(lpTag);
  18.  
  19.             }
  20.     }
  21.  
  22. return isStop;
  23. }
in the third function i am calling the second structure as lpTag.
i want the tag id which is pointing to another structure with unsigned char* as data type.
so i created a local unsigned char* variable and try to store the lptag->id value into it. what returns is some thing gibberish.how get the correct value from the structure and store it in a char * any help will be greatly appreciated.thanks and regards
Jun 24 '08 #1
2 1715
leejwen
50 New Member
I guess you didnt allocate memory for your "unsingned char * id"
Jun 24 '08 #2
sansknowledge
2 New Member
how to do that ? (a bit naive)
Jun 24 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

10
23546
by: kar1107 | last post by:
Hi all, Can the compiler chose the type of an enum to be signed or unsigned int? I thought it must be int; looks like it changes based on the assigned values. Below if I don't initialize...
5
7760
by: Stephen Cawood | last post by:
I'm trying to use a C++ .lib from C# (I tried the Interop group will no results). I have a working wrapper DLL (I can get back simple things like int), but I'm having issues dealing with an array...
30
3223
by: Yevgen Muntyan | last post by:
Hey, Why is it legal to do union U {unsigned char u; int a;}; union U u; u.a = 1; u.u; I tried to find it in the standard, but I only found that
33
15449
by: Michael B Allen | last post by:
Hello, Early on I decided that all text (what most people call "strings" ) in my code would be unsigned char *. The reasoning is that the elements of these arrays are decidedly not signed. In...
29
9922
by: Kenzogio | last post by:
Hi, I have a struct "allmsg" and him member : unsigned char card_number; //16 allmsg.card_number
0
7128
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
6892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7385
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5467
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4917
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4597
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
294
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.