Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2004

Tip: Looking for answers? Try searching our database.

How to fix this code?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bredal Jensen - 12 Oct 2004 13:46 GMT
The code below compiles fine with vc++.6 but not with vc++.net

the error message is:

..\RegistryArray_demo\RegistryArray\RegArray.h(28): error C3860: template
argument list following class template name must list parameters in the
order used in template parameter list

What does this mean ???

Many thanks in advance.

#ifndef RegArray_h

#define RegArray_h

#include <afxtempl.h>

template <class T, class F>

class CRegArray:public CArray<T, F>

{

public:

CRegArray(const CString sSection, const CString sArrayName);

void FetchRegistry();

void PersistRegistry();

private:

const CString m_sSection;

const CString m_sArrayName;

const CString m_sCounterName;

};

template <class T, class F>

inline CRegArray<T,T&>::CRegArray(const CString sSection, const CString
sArrayName):CArray<T,F>(),

m_sSection(sSection),

m_sArrayName(sArrayName),

m_sCounterName(sArrayName+"_Counter")

{

}

template <class T, class F>

inline void CRegArray<T,T&>::FetchRegistry()

{

int nCounter = AfxGetApp()->GetProfileInt(m_sSection, m_sCounterName, 0);

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

CString sElmName;

sElmName.Format("%s %d",m_sArrayName, i);

CString sTmp = AfxGetApp()->GetProfileString(m_sSection, sElmName, "");

CSomeClass clTmp;

clTmp.Parse(sTmp);

Add(clTmp);

}

}

template <class T, class F>

inline void CRegArray<T,T&>::PersistRegistry()

{

AfxGetApp()->WriteProfileInt(m_sSection, m_sCounterName, GetSize() );

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

CString sElmName;

sElmName.Format("%s %d",m_sArrayName, i);

AfxGetApp()->WriteProfileString(m_sSection, sElmName,
(*this)[i].GetAsString() );

}

}

#endif
Vladimir Nesterovsky - 12 Oct 2004 14:44 GMT
> The code below compiles fine with vc++.6 but not with vc++.net
>
[quoted text clipped - 5 lines]
>
> What does this mean ???

replace

template <class T, class F>
inline CRegArray<T,T&>:: ...

with

template <class T, class F>
inline CRegArray<T,F>:: ...
Signature

Vladimir Nesterovsky
e-mail: vladimir@nesterovsky-bros.com
home: www.nesterovsky-bros.com

Bredal Jensen - 12 Oct 2004 14:59 GMT
Many thanks...

That solved my problem.

By the way. do you know why VS.NET can not locate

<strstrea.h>?

> > The code below compiles fine with vc++.6 but not with vc++.net
> >
[quoted text clipped - 15 lines]
> template <class T, class F>
> inline CRegArray<T,F>:: ...
Carl Daniel [VC++ MVP] - 12 Oct 2004 15:20 GMT
> Many thanks...
>
[quoted text clipped - 3 lines]
>
> <strstrea.h>?

It, along with all "classic IOStreams" headers, was removed from the product
starting with VC7.1 (they were deprecated starting with VC7).

-cd
Vladimir Nesterovsky - 12 Oct 2004 15:26 GMT
> By the way. do you know why VS.NET can not locate
>
> <strstrea.h>?

This are old streams. Use contemporary streams instead.

Please read "Differences in iostream Implementation" topic in MSDN.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_
core_differences_in_iostream_implementation.asp

Signature

Vladimir Nesterovsky
e-mail: vladimir@nesterovsky-bros.com
home: www.nesterovsky-bros.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.