473,626 Members | 3,265 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.tha nks and regards
Jun 24 '08 #1
2 1723
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
23592
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 FOO_STORE to be, say -10, I get a warning about unsigned comparison and I'm seeing an infinite loop. If I do initialize FOO_STORE = -10, I don't see any warnings. No infinite loop.
5
7782
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 of bytes. For example, the .lib contains this function: int create(int id, int scale, unsigned char *image); In the wrapper DLL I have this function:
30
3258
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
15526
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 fact, they may not even represent complete characters. At this point I think of text as simple binary blobs. What charset, character encoding and termination they use should not be exposed in the interface used to operate on them. But now I have...
29
9956
by: Kenzogio | last post by:
Hi, I have a struct "allmsg" and him member : unsigned char card_number; //16 allmsg.card_number
0
8196
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8504
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7193
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5574
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4197
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1808
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.