faq initialize CList

Hi,
  I have a member viarable of CList<CPoint,CPoint&> m_pointlist in Class 
Segment.
Should I have to initialize the m_pointlist in Segment constructur?
Thanks. 


0
fcvcnet
3/2/2007 3:16:38 AM
vc.mfc 33608 articles. 0 followers. Follow

7 Replies
548 Views

Similar Articles

[PageSpeed] 43

The CList has a constructor with a default parameter (block size = 10). If 
that number satisfies you, you do not need to worry about initialization. 
Otherwise, follow this syntax:

class Segment
{
private:
  CList<CPoint, CPoint&> m_pointList;

public:
  Segment() : m_pointList( 100 ) // Place your own number instead of 100...
  {
  }
}

or

class Segment
{
private:
  CList<CPoint, CPoint&> m_pointList;

public:
  Segment();
}

Segment::Segment() : m_pointList( 100 )
{
}


"fcvcnet" <fcvcnet@163.com> wrote in message 
news:es887o$f0m$1@news.cn99.com...
> Hi,
>  I have a member viarable of CList<CPoint,CPoint&> m_pointlist in Class 
> Segment.
> Should I have to initialize the m_pointlist in Segment constructur?
> Thanks.
> 


0
3/2/2007 3:35:04 AM
Thank you so much.

"Ashot Geodakov" <a_geodakov@nospam.hotmail.com> д����Ϣ����:%2345qGvHXHHA.5068@TK2MSFTNGP03.phx.gbl...
> The CList has a constructor with a default parameter (block size = 10). If 
> that number satisfies you, you do not need to worry about initialization. 
> Otherwise, follow this syntax:
>
> class Segment
> {
> private:
>  CList<CPoint, CPoint&> m_pointList;
>
> public:
>  Segment() : m_pointList( 100 ) // Place your own number instead of 100...
>  {
>  }
> }
>
> or
>
> class Segment
> {
> private:
>  CList<CPoint, CPoint&> m_pointList;
>
> public:
>  Segment();
> }
>
> Segment::Segment() : m_pointList( 100 )
> {
> }
>
>
> "fcvcnet" <fcvcnet@163.com> wrote in message 
> news:es887o$f0m$1@news.cn99.com...
>> Hi,
>>  I have a member viarable of CList<CPoint,CPoint&> m_pointlist in Class 
>> Segment.
>> Should I have to initialize the m_pointlist in Segment constructur?
>> Thanks.
>>
>
>
> 


0
fcvcnet
3/2/2007 3:45:25 AM
And more.
If I write like below:
Class CMaxView
{
....
private:
    CArray<CSegment, CSegment&> m_arraylinelist;
....
};

and then how to initialize the m_arraylinelist in the CMaxView contructor? 
Or i need not to do it.

Thanks.



"Ashot Geodakov" <a_geodakov@nospam.hotmail.com> д����Ϣ����:%2345qGvHXHHA.5068@TK2MSFTNGP03.phx.gbl...
> The CList has a constructor with a default parameter (block size = 10). If 
> that number satisfies you, you do not need to worry about initialization. 
> Otherwise, follow this syntax:
>
> class Segment
> {
> private:
>  CList<CPoint, CPoint&> m_pointList;
>
> public:
>  Segment() : m_pointList( 100 ) // Place your own number instead of 100...
>  {
>  }
> }
>
> or
>
> class Segment
> {
> private:
>  CList<CPoint, CPoint&> m_pointList;
>
> public:
>  Segment();
> }
>
> Segment::Segment() : m_pointList( 100 )
> {
> }
>
>
> "fcvcnet" <fcvcnet@163.com> wrote in message 
> news:es887o$f0m$1@news.cn99.com...
>> Hi,
>>  I have a member viarable of CList<CPoint,CPoint&> m_pointlist in Class 
>> Segment.
>> Should I have to initialize the m_pointlist in Segment constructur?
>> Thanks.
>>
>
>
> 


0
fcvcnet
3/2/2007 3:55:31 AM
CArray has a default constructor CArray::CArray(), so you don't need to 
worry about how and when it gets initialized. It does so when its parent 
CMaxView gets created.

Just out of curiosity, you may place breakpoints at

