Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6875491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:19:49+00:00 2026-05-27T04:19:49+00:00

I am using VS c++ 6.0. I have read that 6.0 has some problems

  • 0

I am using VS c++ 6.0. I have read that 6.0 has some problems with templates??

OK… if I leave the declaration as:

template <class T> T jMin( T a, T b ){
    return ( a < b );
}

The function works, but doing as the following I get the error:

error C2039: 'jMin' : is not a member of 'CVid3Dlg'

Why is there a difference?… and this may relate to the previous post…

If I put the definition in the HEADER as follows, I get:

error C2893: Failed to specialize function template 'T __thiscall CVid3Dlg::jMin(T,T)'
        With the following template arguments:
        'double'

// CVid3Dlg.h

class CVid3Dlg : public CDialog
{
public:
    CVid3Dlg(CWnd* pParent = NULL); // standard constructor
    template <typename T>  T jMin( T a, T b );

protected:
    HICON m_hIcon;
    bool PreViewFlag;

    BITMAP bm; //bitmap struct
    CBitmap m_bmp; //bitmap object
    CRect m_rectFrame; //capture frame inside main window
    bool firstTime;



    // Generated message map functions
    //{{AFX_MSG(CVid3Dlg)
    virtual BOOL OnInitDialog();
    afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
    afx_msg void OnPaint();
    afx_msg HCURSOR OnQueryDragIcon();
    afx_msg void OnTimer(UINT nIDEvent);
    afx_msg void GetVideo();
    afx_msg void OnClose();
    afx_msg void testing();
    afx_msg void Imaging();
    afx_msg void exTemplate();
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
};

//CVid3Dlg.cpp

template <class T> T CVid3Dlg::jMin( T a, T b ){// <-- FAILS
    return ( a < b );
}

void CVid3Dlg::exTemplate()
{
    Image *im = new Image();
    int s=0;

    s = jMin((double)3, (double)4);

    CString s1;

    s1.Format("%d", s);
    MessageBox(s1);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:19:49+00:00Added an answer on May 27, 2026 at 4:19 am

    OK, you’ve made the template a member function of CVid3Dlg. Now in CVid3Dlg::exTemplate() you can use it as follows:

     CVid3Dlg::exTemplate() 
     {
           double min = jMin<double>(3.0, 3.1);
    
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a template that extends templates, but it has some issues. <xsl:template
I have read that using database keys in a URL is a bad thing
I have read that to match a word inside of a string using Regular
Throughout a Bison grammar I am using right recursion, and I have read that
Apparently I can't move files on different volumes using Directory.Move. I have read that
i have read in more then one place that using NHibernate's Identifier as Primary
I have a config file that I read using the RawConfigParser in the standard
I have a file that I want to read in using the File::Slurp module
I am storing monetary values, and I read that FLOAT has internal rounding problems
I am using JMeter and have 2 questions (I have read the FAQ +

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.