|
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:
SercureString( char* s ) { operator=( s ); }
SecureString& operator=( char* s )
{ assign( s ); return *this; }
~SecureString( );
operator const byte*() { return reinterpret_cast<const byte*>( this->data() ); }
private:
SecureString();
};
|
|
|
|
|
Jeffrey Walton wrote: SercureString( char* s ) { operator=( s ); }
This c'tor should remove error message. Though, I'm confused with its definition in your code.
|
|
|
|
|
Hi Prasad,
Thanks, but no joy...
I've since tried forcing the "\TP" switch, breaking out the *.h file into a 'h' and 'cpp' file, etc. I also made it a basic class (no inheritance). I've got the damn thing reduced to a class with 1 ctor - the char*. It's also broken for me (or more correctly, I'm doing something wrong) with VS 8.0 - previous was 7.0.
I alsoe get missing return type with ctor: SercureString( const char* s ); .
Is the name "SecureString" used by VS? Earlier this week I installed the DDK. Could this be it???
Jeff
#pragma once
class SecureString
{
public:
SercureString( const char* s );
~SecureString( );
private:
SecureString();
};
SecureString::SecureString( const char* s )
{
}
|
|
|
|
|
Jeffrey Walton wrote: I alsoe get missing return type with ctor: SercureString( const char* s );.
Nice to see that your problem got solved. But, your class name was SecureString , not SercureString , wasn't that ?
You tried to declare your c'tor with wrong name. Thats why error regarding missing return type was there.
|
|
|
|
|
Hi Prasad,
prasad_som wrote: Nice to see that your problem got solved.
Yes - finally.
prasad_som wrote: your class name was SecureString, not SercureString,
I thought I cleaned up the typo this morning...
Jeff
|
|
|
|
|
Changing "SecureString" to "SecString" resolved the issue...
|
|
|
|
|
Change SecureString(char* s) to SecureString(const char* s) - there's no reason to not have the param be const . Then make the same change in the corresponding operator=
|
|
|
|
|
Hi Mike,
Thanks, but no joy...
I've since tried forcing the "\TP" switch, breaking out the *.h file into a 'h' and 'cpp' file, etc. I also made it a basic class (no inheritance). I've got the damn thing reduced to a class with 1 ctor - the char*. It's also broken for me (or more correctly, I'm doing something wrong) with VS 8.0 - previous was 7.0.
I alsoe get missing return type with ctor: SercureString( const char* s ); .
Is the name "SecureString" used by VS? Earlier this week I installed the DDK. Could this be it???
Jeff
#pragma once
class SecureString
{
public:
SercureString( const char* s );
~SecureString( );
private:
SecureString();
};
SecureString::SecureString( const char* s )
{
}
|
|
|
|
|
Changing "SecureString" to "SecString" resolved the issue.
I wish I would have tried it before removing the DDK...
Thanks for the help.
Jeff
|
|
|
|
|
Before you settle with SecString , please be aware that your original code had a mispelling at the char * constructor, you wrote SercureString rather than SecureString . Could it be this was the problem in the first place?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
Hi,
I have an Atl Component with an Interface EFCMyForm .(ATL Simple Object -- VS2005)
And a Dialog class CMydialog with ActiveX controls Placed on it. using right Click on Dialog and Insert ActiveX Control
In One of thw Exposed Method I am creating the dialog box CMyDialog
CMydialog g_myDlg;
STDMETHODIMP CEFCMyForm::Create()
{
#ifdef _AFXDLL
AFX_MANAGE_STATE(AfxGetStaticModuleState())
#endif
g_myDlg.Create(IDD_MY_DLG);
}
If I take a Global variable I don't have any problem but if I take mydialog obj as member variable as shown below...
CMydialog m_myDlg;
STDMETHODIMP CEFCMyForm::Create()
{
#ifdef _AFXDLL
AFX_MANAGE_STATE(AfxGetStaticModuleState())
#endif
m_myDlg.Create(IDD_MY_DLG);
} then the ActiveX Controls which are placed on the Dialog are not being Shown.
To resolve this If I try to Dyanamically create the ActiveX controls
CMyDialog::OninitDialog(){-----Using Create Control------ CLSID clsid;
HRESULT hr1 = CLSIDFromProgID(OLESTR("EsdGraphCtrl.EsdGraphControl.3.0"),&clsid) ;
if (FAILED(hr1)) { return FALSE; }
BOOL blnSuccess; CRect rc; rc.left=0; rc.top=0; rc.right= 100; rc.bottom =100;
blnSuccess = m_AxGraphControl.CreateControl(clsid,_T("Graph"),WS_VISIBLE|WS_CHILD,rc,this,100,0,0,0);
if (!blnSuccess)
{ return FALSE; }
}
Any Suggestions would be helpful
Thanks
Today is a gift, that's why it is called the present.
|
|
|
|
|
Hi,
I want to write an activeX control that allows an event to be processed in the container class itself.
So what I want to do is have the ActiveX Control trigger say a Visual Basic Application when data is available. I am looking at ATL to write this, and I was wondering if this is possible with ATL.
If it is, does someone have some simple same code or something to assist me, I am brand new to ATL.
Thanks in advance for any help.
|
|
|
|
|
godspeed123 wrote: I was wondering if this is possible with ATL
Absolutely.
Have a look at ATL examples in MSDN here[^] and as always; CodeProject is a good place to start, e.g. this article[^].
You might also want to browse through the other CP articles in the COM section[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
step 1 : define a class "CMyListViewImpl ".
typedef CWinTraitsOR "WS_BORDER | LVS_REPORT | LVS_SINGLESEL |
LVS_NOSORTHEADER | LVS_SHOWSELALWAYS" CListTraits;
class CMyListViewImpl :
public CWindowImpl "CMyListViewImpl,CListViewCtrl,CListTraits"
//(here " is supposed to "<" and ">", web page can't show "< >" ,
//so i write " after CWindowImpl and CWinTraitsOR )
{
...
};
step2 : in SDI CMainFrame. define a data member "CMyListViewImpl m_list;"
step3 : create listview control :
CMainFrame::OnCreate()
{
...
m_list.Create(m_hWnd,rcDefault);
m_list.InsertColumn ( 0, _T("Macro"), LVCFMT_LEFT, 120, -1 );
m_list.InsertColumn ( 1, _T("Result"), LVCFMT_LEFT, 90, -1 );
m_list.InsertItem(0,_T("1"));
m_list.SetItemText(0,1,_T("D"));
m_hWndClient = m_list ;
}
the creation procedure are listed above,but i can't see the listview .where the bug lies ?(WTL 7.1 ,vc6 )
|
|
|
|
|
Did you call AtlInitCommonControls() ?
|
|
|
|
|
The WS_VISIBLE style might help to see the listview, and the WS_CHILD to position it in the frame.
CMainFrame::UpdateLayout() should be called after m_hWndClient setting.
cheers,
AR
|
|
|
|
|
but it still doesn't work .
would you give me an example code about how to use LISTVIEW in SDI ?
i find some examples written in Dialog programs ,using subclassing controls method.
i just need pure code to see whole creation procedure.
|
|
|
|
|
Launch WTL AppWizard and genereate a SDI application with view type 'ListView'.
cheers,
AR
|
|
|
|
|
Hello everybody.
I get the following errors when compiling a small dialog app. I am using WTL 8.0 with VS 2005, but the same goes if I use 7.5 or 7.1, and I did everything correctly, moving the Platform SDK include to the top of the list in the include options, etc. Any help is appreciated.
Error 94 error C2446: '==' : no conversion from 'int' to 'LPCTSTR' e:\wtl80\include\atlmisc.h 3878
Error 95 error C2040: '==' : 'LPCTSTR' differs in levels of indirection from 'int' e:\wtl80\include\atlmisc.h 3878
Error 96 error C2061: syntax error : identifier 'CHARRANGE' e:\wtl80\include\atlctrls.h 7269
Error 97 error C2061: syntax error : identifier 'CHARRANGE' e:\wtl80\include\atlctrls.h 7282
Error 98 error C2061: syntax error : identifier 'CHARFORMATA' e:\wtl80\include\atlctrls.h 7298
Error 99 error C2061: syntax error : identifier 'CHARFORMATA' e:\wtl80\include\atlctrls.h 7305
Error 100 error C2061: syntax error : identifier 'PARAFORMAT' e:\wtl80\include\atlctrls.h 7324
Error 101 error C2061: syntax error : identifier 'CHARFORMATA' e:\wtl80\include\atlctrls.h 7425
Error 102 error C2061: syntax error : identifier 'CHARFORMATA' e:\wtl80\include\atlctrls.h 7432
Error 103 error C2061: syntax error : identifier 'CHARFORMATA' e:\wtl80\include\atlctrls.h 7439
Error 104 error C2061: syntax error : identifier 'CHARFORMATA' e:\wtl80\include\atlctrls.h 7446
Error 105 error C2061: syntax error : identifier 'PARAFORMAT' e:\wtl80\include\atlctrls.h 7459
Error 106 error C2146: syntax error : missing ';' before identifier 'GetWordBreakProcEx' e:\wtl80\include\atlctrls.h 7490
Error 107 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\wtl80\include\atlctrls.h 7490
Error 108 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\wtl80\include\atlctrls.h 7491
Error 110 error C2146: syntax error : missing ';' before identifier 'SetWordBreakProcEx' e:\wtl80\include\atlctrls.h 7496
Error 111 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\wtl80\include\atlctrls.h 7496
Error 112 error C2061: syntax error : identifier 'EDITWORDBREAKPROCEX' e:\wtl80\include\atlctrls.h 7496
Error 113 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\wtl80\include\atlctrls.h 7497
Error 115 error C2061: syntax error : identifier 'TEXTRANGEA' e:\wtl80\include\atlctrls.h 7502
Error 116 error C2061: syntax error : identifier 'CHARFORMAT2A' e:\wtl80\include\atlctrls.h 7532
Error 117 error C2535: 'DWORD WTL::CRichEditCtrlT<tbase>::GetDefaultCharFormat(void) const' : member function already defined or declared e:\wtl80\include\atlctrls.h 7533
Error 118 error C2061: syntax error : identifier 'CHARFORMAT2A' e:\wtl80\include\atlctrls.h 7539
Error 119 error C2535: 'BOOL WTL::CRichEditCtrlT<tbase>::SetCharFormat(void)' : member function already defined or declared e:\wtl80\include\atlctrls.h 7540
Error 120 error C2061: syntax error : identifier 'CHARFORMAT2A' e:\wtl80\include\atlctrls.h 7546
Error 121 error C2535: 'BOOL WTL::CRichEditCtrlT<tbase>::SetDefaultCharFormat(void)' : member function already defined or declared e:\wtl80\include\atlctrls.h 7547
Error 122 error C2061: syntax error : identifier 'CHARFORMAT2A' e:\wtl80\include\atlctrls.h 7553
Error 123 error C2535: 'DWORD WTL::CRichEditCtrlT<tbase>::GetSelectionCharFormat(void) const' : member function already defined or declared e:\wtl80\include\atlctrls.h 7554
Error 124 error C2061: syntax error : identifier 'CHARFORMAT2A' e:\wtl80\include\atlctrls.h 7560
Error 125 error C2535: 'BOOL WTL::CRichEditCtrlT<tbase>::SetSelectionCharFormat(void)' : member function already defined or declared e:\wtl80\include\atlctrls.h 7561
Error 126 error C2061: syntax error : identifier 'CHARFORMAT2A' e:\wtl80\include\atlctrls.h 7567
Error 127 error C2535: 'BOOL WTL::CRichEditCtrlT<tbase>::SetWordCharFormat(void)' : member function already defined or declared e:\wtl80\include\atlctrls.h 7568
Error 128 error C2061: syntax error : identifier 'PARAFORMAT2' e:\wtl80\include\atlctrls.h 7574
Error 129 error C2535: 'DWORD WTL::CRichEditCtrlT<tbase>::GetParaFormat(void) const' : member function already defined or declared e:\wtl80\include\atlctrls.h 7575
Error 130 error C2061: syntax error : identifier 'PARAFORMAT2' e:\wtl80\include\atlctrls.h 7581
Error 131 error C2535: 'BOOL WTL::CRichEditCtrlT<tbase>::SetParaFormat(void)' : member function already defined or declared e:\wtl80\include\atlctrls.h 7582
Error 132 error C2146: syntax error : missing ';' before identifier 'GetTextMode' e:\wtl80\include\atlctrls.h 7588
Error 133 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\wtl80\include\atlctrls.h 7588
Error 134 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\wtl80\include\atlctrls.h 7589
Error 136 error C2061: syntax error : identifier 'TEXTMODE' e:\wtl80\include\atlctrls.h 7594
Error 137 error C2146: syntax error : missing ';' before identifier 'GetUndoName' e:\wtl80\include\atlctrls.h 7600
Error 138 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\wtl80\include\atlctrls.h 7600
Error 139 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\wtl80\include\atlctrls.h 7601
Error 141 error C2146: syntax error : missing ';' before identifier 'GetRedoName' e:\wtl80\include\atlctrls.h 7606
Error 142 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\wtl80\include\atlctrls.h 7606
Error 143 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\wtl80\include\atlctrls.h 7607
Error 145 error C2061: syntax error : identifier 'GETTEXTEX' e:\wtl80\include\atlctrls.h 7645
Error 146 error C2061: syntax error : identifier 'GETTEXTLENGTHEX' e:\wtl80\include\atlctrls.h 7663
Error 147 error C2061: syntax error : identifier 'SETTEXTEX' e:\wtl80\include\atlctrls.h 7680
Error 148 error C2061: syntax error : identifier 'FINDTEXTA' e:\wtl80\include\atlctrls.h 7821
Error 149 error C2061: syntax error : identifier 'FINDTEXTEXA' e:\wtl80\include\atlctrls.h 7831
Error 150 error C2535: 'LONG WTL::CRichEditCtrlT<tbase>::FindTextA(DWORD) const' : member function already defined or declared e:\wtl80\include\atlctrls.h 7832
Error 151 error C2061: syntax error : identifier 'FORMATRANGE' e:\wtl80\include\atlctrls.h 7841
Error 152 error C2061: syntax error : identifier 'FORMATRANGE' e:\wtl80\include\atlctrls.h 7847
Error 153 error C2535: 'LONG WTL::CRichEditCtrlT<tbase>::FormatRange(void)' : member function already defined or declared e:\wtl80\include\atlctrls.h 7848
Error 154 error C2061: syntax error : identifier 'EDITSTREAM' e:\wtl80\include\atlctrls.h 7872
Error 155 error C2061: syntax error : identifier 'EDITSTREAM' e:\wtl80\include\atlctrls.h 7878
Error 156 error C2143: syntax error : missing ';' before '*' e:\wtl80\include\atlctrls.h 7941
Error 157 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\wtl80\include\atlctrls.h 7941
Error 158 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\wtl80\include\atlctrls.h 7942
Error 160 error C2061: syntax error : identifier 'IRichEditOleCallback' e:\wtl80\include\atlctrls.h 7949
Error 163 error C2446: '==' : no conversion from 'int' to 'LPCTSTR' e:\wtl80\include\atlmisc.h 3878
Error 164 error C2040: '==' : 'LPCTSTR' differs in levels of indirection from 'int' e:\wtl80\include\atlmisc.h 3878
Error 193 error C2872: 'CPoint' : ambiguous symbol e:\microsoft visual studio .net 2005 team edition\vc\atlmfc\include\atlimage.h 199
Error 194 error C2872: 'CPoint' : ambiguous symbol e:\microsoft visual studio .net 2005 team edition\vc\atlmfc\include\atlimage.h 199
Error 222 error C2872: 'CPoint' : ambiguous symbol e:\microsoft visual studio .net 2005 team edition\vc\atlmfc\include\atlimage.h 199
Error 223 error C2872: 'CPoint' : ambiguous symbol e:\microsoft visual studio .net 2005 team edition\vc\atlmfc\include\atlimage.h 199
Most of the problems seems to be in the atlctrls.h, and I did not include UNICODE in the project settings.
Thanks.
|
|
|
|
|
I need a script to get the name or path on a active window opened.This i need to run on a Pop-up Web page opened to display an Image.This image i have uploaded to this site. The Pop-up window does not include a Address to copy the path. I need a VBscript to automatically get the title so the i can put it in clip board.
Praveen
|
|
|
|
|
Hi all,
I am using ATL Dialog for downloading and streaming video from a remote server.
The dialog box is having somany Bitmaps for buttons and other controls as well as a bitmap image as a skin.
Every thing is working fine but if i am downloading a video with more than 1 part(each part will be of 20 secs duration) then the dialog box is not redrawing properly and i have to kill it and re-login.
The downloading process works in a thread.
I am not handling WM_PAINT message.
Can any one help over this.
RAjesh.R
|
|
|
|
|
Hi All,
I am developing a toolbar for Outlook. I have placed an edit box on the tool bar. Now I want that when I change the text in the edit box, I should be able to handle the EN_CHANGE notification. Can somebody tell how this can be done?
Currently when I press the enter key I am able to get the value from the edit box, this is also achievable when I press tab and click with the mouse anywhere else on the screen.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Try by using overiding of Invoke method.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hi,
I need to customize the CEdit control to use character masks. I thought of subclassing but the CEdit controls I need to customize are on a view that is created from scratch, so there is no CEdit resource to attach to with a GetDlgItem. The existing CEdit controls are created with a call to Create().
How can I subclass without a resource?
Thanks,
Merlinos
|
|
|
|
|
merlinos wrote: How can I subclass without a resource?
Use CWnd::SubclassWindow .
BTW, this question is appropriate for VC++ forum.
|
|
|
|