Re: using lParam if it's a pointer

  • From: "Littlefield, Tyler" <tyler@xxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Tue, 11 Dec 2007 20:35:13 -0700

thanks. will do.
Also. one last question.
If I have a struct like:
struct data{
int a,b,c,d,e,f,g;
};
will it order it in memory with a being first, g being last? I'm working on a 
program that requires me to have an int size, and then read the first 4 bytes 
to know how big the struct is.
Thanks,
Tyler Littlefield
Vertigo head coder.
"I can only please one person per day; Today doesn't seem like your day, and 
tomorrow doesn't look to promising either."
"A life? Where can I download that at?"

Contact information:
email: tyler@xxxxxxxxxxxxx
skype: st8amnd127
aim: st8amnd2005
msn: tyler@xxxxxxxxxxxxx
  ----- Original Message ----- 
  From: Will Pearson 
  To: programmingblind@xxxxxxxxxxxxx 
  Sent: Tuesday, December 11, 2007 4:56 PM
  Subject: Re: using lParam if it's a pointer


  Hi Tyler,

  I suspect you will need to cast the lParam value.  If you don't then the 
compiler won't know that you are dealing with a structure and you will likely 
get some compile errors.  As the structure is a user defined data type then 
there are likely no standard conversions.

  Without a conversion the compiler will asumme that you are just dealing with 
an unsigned 32-bit integer.  LPARAM's is a typedef for LONG_PTR, and LONG_PTR 
is in turn a typedef for long.  As 32-bit unsigned numeric values don't have 
members then tge compiler is likely to trow some compile errors.

  Will
    ----- Original Message ----- 
    From: Littlefield, Tyler 
    To: programmingblind@xxxxxxxxxxxxx 
    Sent: Tuesday, December 11, 2007 11:18 PM
    Subject: Re: using lParam if it's a pointer


    it says it's a pointer to a struct. I just want to get the data at like 
lParam->foo;

    Tyler Littlefield
    Vertigo head coder.
    "I can only please one person per day; Today doesn't seem like your day, 
and tomorrow doesn't look to promising either."
    "A life? Where can I download that at?"

    Contact information:
    email: tyler@xxxxxxxxxxxxx
    skype: st8amnd127
    aim: st8amnd2005
    msn: tyler@xxxxxxxxxxxxx
      ----- Original Message ----- 
      From: Ken Perry 
      To: programmingblind@xxxxxxxxxxxxx 
      Sent: Tuesday, December 11, 2007 7:30 AM
      Subject: RE: using lParam if it's a pointer




      This depends if your doing it in c++ or C but truthfully it probably 
doesn't matter you should be able to do it with out a cast but it would give 
you a warning it really depends on what your doing with it.

      Ken



--------------------------------------------------------------------------
      From: programmingblind-bounce@xxxxxxxxxxxxx 
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Littlefield, Tyler
      Sent: Tuesday, December 11, 2007 5:27 AM
      To: programmingblind@xxxxxxxxxxxxx
      Subject: using lParam if it's a pointer


      Hello list,
      I've got a question.
      I'm using a callback function, and lParam contains a pointer to a struct 
of data.
      I'm using like lParam->bla=32; do I need to cast lParam to the struct 
first? (struct)lParam->bla=32;
      Thanks,
      Tyler Littlefield
      Vertigo head coder.
      "I can only please one person per day; Today doesn't seem like your day, 
and tomorrow doesn't look to promising either."
      "A life? Where can I download that at?"

      Contact information:
      email: tyler@xxxxxxxxxxxxx
      skype: st8amnd127
      aim: st8amnd2005
      msn: tyler@xxxxxxxxxxxxx

Other related posts: