Wednesday, April 30, 2014

Onslaught

Newsgroup: comp.lang.c++

Subject: Re: Onslaught

From: Chris Hinsley <chris.hinsley@...>

Date: Wed, 30 Apr 2014 14:33:39 +0100



On 2013-06-07 17:42:45 +0000, Chris Hinsley said:



Mmm, Has anyone even had a look ? I do have an improved version of the

engine that is mush more c++ if anyone is interested. But this code is

old enough not to drag into the future.



Regards



Chris









via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1nJ4w3h

View all the progranning help forums at:

http://ift.tt/1dP9txN

Tuesday, April 29, 2014

=?ISO-8859-1?Q?=A73=2E5=2F6_in_the_C=2B=2B11_Standard?=

Newsgroup: comp.lang.c++

Subject: =?ISO-8859-1?Q?=A73=2E5=2F6_in_the_C=2B=2B11_Standard?=

From: Ayrosa <jabelloc@...>

Date: Tue, 29 Apr 2014 12:44:18 -0700 (PDT)



§3.5/6



The name of a function declared in block scope and the name of a variable declared by a block scope extern declaration have linkage. If there is a visible declaration of an entity with linkage having the same name and

type, ignoring entities declared outside the innermost enclosing namespace scope, the block scope declaration declares that same entity and receives the linkage of the previous declaration. If there is more than one such matching entity, the program is ill-formed. Otherwise, if no matching entity is found, the block scope entity receives external linkage.[ Example:



static void f();

static int i = 0; // #1

void g() {

extern void f(); // internal linkage

int i; // #2 i has no linkage

{

extern void f(); // internal linkage

extern int i; // #3 external linkage

}

}



There are three objects named i in this program. The object with internal linkage introduced by the declaration in global scope (line #1 ), the object with automatic storage duration and no linkage introduced by the declaration on line #2, and the object with static storage duration and external linkage introduced by the declaration on line #3. --end example ]



Consider the i object in line #3. Why does it have static storage duration and external linkage?







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1m8TcOw

View all the progranning help forums at:

http://ift.tt/1dP9txN

new 2014 women's spiked pointed toe genuine leather red bottom high-heels shoes,designer brand women 12cm pumps wedding shoes

Newsgroup: comp.lang.c++

Subject: new 2014 women's spiked pointed toe genuine leather red bottom high-heels shoes,designer brand women 12cm pumps wedding shoes

From: toptradea@...

Date: Tue, 29 Apr 2014 08:32:57 -0700 (PDT)



new 2014 women's spiked pointed toe genuine leather red bottom high-heels shoes,designer brand women 12cm pumps wedding shoes



http://ift.tt/1mWL5kV



top fashion store 2014(http://ift.tt/1mWL3cV)

Men Sneakers(http://ift.tt/1m80D8v)

Men Flats(http://ift.tt/1mWL14H)

Men Sandals(http://ift.tt/1m80F0i)

Women Sneakers(http://ift.tt/1mWL3d1)

Women Pumps(http://ift.tt/1m80FgA)

Women Sandals(http://ift.tt/1mWL14N)

Women Flats(http://ift.tt/1m80G44)

Women Boots(http://ift.tt/1m80FgG)

Women Clothing(http://ift.tt/1m80G47)

Women Dresses(http://ift.tt/1mWL3JR)

Women Bandage Dress(http://ift.tt/1m80G4g)

Women Bandage Jumpsuit(http://ift.tt/1mWL1lf)

Children Clothing Boys Girls Sets Shoes(http://ift.tt/1m80G4i)

Brazilian virgin hair (http://ift.tt/1mWL3K3)

Malaysian Virgin Hair (http://ift.tt/1mWL1ll)

Peruvian Virgin Hair (http://ift.tt/1mWL1BC)

Indian Virgin Hair (http://ift.tt/1mWL1BI)

Mongolian Virgin Hair (http://ift.tt/1m80Fx7)







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1mWL2Wm

View all the progranning help forums at:

http://ift.tt/1dP9txN

Hot sale new summer 2014 women's causal princess dress,brand designer round neck high waist sleeveless dresses Free shipping S M L Discount Price:US $14.42

Newsgroup: comp.lang.c++

Subject: Hot sale new summer 2014 women's causal princess dress,brand designer round neck high waist sleeveless dresses Free shipping S M L Discount Price:US $14.42

From: toptradea@...

Date: Tue, 29 Apr 2014 08:23:30 -0700 (PDT)



Hot sale new summer 2014 women's causal princess dress,brand designer round neck high waist sleeveless dresses Free shipping SML

S M L Discount Price:US $14.42

http://ift.tt/1mWL4xp



top fashion store 2014(http://ift.tt/1mWL3cV)

Men Sneakers(http://ift.tt/1m80D8v)

Men Flats(http://ift.tt/1mWL14H)

Men Sandals(http://ift.tt/1m80F0i)

Women Sneakers(http://ift.tt/1mWL3d1)

Women Pumps(http://ift.tt/1m80FgA)

Women Sandals(http://ift.tt/1mWL14N)

Women Flats(http://ift.tt/1m80G44)

Women Boots(http://ift.tt/1m80FgG)

Women Clothing(http://ift.tt/1m80G47)

Women Dresses(http://ift.tt/1mWL3JR)

Women Bandage Dress(http://ift.tt/1m80G4g)

Women Bandage Jumpsuit(http://ift.tt/1mWL1lf)

Children Clothing Boys Girls Sets Shoes(http://ift.tt/1m80G4i)

Brazilian virgin hair (http://ift.tt/1mWL3K3)

Malaysian Virgin Hair (http://ift.tt/1mWL1ll)

Peruvian Virgin Hair (http://ift.tt/1mWL1BC)

Indian Virgin Hair (http://ift.tt/1mWL1BI)

Mongolian Virgin Hair (http://ift.tt/1m80Fx7)







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1mWL28M

View all the progranning help forums at:

http://ift.tt/1dP9txN

new 2014 summer children's 100% cotton sets,cute girls clothing baby sleeveless T-shirts+ shorts1 2 3year old Free shipping Discount Price:US $16.07

Newsgroup: comp.lang.c++

Subject: new 2014 summer children's 100% cotton sets,cute girls clothing baby sleeveless T-shirts+ shorts1 2 3year old Free shipping Discount Price:US $16.07

From: toptradea@...

Date: Tue, 29 Apr 2014 08:13:48 -0700 (PDT)



new 2014 summer children's 100% cotton sets,cute girls clothing baby sleeveless T-shirts+ shorts1 2 3year old Free shipping



http://ift.tt/1m80IJo



top fashion store 2014(http://ift.tt/1mWL3cV)

Men Sneakers(http://ift.tt/1m80D8v)

Men Flats(http://ift.tt/1mWL14H)

Men Sandals(http://ift.tt/1m80F0i)

Women Sneakers(http://ift.tt/1mWL3d1)

Women Pumps(http://ift.tt/1m80FgA)

Women Sandals(http://ift.tt/1mWL14N)

Women Flats(http://ift.tt/1m80G44)

Women Boots(http://ift.tt/1m80FgG)

Women Clothing(http://ift.tt/1m80G47)

Women Dresses(http://ift.tt/1mWL3JR)

Women Bandage Dress(http://ift.tt/1m80G4g)

Women Bandage Jumpsuit(http://ift.tt/1mWL1lf)

Children Clothing Boys Girls Sets Shoes(http://ift.tt/1m80G4i)

Brazilian virgin hair (http://ift.tt/1mWL3K3)

Malaysian Virgin Hair (http://ift.tt/1mWL1ll)

Peruvian Virgin Hair (http://ift.tt/1mWL1BC)

Indian Virgin Hair (http://ift.tt/1mWL1BI)

Mongolian Virgin Hair (http://ift.tt/1m80Fx7)







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1m80GRE

View all the progranning help forums at:

http://ift.tt/1dP9txN

Wholesale New 2014 Women Brand Summer Sweet Yellow Milk Adventure Dress,Ladies Sexy Mini Causal Beach Dress Free Shipping S M L

Newsgroup: comp.lang.c++

Subject: Wholesale New 2014 Women Brand Summer Sweet Yellow Milk Adventure Dress,Ladies Sexy Mini Causal Beach Dress Free Shipping S M L

From: toptradea@...

Date: Tue, 29 Apr 2014 08:11:26 -0700 (PDT)



Wholesale New 2014 Women Brand Summer Sweet Yellow Milk Adventure Dress,Ladies Sexy Mini Causal Beach Dress Free Shipping S M L



http://ift.tt/1m80D8t



top fashion store 2014(http://ift.tt/1mWL3cV)

Men Sneakers(http://ift.tt/1m80D8v)

Men Flats(http://ift.tt/1mWL14H)

Men Sandals(http://ift.tt/1m80F0i)

Women Sneakers(http://ift.tt/1mWL3d1)

Women Pumps(http://ift.tt/1m80FgA)

Women Sandals(http://ift.tt/1mWL14N)

Women Flats(http://ift.tt/1m80G44)

Women Boots(http://ift.tt/1m80FgG)

Women Clothing(http://ift.tt/1m80G47)

Women Dresses(http://ift.tt/1mWL3JR)

Women Bandage Dress(http://ift.tt/1m80G4g)

Women Bandage Jumpsuit(http://ift.tt/1mWL1lf)

Children Clothing Boys Girls Sets Shoes(http://ift.tt/1m80G4i)

Brazilian virgin hair (http://ift.tt/1mWL3K3)

Malaysian Virgin Hair (http://ift.tt/1mWL1ll)

Peruvian Virgin Hair (http://ift.tt/1mWL1BC)

Indian Virgin Hair (http://ift.tt/1mWL1BI)

Mongolian Virgin Hair (http://ift.tt/1m80Fx7)







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1mWL1BM

View all the progranning help forums at:

http://ift.tt/1dP9txN

Monday, April 28, 2014

wholesale New 2014 men's blue/grey canvas breathable summer casual sports shoes,designer loafers,men lazy sneakers shoes

Newsgroup: comp.lang.c++

Subject: wholesale New 2014 men's blue/grey canvas breathable summer casual sports shoes,designer loafers,men lazy sneakers shoes

From: aaashoestore1986@...

Date: Mon, 28 Apr 2014 07:32:16 -0700 (PDT)



New 2014 men's blue/grey canvas breathable summer casual sports shoes,designer loafers,men lazy sneakers shoes



http://ift.tt/1hKJ0TO









via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1iy7oxa

View all the progranning help forums at:

http://ift.tt/1dP9txN

Can template arguments have nested template classes?

Newsgroup: comp.lang.c++

Subject: Can template arguments have nested template classes?

From: Alex <alexhagenzanker@...>

Date: Mon, 28 Apr 2014 05:00:07 -0700 (PDT)



Is there something wrong with requiring that a template argument has a nested class template? Why can I not do the following?



template<typename A, typename T> struct B

{

typedef typename A::AA<T> my_type;

};



VS2013 gives a compile error, even if B is not used at all.



What could I do instead?



Thanks, Alex







p.s. what I really want to do is the following:



template<typename A>

struct B

{

template<typename T>

struct BB : A::AA<T>

{};

};







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1iy7owW

View all the progranning help forums at:

http://ift.tt/1dP9txN

LDAP certificate check - how?

Newsgroup: comp.lang.c++

Subject: LDAP certificate check - how?

From: Torsten Mueller <muellerto@...>

Date: Mon, 28 Apr 2014 13:54:50 +0200



I know this topic is special and not many people have to face this. But

I have to.



I connect to an Active Directory server using LDAP (Wldap32.dll,

functions in Winldap.h) to request and modify some data.



The connection (SSL) allows certificate checks, one for the server's and

one for the client's certificate. I would a least implement the check of

the server's certificate. In LDAP there's a callback function which is

indeed called when I open the connection:



BOOLEAN _cdecl VerifyServerCert(PLDAP Connection, PCCERT_CONTEXT* ppServerCert)

{

// ...

return TRUE; // don't check, just accept the server certificate

}



But I have no idea where to begin with this. How should I start to

interpret this PCCERT_CONTEXT struct list? Could anyone give me a short

introduction into this?



Note: I don't want to use any additional library like OpenSSL for that.



T.M.







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1hKJ1Hj

View all the progranning help forums at:

http://ift.tt/1dP9txN

dup2

Newsgroup: comp.lang.c++

Subject: dup2

From: Hongliang Wang <loudking@...>

Date: Tue, 22 Apr 2014 01:35:06 -0700 (PDT)



Hell all,



I was trying to redirect stdout to a file by using dup2. First I followed microsoft example: http://ift.tt/1iy7o06



it just works fine.



Then I tried to implement this in my own class (ABCLog) but stdout is not captured. I cannot figure it out. The only reason I could think of is that main() is in main.cpp while class ABCLog are in separate files (ABCLog.cpp and ABCLog.h). Could anybody confirm this please?



int main(int argc, char *argv[])

{

ABCLog *log = new ABCLog();



puts("in main");

fflush( stdout );



delete log;



return 0;

}



ABCLog::ABCLog(const char *logFileName)

{

old = _dup(1); /* "old" refers to stdout */

if(old == -1) {

perror(ERR_000104_DUP);

exit(1);

}



if( fopen_s( &logFile, logFileName, "a" ) != 0 ) {

fprintf(stderr, ERR_000105_LOG_FILE_OPEN, logFileName);

exit( 1 );

}



if( -1 == _dup2( _fileno( logFile ), 1 ) ) {

perror( ERR_000106_DUP2 );

exit( 1 );

}



puts("in ABCLog");

fflush(stdout);

}



/**

* Destructor

*/

ABCLog::~ABCLog()

{

_dup2( old, 1 );

_flushall();

m_stream.close();

}







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1hKJ0mS

View all the progranning help forums at:

http://ift.tt/1dP9txN

error while using the function size ()

Newsgroup: comp.lang.c++

Subject: error while using the function size ()

From: Milica Milojevic <milicam363@...>

Date: Mon, 28 Apr 2014 04:09:11 -0700 (PDT)



Hi,



I have created a list called measuresQueue (list<pssMeasure *> measuresQueue; ) which is consisted of ten elements. Then I used measuresQueue.size() function. When I did the printf of the previous function it prints me the number four not ten. Can someone help me with this problem.



Here is my code:



In for loop I have entered my elements of the list:



for (filtertime_t=0; filtertime_t<=1.8; filtertime_t=filtertime_t+0.2) {



pssMeasure *mes = measureReceived(filtertime_t,y,mes_vect,mes_cov);

y++;



process_th->critical_section->writeMeasures(mes);



}

Here it is the measureReceived function description:

pssMeasure * measureReceived(double timeStamp,int j,double array[3][10], double array_cov[3]) {





pssMeasure *mes = new pssMeasure();





mes->track_id =7;

mes->timeStamp =timeStamp;



for (int i=0; i<3; i++)

{

mes->z_t[i]=array[i][j];



}





for(int i = 0; i < 3; i++) {



for(int k = 0; k < 3; k++)

mes->cov_z[i][k] = 0.0;



mes->cov_z[i][i] = array_cov[i];





}

return mes;

}

After creating mes I store them using the function writeMeasures:



void CPSSCriticalSection::writeMeasures(pssMeasure* pss_mes) {



measuresQueue.push_back(pss_mes);}



In order to check that my all elements are stored in the measuresQueue list I have used this after the measuresQueue.push_back(pss_mes);



cout << "hello1" << endl

printf("%f %f %f %f \n", pss_mes->timeStamp, pss_mes->z_t[0], pss_mes->z_t[1], pss_mes->z_t[2]);



Everything was fine until I wanted to see the size of my list measuresQueue with the: cout << "measuresQueue. size: " << measuresQueue.size() << '\n';



I always get the number 4 instead of ten. I don't know what is the reason?











Thank you,

M.













via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1pHsde9

View all the progranning help forums at:

http://ift.tt/1dP9txN

Sunday, April 27, 2014

WM_CLOSE in child window procedure problems

Newsgroup: comp.lang.c++

Subject: WM_CLOSE in child window procedure problems

From: ProDev7 <chenou7@...>

Date: Sun, 27 Apr 2014 09:35:08 -0500



hello everybody. I developped an mdi application everything is ok. but in the child window procedure if I handle WM_CLOSE:

if I maximize a child window then close it form its close box icon it'll be destroyed normally but its icon and its close box and minimize and maximize boxes are still there. if I don't handle WM_CLOSE everything is ok.

what's wrong with WM_CLOSE in child window procedure?



LRESULT callback ChildWinProc(HWND hWnd,UINT msg,WPARAM wParam,lParam)

{

//case WM_CLOSE:

// DestroyWindow(hWnd);

break;

default:

return DefMDIChildProc(hWnd,msg,wParam,lParam);

}

if I Uncomment the above lines the problem starts if I maximize the child window and then closing it













via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1h4H2yi

View all the progranning help forums at:

http://ift.tt/1dP9txN

shared_ptr problems

Newsgroup: comp.lang.c++

Subject: shared_ptr problems

From: cpisztest@...

Date: Thu, 24 Apr 2014 14:34:39 -0700 (PDT)



I wasn't around at design time, but I get to fix the problem...story of my life!



I know about boost::weak_ptr and would use that if the problem was limited to

classes A and B, but C has a public accessor that gives away shared_ptrs to As and I don't know what to do there.



I was thinking of trying to guarentee that Bs and Cs are only created by As and seeing if the compiler complained or not (unknown code base). If I can guarentee that Bs and Cs are only created by and used by As, then I can safely use weak_ptrs...I think. I could do that by hiding constructors of Bs and Cs making them private and friending them to A....I think.



Any thoughts/ideas?



The mess where nothing gets destroyed:



-----

#ifndef A_H

#define A_H



#include <boost/shared_ptr.hpp>

#include <boost/enable_shared_from_this.hpp>



#include <list>



class B;

class C;



class A : public boost::enable_shared_from_this<A>

{

public:



typedef boost::shared_ptr<A> SharedPtr;



A();

~A();



void Foo();



private:



std::list<B *> m_collectionOfBs;



void CleanupBs();

};



#endif

-----

#ifndef B_H

#define B_H



#include "A.h"

#include "C.h"



//--------

class B

{

public:



B(A::SharedPtr a);

~B();



private:



C m_c;

};



#endif

-----

#ifndef C_H

#define C_H



#include "A.h"



class C

{

public:



C(A::SharedPtr a);

~C();



A::SharedPtr GetA();



private:



A::SharedPtr m_a;

};



#endif

-----



#include "A.h"

#include "B.h"



A::A()

{

}



A::~A()

{

CleanupBs();

}



void A::Foo()

{

B * newbie = new B(shared_from_this());

m_collectionOfBs.push_back(newbie);

}



void A::CleanupBs()

{

std::list<B *>::iterator it = m_collectionOfBs.begin();



while (!m_collectionOfBs.empty() &&

it != m_collectionOfBs.end())

{

delete (*it);

it = m_collectionOfBs.erase(it);

}

}

-----

#include "B.h"



B::B(A::SharedPtr a)

:

m_c(a)

{

}



B::~B()

{

}

-----

#include "C.h"



C::C(A::SharedPtr a)

:

m_a(a)

{

}



C::~C()

{

}



A::SharedPtr C::GetA()

{

return m_a;

}

-----

#include "A.h"



int main()

{

A::SharedPtr a(new A());

a->Foo();



return 0;

}







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1h3uMht

View all the progranning help forums at:

http://ift.tt/1dP9txN