CArray::CArray() // breakpoint here
{
}

and

CMaxView::CMaxView() // another here
{
}

and step through them in the debugger. You'll see that SArray's constructor 
is called before CMaxView's.

"fcvcnet" <fcvcnet@163.com> wrote in message 
news:es8agn$1oe$1@news.cn99.com...
> And more.
> If I write like below:
> Class CMaxView
> {
> ...
> private:
>    CArray<CSegment, CSegment&> m_arraylinelist;
> ...
> };
>
> and then how to initialize the m_arraylinelist in the CMaxView contructor? 
> Or i need not to do it.
>
> Thanks.
>
>
>
> "Ashot Geodakov" <a_geodakov@nospam.hotmail.com> 
> д����Ϣ����:%2345qGvHXHHA.5068@TK2MSFTNGP03.phx.gbl...
>> The CList has a constructor with a default parameter (block size = 10). 
>> If that number satisfies you, you do not need to worry about 
>> initialization. Otherwise, follow this syntax:
>>
>> class Segment
>> {
>> private:
>>  CList<CPoint, CPoint&> m_pointList;
>>
>> public:
>>  Segment() : m_pointList( 100 ) // Place your own number instead of 
>> 100...
>>  {
>>  }
>> }
>>
>> or
>>
>> class Segment
>> {
>> private:
>>  CList<CPoint, CPoint&> m_pointList;
>>
>> public:
>>  Segment();
>> }
>>
>> Segment::Segment() : m_pointList( 100 )
>> {
>> }
>>
>>
>> "fcvcnet" <fcvcnet@163.com> wrote in message 
>> news:es887o$f0m$1@news.cn99.com...
>>> Hi,
>>>  I have a member viarable of CList<CPoint,CPoint&> m_pointlist in Class 
>>> Segment.
>>> Should I have to initialize the m_pointlist in Segment constructur?
>>> Thanks.
>>>
>>
>>
>>
>
> 


0
3/2/2007 4:04:43 AM
Thanks you very much. 


0
fcvcnet
3/2/2007 5:53:41 AM
Initialize to what?  It currently represents a CList which is empty.  If you want elements
in the CList, you can add them.
				joe

On Fri, 2 Mar 2007 11:16:38 +0800, "fcvcnet" <fcvcnet@163.com> wrote:

>Hi,
>  I have a member viarable of CList<CPoint,CPoint&> m_pointlist in Class 
>Segment.
>Should I have to initialize the m_pointlist in Segment constructur?
>Thanks. 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15977)
3/2/2007 6:11:26 AM
Thanks you very much.

"Joseph M. Newcomer" <newcomer@flounder.com> 
??????:fvffu292q768l5jgrgjr2pfe6io1nfq2um@4ax.com...
> Initialize to what?  It currently represents a CList which is empty.  If 
> you want elements
> in the CList, you can add them.
> joe
>
> On Fri, 2 Mar 2007 11:16:38 +0800, "fcvcnet" <fcvcnet@163.com> wrote:
>
>>Hi,
>>  I have a member viarable of CList<CPoint,CPoint&> m_pointlist in Class
>>Segment.
>>Should I have to initialize the m_pointlist in Segment constructur?
>>Thanks.
>>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm
> 


0
fcvcnet
3/2/2007 8:08:06 AM
Reply:

Similar Artilces:

