home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!ukma!netsys!decwrl!csus.edu!netcom.com!uzzell
- From: uzzell@netcom.com (David Uzzell)
- Subject: extern structs
- Message-ID: <1993Jan28.230920.7789@netcom.com>
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- Date: Thu, 28 Jan 1993 23:09:20 GMT
- Lines: 39
-
- ubj: extern structs Adv Windows Prog
- To: All
- From: David Uzzell 71031,1411
- I am trying to find a clean way to do something that is probably not
- good C++ programming. I have a C++ code generator that transfers data
- for dialog boxes via a struct defined as extern. This seems to require
- that I set the maximum number of items that can appear in a listbox at
- compile time. I don't want to do that.
-
- Let's say I have a dialog box with a listbox and an editbox. This will
- generate a struct like so:
-
- extern struct
- {
- listItems[50][26]
- editItem[25]
- } ListData;
-
- I want to define the listItems member of ListData such that it is 1 row
- by 26 columns at compile time, and at run time request the exact amount
- of RAM I need from the Windows global heap, put the listbox data there,
- and redefine listItems to point there.
-
- I think that ListData should actually consist of 2 far pointers, and all
- I have to do is change the one that points to the listbox data. But I
- can't figure out the syntax to do it.
-
- Is there an assignment statment I can write that will let me alter a
- pointer in an extern struct, effectively allowing me to reallocate an
- external array while retaining global access and keeping the same array
- name?
-
- Thanks.
- David
-
- uzzell@netcom.com
- uzzell@netcom.com
- D
-
-