Click here to Skip to main content
16,005,389 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionProblem with a Function Template Pin
manustone30-Jan-07 9:22
manustone30-Jan-07 9:22 
AnswerRe: Problem with a Function Template Pin
Michael Dunn30-Jan-07 10:15
sitebuilderMichael Dunn30-Jan-07 10:15 
AnswerRe: Problem with a Function Template Pin
Michael Bergman30-Jan-07 11:31
Michael Bergman30-Jan-07 11:31 
GeneralRe: Problem with a Function Template Pin
manustone30-Jan-07 23:01
manustone30-Jan-07 23:01 
QuestionDisappearing slider Pin
AghaKhan29-Jan-07 12:27
AghaKhan29-Jan-07 12:27 
QuestionWhen Servers Crash! Pin
Michael Bergman29-Jan-07 8:51
Michael Bergman29-Jan-07 8:51 
QuestionIWMSBufferAllocator Windows Media Server 9 Pin
Tili29-Jan-07 0:11
Tili29-Jan-07 0:11 
QuestionSTL: C2440: 'initializing' : cannot convert from 'char [12]' to 'SecureString' Pin
Jeffrey Walton25-Jan-07 12:24
Jeffrey Walton25-Jan-07 12:24 
Hi All,

I'm embarrased to ask this one, but for the life of me, I don't see what I am doing wrong...

I've gone as far as making the default ctor private, removing all ctors, removing all copy ctors, explicit ctors, etc. I've even changed the declaration fro char* s to char s[].

Jeff

#include "stdafx.h"

#include <string>
#include "SecureString.h"

int _tmain(int argc, _TCHAR* argv[])
{
    std::string   s1 = "Hello World";
    SecureString ss1 = "Hello World";
    
    return 0;
}

#include <string>
#include <locale>

class SecureString : public std::basic_string< char,
    std::char_traits<char>, CryptoPP::SecByteBlock >

{

public:

    // Construction
    // SecureString( );
    //SercureString( const SecureString& s ) { operator=( s ); }
    SercureString( char* s ) { operator=( s ); }
    //SercureString( char c ) { operator=( c ); }
            
    // Copy
    //SecureString& SercureString( const SecureString& s ) { return operator=( s ); }
    //SecureString& SercureString( char s* ) { return operator=( s ); }
    //SecureString& SercureString( char c ) { return operator=( c ); }
    
    // Assignment
    //SecureString& operator=( const SecureString& s )
    //    { assign( s ); return *this; }
        
    SecureString& operator=( char* s )
        { assign( s ); return *this; }
        
    //SecureString& operator=( char c )
    //    { assign( 1, c ); return *this; }
        
    // Destruction
    ~SecureString( );
    
    // Casting
    operator const byte*() { return reinterpret_cast<const byte*>( this->data() ); }
    
    private:
    
    SecureString();

};

AnswerRe: STL: C2440: 'initializing' : cannot convert from 'char [12]' to 'SecureString' Pin
prasad_som25-Jan-07 17:14
prasad_som25-Jan-07 17:14 
GeneralRe: STL: C2440: 'initializing' : cannot convert from 'char [12]' to 'SecureString' Pin
Jeffrey Walton26-Jan-07 3:29
Jeffrey Walton26-Jan-07 3:29 
GeneralRe: STL: C2440: 'initializing' : cannot convert from 'char [12]' to 'SecureString' Pin
prasad_som26-Jan-07 5:42
prasad_som26-Jan-07 5:42 
GeneralRe: STL: C2440: 'initializing' : cannot convert from 'char [12]' to 'SecureString' Pin
Jeffrey Walton26-Jan-07 7:18
Jeffrey Walton26-Jan-07 7:18 
GeneralRe: STL: C2440: 'initializing' : cannot convert from 'char [12]' to 'SecureString' Pin
Jeffrey Walton26-Jan-07 4:14
Jeffrey Walton26-Jan-07 4:14 
AnswerRe: STL: C2440: 'initializing' : cannot convert from 'char [12]' to 'SecureString' Pin
Michael Dunn25-Jan-07 17:40
sitebuilderMichael Dunn25-Jan-07 17:40 
GeneralRe: STL: C2440: 'initializing' : cannot convert from 'char [12]' to 'SecureString' Pin
Jeffrey Walton26-Jan-07 3:26
Jeffrey Walton26-Jan-07 3:26 
GeneralRe: STL: C2440: 'initializing' : cannot convert from 'char [12]' to 'SecureString' Pin
Jeffrey Walton26-Jan-07 4:17
Jeffrey Walton26-Jan-07 4:17 
GeneralRe: STL: C2440: 'initializing' : cannot convert from 'char [12]' to 'SecureString' Pin
Joaquín M López Muñoz26-Jan-07 10:29
Joaquín M López Muñoz26-Jan-07 10:29 
QuestionProblem in Creating Activex in AtlComponent Pin
narayanagvs24-Jan-07 17:25
narayanagvs24-Jan-07 17:25 
QuestionATL Object having event Pin
godspeed12324-Jan-07 12:35
godspeed12324-Jan-07 12:35 
AnswerRe: ATL Object having event Pin
Roger Stoltz24-Jan-07 21:07
Roger Stoltz24-Jan-07 21:07 
QuestionI can't see ListView Control.what's the problem ? Pin
shuaicarr23-Jan-07 14:39
shuaicarr23-Jan-07 14:39 
AnswerRe: I can't see ListView Control.what's the problem ? Pin
Michael Dunn23-Jan-07 15:37
sitebuilderMichael Dunn23-Jan-07 15:37 
AnswerRe: I can't see ListView Control.what's the problem ? Pin
Alain Rist24-Jan-07 0:16
Alain Rist24-Jan-07 0:16 
Answeri called AtlInitCommonControls() .and set proper styles. Pin
shuaicarr24-Jan-07 1:24
shuaicarr24-Jan-07 1:24 
AnswerRe: i called AtlInitCommonControls() .and set proper styles. Pin
Alain Rist24-Jan-07 8:54
Alain Rist24-Jan-07 8:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.