default value to be windowss user initials
what is the code to set a field value to the logged in user's initials? (the one I'm looking for is something stored in MS windows as part of the user's account -I think; not one associated with Access) thanks in advance, mark Here it is! Environ$("UserName") This command will return a string containing the Windows username. -- Yanick "Mark Kubicki" wrote: > what is the code to set a field value to the logged in user's initials? > (the one I'm looking for is something stored in MS windows as part of the > user's account -I think...

Stock Quotes (FAQ?)
Interested in pulling in end-of-day stock qoutes for 15 - 20 stocks. I used to use the MSN Money Central add in, but it is apparently is no longer available. I'd like to be able to code it myself, (or at least be able to browse the source) but I need to get pointed in the right direction. Maybe in a FAQ list somewhere? Thanks in advance for any input/suggestions, JA If you Google "yahoo stock data excel" you will find lots of links to do what you want. A few years back I modified a Yahoo USA file to download stock data (20 min delay) from the Yahoo Australian site ...

faq
Hi, There is RoundRect() function in mfc. Now I want to combine 3 rect into one region, it becomes to a polygon. Is there have RoundPolygon() function? Surely its inner corner shoulde be draw round too. So far as I know there is no built in command for that, but you could build your own using a series of other available commands. This article sort of does that: http://www.tek-tips.com/faqs.cfm?fid=1400 http://www.codeproject.com/system/remoteprogramexec.asp Tom "fcvcnet" <fcvcnet@163.com> wrote in message news:uJGW8sJVGHA.5468@TK2MSFTNGP14.phx.gbl... > Hi, >...

Properly adding CString struction to CList pointer
Hi, I have a member variable for my class that is declared: CList <PARAMITEMS, PARAMITEMS&>m_listParamItems; and it contains a structure with two CString variables, declared as: struct PARAMITEMS { CString strParamName; CString strParam; }; I have a memory leak in my application that is driving me nuts and the only place that I can locate it, is at this section of code: PARAMITEMS* pParam = new PARAMITEMS; pParam->strParamName = (const char*)"FIRST_PARAMETER"; pParam->strParam = strCString; // Test CString allocated with "String" m_listParamI...

faq initialize CList
Hi, I have a member viarable of CList<CPoint,CPoint&> m_pointlist in Class Segment. Should I have to initialize the m_pointlist in Segment constructur? Thanks. The CList has a constructor with a default parameter (block size = 10). If that number satisfies you, you do not need to worry about initialization. Otherwise, follow this syntax: class Segment { private: CList<CPoint, CPoint&> m_pointList; public: Segment() : m_pointList( 100 ) // Place your own number instead of 100... { } } or class Segment { private: CList<CPoint, CPoint&> m_point...

Changing initials into numbers
I have data that I download into Excel and initials are used for different people. I need to give those initials a number in excel for example MJ = 01, HS = 02..etc. Thank you. On 2/3/2010 9:26 AM, Kathie wrote: > I have data that I download into Excel and initials are used for different > people. I need to give those initials a number in excel for example MJ = 01, > HS = 02..etc. Thank you. see VLOOKUP in Excel help. Bill Kathie You have to be more specific. Where are the initials (column, row, sheet)? Where do you want the numbers placed? HTH Otto &quo...

FAQ
Hello, Is there a faq for this group or other document that outlines the type of questions that are normally posted. Danzer I wish! Unfortunately, there is not a FAQ for this newsgroup. Nor are there sticky threads. Worst of all they purge the old messages after about 90 days... To get more history, and IMO better searching, you can search this group through Google Groups. Google has history going back to at least 2003... Glenn Adams Tiber Creek Consulting http://www.tibercreek.com glenn@tibercreek.com ---------------------------------------------- Please DO NOT respond to me d...

How can I have an initial zero in an Excel cell?
I want to be able to enter times as eg 0845 but no matter what cell format I use, there is a problem, either that the initial zero is lopped off or that I am informed there is an error. Is there any way of solving this? try <format><cell><number><custom> enter 0000 and you will get a four digit display with an initial display with a leading zero. Note this is not a time function "ALupin" wrote: > I want to be able to enter times as eg 0845 but no matter what cell format I > use, there is a problem, either that the initial zero is lopped off or...

faq: what is wrong with breakpoints?
Hi, I use vs2005 + xp. Now when I set breakpoints and press F5, all of the breakpoints change color from red to white, they all disabled. When I stoped debug , they all change color back, what's up. I removed all the breakpoints and set again, the problem is still .How to solve it? Thanks. -- Thank you very much! :) Thank this newsgroup very much! :) Visual Studio 2005 Professional Edition Windows XP Professional I've not seen this yet, but given the huge number of bugs I seem to find in VS2005, it wouldn't surprise me. Presumably you are using the debug version of the build...

Using SetDIBits to initialize a CBitmap?
Does anyone know how to use SetDIBits to initialize a CBitmap? http://www.google.com/search?hl=en&q=SetDIBits+Example http://www.google.com/search?hl=en&q=CBitmap+SetDIBits+Example http://www.codeproject.com/info/search.asp?cats=2&searchkw=SetDIBits&Submit1=Search&author=&sd=15+Nov+1999&ed=18+Jul+2007 AliR. "Peter Olcott" <NoSpam@SeeScreen.com> wrote in message news:Iynni.337$gM1.158@newsfe10.phx... > Does anyone know how to use SetDIBits to initialize a CBitmap? > "AliR (VC++ MVP)" <AliR@online.nospam> wrote in me...

FAQs?
Please direct me to the FAQ. I'm running MS07, everything running smoothly but my brain. Hane Any number of them exist. I post one at http://umpmfaq.info. "Amazon" <remark114@yahoo.com> wrote in message news:eyirMmdLIHA.3940@TK2MSFTNGP05.phx.gbl... > Please direct me to the FAQ. I'm running MS07, everything running > smoothly but my brain. > Hane > "Dick Watson" wrote: > Any number of them exist. I post one at http://umpmfaq.info. For me this one was helpful: http://money.mvps.org/faq/default.aspx ...

Do anyone have an good mal for FAQ
Need to sort out Questions and answar in system in excel. Could anyone help me ? With much more detail provided regarding what type of problem, I'm sure someone could assist. Gord Dibben MS Excel MVP On Mon, 1 Dec 2008 12:36:02 -0800, Tinkababe <Tinkababe@discussions.microsoft.com> wrote: >Need to sort out Questions and answar in system in excel. Could anyone help >me ? Hi Gord Someting like this, but not in access, in excel http://office.microsoft.com/nb-no/templates/TC012253481044.aspx?CategoryID=CT101428241044 Hug Tinka Gord Dibben skrev: > With much more ...

faq
Can the latest faq be posted? The versions that I search for on google groups are out of date. Thanks, Bob Have you tried http://www.bollar.com/msmoney? I'm pretty sure there's none more recent than that in circulation. "Bob Becnel" <rgb2@hilton.cec.wustl.edu> wrote in message news:Pine.GSO.4.58.0312192036570.1762@hilton.cec.wustl.edu... > Can the latest faq be posted? The versions that I search for on google > groups are out of date. org, dummy. It's http://www.bollar.org/msmoney. "Dick Watson" <littlegreengecko@mind-enufalready-spring....

FAQ for TaxCut/TurboTax and Money?
I was wondering if anyone has a FAQ or some insight on setting up the Categories in Money to match an import for these tax programs. I've tried the import and just need to clean house with my Categories and other things so the import is actually accurate. Just curious for any BKM's. In microsoft.public.money, Andrew wrote: >I was wondering if anyone has a FAQ or some insight on setting up the >Categories in Money to match an import for these tax programs. Money will export tax information to a tax program. That is very useful for schedule D. It should be very useful fo...

Routing engine failed to initialize
I am running Exchange 2003 SP2. The Information store fails to start and I am getting the following error in the event viewer: ----------------------------------------------------------- Error 0xc0040391 calling StrInitialize in REAPI.DLL. Source: MSExchangeIS Event ID: 9538 Routing engine failed to initialize and as a result the store would not start. --------------------------------------------------------------------------- and there is some more info about the error I got from microsoft: Explanation: This event can be accompanied by an inability to start the Microsoft E...

Is there an FAQ?
Hi, new here. Is there an FAQ for this group? I am working in both Pub 2000 and Pub 2002. I'm having problems creating active hyperlinks and email links. Will also be converting to pdf. Thanks, morgan http://www.mvps.org/publisher http://www.mvps.org/the_nerd/Publisher/ http://www.davidbartosik.com/ http://www.windowlight.co.nz/ontarget/publisher/ "morgan" <morgana1@newsguy.com> wrote in message news:2v4jgvgi80h5ounae55j8pvl2li9l7ohso@4ax.com... > Hi, new here. Is there an FAQ for this group? > I am working in both Pub 2000 and Pub 2002. I'm having proble...

How can a macro automatically initiate uponing a file?
I'd like to set a macro so that when the file is opened, it automatically runs. Put the code in the Workbook_Open event in the Thisworkbook code module. -- HTH RP (remove nothere from the email address if mailing direct) "kanye" <kanye@discussions.microsoft.com> wrote in message news:DDF17F11-5286-4CF0-B4BC-7182D36EC30E@microsoft.com... > I'd like to set a macro so that when the file is opened, it automatically runs. I've located the Thisworkbook code module, but see nothing about Workbook-Open event. Where do I look for this? "kanye" wrote...

Please Consult Before Posting: Unofficial FAQ Available #39
An unofficial FAQ for this newsgroup is available at http://umpmfaq.info. The source FAQ was last updated Thursday, October 7, 2004. You may save yourself and those willing to spend their time helping you both time and hassle by consulting this resource before posting what may already be a FAQ. The unofficial FAQ answers 154 of the most frequently asked questions in this newsgroup. Note that only a limited number of FAQ items have been added or modified for Money 2005--those that are derive from my limited experience with the product and on very high profile items in the newsgroup. Money 2005 ...

is there a FAQ for this group
Peter w http://www.mvps.org/access/ -- Joe Fallon Access MVP "Peter W" <profwalt@bigpond.com> wrote in message news:%239uXHDnTDHA.2824@tk2msftngp13.phx.gbl... > Peter w > > ...

? MVPs' Word FAQs website fails to work with Safari, but MVPs' Entourage site works fine
Can't the MVPs' webpages for Word FAQs be modified to make them compatible with the the Safari browser? There is NO problem in using Safari to access the MVPs' webpages for Entourage FAQs. I've used both Safari 1.0 and, since upgrading to OS 10.3.1, Safari 1.0 with the same success with the MVPs Entourage FAQs webpages and the same failures with the MVPs Word FAQs webpages. That said, I wish to commend the MVPs for creating the FAQs resources for both Entourage and Word users. That's a really valuable, generous service you've provided. Respectfully, Norman Nager ...

faq how to sovle this problem?
Hi, I add a function manuly, but I got this when I click the name of function in classview. How to tackle this problem? --------------------------- Microsoft Visual C++ --------------------------- Cannot find the definition (implementation) of this function. --------------------------- ȷ�� --------------------------- I know now! "fcvcnet" <fcvcnet@163.com> д����Ϣ����:edm283$3qt$1@news.cn99.com... > Hi, > I add a function manuly, but I got this when I click the name of > function in classview. > How to tackle this problem? > --------------------------- ...

faq how to solve these errors?
Hi, I write a class class CSegment { public: CSegment(void); public: ~CSegment(void); public: CArray< CList< CPoint, CPoint& >, CList< CPoint, CPoint& >& > m_curve; CArray< int, int& > m_superindex; CArray< bool, bool& > m_direction; }; and in CmaxregionborderView I add a member variable class CmaxregionborderView : public CView { .... public: CmaxregionborderDoc* GetDocument() const; public: CArray< CList< CSegment, CSegment& >, CList< CSegment, CSegment& >& > m_bordersegmentlist; .... }; when compile...

faq group box
Hi, I remembered that when I drag the group box control at dialog design time in vc 6.0 , the control inside of it such as radio will be move together. Now I can not do that again, how to do that again? Thanks you so much. > I remembered that when I drag the group box control at dialog design time >in vc 6.0 , the control inside of it such as radio will be move together. Are you sure you're not thinking of VB? As far as I know, it's never behaved this way with the VC dialog editor unless you select all the controls. Dave There is no way to "group" controls...

Error initializing offline synchronization CRM 4.0
Hi I have a customer where the install of the offline Outlook client went through without any problems, also the configuration afterwards. But when starting Outlook after this it goes through different things in the top but stops at error initializing offline synchonization ?? They also tried uninstalling CRM and SQL and reinstall using another user profile but the same problem. I haven't found anything on this so hope anyone has an idea of where to search ? ...

Is there an FAQ on Outlook attachments?
Hi I have used Outlook for several years, and have recently stopped out of frustration at not being able to send or receive attachments. I have never had a problem with viruses, being paranoid about updating virus software, and am getting by for email with other software, but miss the PIM features of Outlook.. Is there a way to get back the ability to send and receive attachments? Thanks. Bob Hi Bob, yes there is a way to send and receive attachments. Please look here, there is some software to enclosed your OL http://www.outlook-hilfe.de/tools-cat-2-80-titleA-10.html or here http://ww...