|
|
i have got 85 users i have to store their login details in a file in the encrypted format each time the user selects the save button after providing the details i will be storing into the file in the following way
fpa=fopen(strFilename,"a");
file.open (strFilename);
str="URL="+data1+st+"USERNAME="+user+str1+"PASSWORD="+pwd;
pszDataIn4= new char[str.GetLength ()+1];
strcpy(pszDataIn4, str);
memset(szDataIn4, 0, 96);
memset(szDataOut4, 0, 96);
strcpy(szDataIn4, pszDataIn4);
iBlowFish.Encrypt((unsigned char*)szDataIn4,(unsigned char*)szDataOut4, 96, CBlowFish::ECB);
fputs(szDataOut4,fpa);
fputs("\n",fpa);
this will be done when user cliks on save button each time ;
now i need to decrypt it and show the corresponding details when the user cliks on the particular the next time
i have tried it by reading the whole file and then decryypt it but its not reading the encrypted file
-- modified at 5:32 Tuesday 11th April, 2006
|
|
|
|
|
Hi,
i have new button on sigle click i want a dialog window to open i have declared variables as follows..
can anyone help to solve this problem..??
UpdateDlg.h
#include "StatusDlg.h" // Added by ClassView
#include "CreateDlg.h" // Added by ClassView
private:
CStatusDlg m_dStatusDlg;
class CCreateDlg;
//Then declare a pointer:
CCreateDlg *m_dCreateDlg;
---------------------
// UpdateDlg.cpp : implementation file
//
#include "stdafx.h"
#include "DesktopSearch.h"
#include "StatusDlg.h"
#include "CreateDlg.h"
#include "UpdateDlg.h"
#include "FoldersDialog.h"
void CUpdateDlg::OnNew()
{
// TODO: Add your control notification handler code here
m_dCreateDlg.DoModal();
}
---------------------------------------------------------------
--------------------Configuration: DesktopSearch - Win32 Debug--------------------
Compiling...
UpdateDlg.cpp
D:\Parichay\DesktopSearch\DesktopSearch\UpdateDlg.cpp(182) : error C2228: left of '.DoModal' must have class/struct/union type
Error executing cl.exe.
DesktopSearch.exe - 1 error(s), 0 warning(s)
|
|
|
|
|
parichaybp wrote: m_dCreateDlg.DoModal();
m_dCreateDlg->DoModal();
Nibu thomas
Software Developer
|
|
|
|
|
Hi,
i added the same code m_dCreateDlg->DoModal(); but i am still getting error.
------------------------------------------------------------------
--------------------Configuration: DesktopSearch - Win32 Debug--------------------
Compiling...
UpdateDlg.cpp
D:\Parichay\DesktopSearch\DesktopSearch\UpdateDlg.cpp(184) : error C2027: use of undefined type 'CCreateDlg'
d:\parichay\desktopsearch\desktopsearch\updatedlg.h(58) : see declaration of 'CCreateDlg'
D:\Parichay\DesktopSearch\DesktopSearch\UpdateDlg.cpp(184) : error C2227: left of '->DoModal' must point to class/struct/union
Error executing cl.exe.
DesktopSearch.exe - 2 error(s), 0 warning(s)
|
|
|
|
|
parichaybp wrote: i added the same code m_dCreateDlg->DoModal(); but i am still getting error.
You haven't included the header file...
Nibu thomas
Software Developer
|
|
|
|
|
I have included the header file in both the files
UpdateDlg.h
#include "StatusDlg.h" // Added by ClassView
#include "CreateDlg.h" // Added by ClassView
// UpdateDlg.cpp : implementation file
//
#include "stdafx.h"
#include "DesktopSearch.h"
#include "StatusDlg.h"
#include "CreateDlg.h"
#include "UpdateDlg.h"
#include "FoldersDialog.h"
|
|
|
|
|
parichaybp wrote: I have included the header file in both the files
Why? Including in the header file is enough!
Nibu thomas
Software Developer
|
|
|
|
|
what is the error?? how to fix the error ?? can u plz tell me..
|
|
|
|
|
Whats type CCreateDlg?
and (you wrote)CCreateDlg *m_dCreateDlg; then you should use m_dCreateDlg->DoModal(); m_dCreateDlg.DoModal();
|
|
|
|
|
Hi white sky,
the problem is i have new button in Update dialog window when i click on new button i have to open create dialog window ..
so for that i declared CCreateDlg *m_dCreateDlg; member
can u plz help me solve this error
-----------
UpdateDlg.h
#include "StatusDlg.h" // Added by ClassView
#include "CreateDlg.h" // Added by ClassView
private:
CStatusDlg m_dStatusDlg;
class CCreateDlg;
//Then declare a pointer:
CCreateDlg *m_dCreateDlg;
---------------------------------------
--------------------
// UpdateDlg.cpp : implementation file
//
#include "stdafx.h"
#include "DesktopSearch.h"
#include "StatusDlg.h"
#include "CreateDlg.h"
#include "UpdateDlg.h"
#include "FoldersDialog.h"
void CUpdateDlg::OnNew()
{
// TODO: Add your control notification handler code here
m_dCreateDlg->DoModal();
}
---------------------------------------------------------------
--------------------Configuration: DesktopSearch - Win32 Debug--------------------
Compiling...
UpdateDlg.cpp
D:\Parichay\DesktopSearch\UpdateDlg.cpp(184) : error C2027: use of undefined type 'CCreateDlg'
d:\parichay\desktopsearch\updatedlg.h(58) : see declaration of 'CCreateDlg'
D:\Parichay\DesktopSearch\UpdateDlg.cpp(184) : error C2227: left of '->DoModal' must point to class/struct/union
Error executing cl.exe.
DesktopSearch.exe - 2 error(s), 0 warning(s)
-- modified at 3:33 Tuesday 11th April, 2006
|
|
|
|
|
parichaybp,
I think this code dont work because you declare
CCreateDlg *m_dCreateDlg;
[I think you get a error like this the variable m_dCreateDlg is begin used without.....]
and I again repeat question
whats type CCreateDlg ? (example in header file -> Is class CCreateDlg : public CDialog?or....)
|
|
|
|
|
CreateDlg is Dialog window its same as UpdateDlg both the dialog window i have added using add resources...
|
|
|
|
|
parichaybp
well,
-------------In Main File CssDlg-------------------------
#include "test2.h"
....
private:
class CTest2;
//Then declare a pointer:
CTest2 *m_dlg;
---------------------------
void CssDlg::OnBnClickedButton3()
{
m_dlg.DoModal();
}
d:\Projects\ss\ssDlg.cpp(418): error C2228: left of '.DoModal' must have class/struct/union type
then I use
void CssDlg::OnBnClickedButton3()
{
m_dlg->DoModal();
}
d:\Projects\ss\ssDlg.cpp(418): error C2027: use of undefined type 'CssDlg::CTest2'
d:\Projects\ss\ssDlg.cpp(418): error C2227: left of '->DoModal' must point to class/struct/union
I find your problem delete
private:
class CTest2;//Then declare a pointer:
CTest2 *m_dlg;
--------------------------------------
and you should CTest2 m_dlg;
Now It's work
|
|
|
|
|
Hi whitesky,
its not working .. can u please have a look
private:
CStatusDlg m_dStatusDlg;
// class CCreateDlg;
//Then declare a pointer:
CCreateDlg m_dCreateDlg;
};
-----Error---
--------------------Configuration: DesktopSearch - Win32 Debug--------------------
Compiling...
CreateDlg.cpp
d:\parichay\desktopsearch\updatedlg.h(60) : error C2146: syntax error : missing ';' before identifier 'm_dCreateDlg'
d:\parichay\desktopsearch\updatedlg.h(60) : error C2501: 'CCreateDlg' : missing storage-class or type specifiers
d:\parichay\desktopsearch\updatedlg.h(60) : error C2501: 'm_dCreateDlg' : missing storage-class or type specifiers
DesktopSearch.cpp
d:\parichay\desktopsearch\updatedlg.h(60) : error C2146: syntax error : missing ';' before identifier 'm_dCreateDlg'
d:\parichay\desktopsearch\updatedlg.h(60) : error C2501: 'CCreateDlg' : missing storage-class or type specifiers
d:\parichay\desktopsearch\updatedlg.h(60) : error C2501: 'm_dCreateDlg' : missing storage-class or type specifiers
DesktopSearchDlg.cpp
d:\parichay\desktopsearch\updatedlg.h(60) : error C2146: syntax error : missing ';' before identifier 'm_dCreateDlg'
d:\parichay\desktopsearch\updatedlg.h(60) : error C2501: 'CCreateDlg' : missing storage-class or type specifiers
d:\parichay\desktopsearch\updatedlg.h(60) : error C2501: 'm_dCreateDlg' : missing storage-class or type specifiers
UpdateDlg.cpp
d:\parichay\desktopsearch\updatedlg.h(60) : error C2146: syntax error : missing ';' before identifier 'm_dCreateDlg'
d:\parichay\desktopsearch\updatedlg.h(60) : error C2501: 'CCreateDlg' : missing storage-class or type specifiers
d:\parichay\desktopsearch\updatedlg.h(60) : error C2501: 'm_dCreateDlg' : missing storage-class or type specifiers
D:\Parichay\DesktopSearch\UpdateDlg.cpp(181) : error C2065: 'm_dCreatelg' : undeclared identifier
D:\Parichay\DesktopSearch\UpdateDlg.cpp(181) : error C2227: left of '->DoModal' must point to class/struct/union
Generating Code...
Error executing cl.exe.
DesktopSearch.exe - 14 error(s), 0 warning(s)
|
|
|
|
|
Do you see MSDN for these errors?
it is some helpful to you
|
|
|
|
|
hi whitesky,
Problem is there are 2 Dialog window, in the UpdateDlg dialog when i click on new button it should open create dialog window...
please can u tell me what should be done and how the declaration shd be done ...
|
|
|
|
|
|
you are declaring the pointer in the CreateDlg file for the dialog
That should be done in UpdateDlg.h
that's all
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
Hi,
I have a small problem when using enums with VC++. Although, I use enums a lot with C#, I am having problems using them in VC++. Let me explain.
I have the declaration in the header file:
class CContext <br />
{<br />
private:<br />
<br />
public: <br />
enum ContextType<br />
{<br />
Context1 = 0,<br />
Context2<br />
} ;<br />
<br />
CContextMenu() ;<br />
virtual ~CContextMenu() ;<br />
bool AddContextItems( ContextType cT ) ;<br />
};
Then I have the implementation in the cpp file:
bool AddContextItems( ContextType cT )<br />
{<br />
return true ;<br />
}
But on compilation, I get the error, ContextType undeclared identifier.
Also, when I click on the function AddContextItems in the Workspace explorer window, it says, Cannot find defination(Implementation) of this file. Can you tell me why this happens?
Thanks,
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
-- modified at 1:13 Tuesday 11th April, 2006
|
|
|
|
|
You hvn't given semi colon after(;) the class declaration.
just a guess!
|
|
|
|
|
Oh.. Its there... just forgot to add it...
My mistake...
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
bool CContext::AddContextItems( CContext::ContextType cT )
{
//Do something
return true ;
}
nave
|
|
|
|
|
Although it compiling fine now, I still get the cannot find declaration(implementation) of this file error.
Also, when I try to use the function from another class, I get the error,
error LNK2001: unresolved external symbol "public: bool __thiscall CContext::AddContextItems(enum CContext::ContextType)" (?AddContextItems@CContext@@QAE_NW4ContextType@1@@Z)
Can anyone help me decrypt this mumbo jumbo.... ?
I just can't figure out, what the error means?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
the error comes beause there is no implementation for the function CContext::AddContextItems..
Plz check the cpp that the AddContextItems funtion is written as same as wrote below. I think u haven't noticed the item i have marked bold ..
bool CContext::AddContextItems( CContext::ContextType cT )
{
//Do something
return true ;
}
nave
-- modified at 1:37 Tuesday 11th April, 2006
|
|
|
|