--- In [email protected], "entropyreduction" <[EMAIL PROTECTED]> wrote: > > --- In [email protected], "swzoh" <seanzoh@> wrote: > > > > Hi Alan, > > > > While I was writing a script, I encountered a situation to have to set > > a 'literal' string as an element of struct: > > tLogFont=dll.create_struct("i i i i i uc uc uc uc uc uc uc uc s",;;+ > > nHeight,0,0,0,400,0,0,0,1,0,0,0,0,sFaceName) > > I looked up LOGFONT. No, I never anticipated that the api would > include such craziness. > > > However, tLogFont.get_size always returned 32 regardless of whatever > > name is setted to sFaceName like "Tahoma" or "Courier New". So, it > > seems to be treated always as a pointer. Is this a intended > > behavior? > > Yes, "s" aka "string" is a pseudonym for char*. Every use I've ever > seen for char*s in structs have been simply a pointer member, not > actually chucking the string into what then becomes a variable-length > struct.
Actually there is a size limit in sFaceName, 32 in TChars including trailing null. So, it may not a variable-length struct, but 60 byte fixed-size struct. (s may have to be something like s32). Sean Attention: PowerPro's Web site has moved: http://www.ppro.org Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/power-pro/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
