|
vipin_nvk wrote: Is there a way other than .ini file and "registry" where in the applicaiton information can be stored and used in between applicaiton sesstions.
An XML file, for instance.
If you're using MFC, and you application is truly OO, then have a look at MFC Serialization http://msdn2.microsoft.com/en-us/library/6bz744w8(VS.80).aspx[^], a quite powerful tecnique.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
why do you care the files are readable ? if the users modify it, it's their problem, not yours
|
|
|
|
|
The purpose of .ini file is to facilitate the user to change environment settings, with out rebuilding the application.
I don't understand what security threat you will have until and unless some passwords are present in .ini file. Anyways password can also be encripted and stored in .ini file.
|
|
|
|
|
i'm not the OP... are you sure you wanted to say that to me ?
|
|
|
|
|
nope. that reply was not intended to you Mr toxcct. Actually I am suporting all your suggestions, adding mine at the same time.
I know what will happen being rude to some one like you, senior member of this DB
|
|
|
|
|
You are right toxcct.
Well, no one (I am talking about non-stupid guy) is editing the Registry information unless it is clearly known to him that what exactly he is doing. Or they are taking the backup of the registry before editing.
About readability, configuration setting is not a NASA project that needs to be so secure.
Anurag Gandhi.
http://www.softgandhi.co.nr
|
|
|
|
|
Whatever you are doing, ultimately you are saving the information in the hard disk in one way or the other.
I may be a Registry Database, Sql server database, an XML file, a text file format or ini file.
I will suggest use windows registry because it is very easy to use. Don't waste your time and energy in thinking about these logics unless your requirement is completely different and registry can't serve the purpose.
Anurag Gandhi.
http://www.softgandhi.co.nr
|
|
|
|
|
You could encrypt the ini file after it's written, and decrypt it before it's read.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
There's nothing necessarily wrong with INI files.
Where you put the file is an issue these days.
With a secure system, your app's directory should not be accessible to a non-administrator
user. Same with the registry, particularly the HKEY_LOCAL_MACHINE tree where you'd put
configuration settings for all users.
The recommended method these days is to use a configuration file (INI is fine, XML is fashionable)
and store it in an appdata/common appdata folder
(e.g. C:\Documents and Settings\All Users\Application Data\<company name>\<product name>\<product version>\)
There are Shell APIs available to retrieve paths of these common directories.
Your app's data folder can be set to allow access by all users at install time.
This is detailed in the Windows Logo requirements.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hi...
i have developed a MFC application of syntax colorising editor from the procedure given here(by using scintillawnd class and from dll SciLexer.dll),but i want to use it for my own language for which lexer is not available.
so have added a new cpp file(Lexxxx.cxx) to scitilla/src directory.
now..problem is how i have to link with this SciLexer so that it work for my own language,and how i have to rebuild SciLexer.dll .
plase any one help to solve out this problem..
i have gone through the documentation ...but i cant understand the procedure given there...please help me..
please help...thanx in advance
|
|
|
|
|
hi every one
do you know how can emplement interrupts in windows whit assembly?
|
|
|
|
|
Do you want to use assembly on c++ like this:
__asm
{
move al,2
}
|
|
|
|
|
__asm int 3;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
template<typename V>
class num
{
IMP_EXP __stdcall num() ;
IMP_EXP __stdcall ~num() ;
IMP_EXP __stdcall Print( V Val ) ;
}
template< typename V> IMP_EXP __stdcall num< V >::num()
{
}
template< typename V> IMP_EXP __stdcall num< V >::~num()
{
}
template< typename V> IMP_EXP __stdcall num< V >::Print( V Val )
{
printf( "%d" , Val ) ;
}
//// dll
i put the following code on a dll that exprts this class members.
/////exe
void main()
{
num <long> obj ;
obj.Print( 10 ) ;
}
////
i tried to import it from exe then the compiler displays error 2019 : unresolved external symbol.. this is my first template program.
one more question is this syntax are correct ?
how to solve this problem ?
plz help me
-- modified at 1:50 Thursday 2nd August, 2007
|
|
|
|
|
Seems like the template code is right.
executable can not identify the functions of dll. Did you added respective lib file Projects > Settings > Link > Object/Library modules. And include the header file and place the dll in the same path as exe.
Hope this might help
|
|
|
|
|
ive included the header file and ilb correctly. other classes imported from that dll are working .. i think the problem is exporting ..
|
|
|
|
|
I think the problem is including the template in the dll itself
A template generates code when it is instantiated. So, how are you going to put that inside the DLL?
If you are distrubuting template, write both declaration and definition in one header file, and just share it across projects. No need of dll and lib
Hope I make sense here!!!
|
|
|
|
|
|
When the CFileDialog class is created for a File Open operation, the user can double click in the list view to either select a file or change directories. Before the class processes the double click to perform one of these functions, how can I intercept this double click event?
I have tried to use a message map of ON_WM_LBUTTONDBLCLK(), but the code still never hits the CMyFileInputDlg::OnLButtonDblClk(UINT nFlags, CPoint pt) function. What am I missing?
|
|
|
|
|
To catch the event of CFileDialog, you need to create your own Class with the base class of CFileDialog.
There, you can override the event handlers or functions and can do whatever you want.
Creating your own Dialog is also a solution if your purpose is very specific.
Anurag Gandhi.
http://www.softgandhi.co.nr
|
|
|
|
|
I have actually done that, but it still does not trigger the double click event.
CMyFileInputDlg::CMyFileInputDlg(CWnd* pParent/* = NULL*/)
: CFileDialog(TRUE, NULL, NULL, OFN_EXPLORER | OFN_ENABLEHOOK | OFN_HIDEREADONLY | OFN_ENABLEINCLUDENOTIFY | OFN_SHOWHELP , NULL, pParent)
I still wish to use the base CFileDialog class.
|
|
|
|
|
from the MSDN Library "The hook procedure does not receive messages intended for the standard controls of the default dialog box. You can subclass the standard controls, but this is discouraged because it may make your application incompatible with future versions."
This means you can't do any processing in response to the double click event, without jumping through hoops that are not recommended. What you can do is provide handlers for :-
CMyFileInputDlg::OnLBSelChangedNotify
CMyFileInputDlg::OnFileNameChange
CMyFileInputDlg::OnFolderChange
CMyFileInputDlg::OnFileNameOK
|
|
|
|
|
Roger,
Thanks for this. The evidence suggests that this is what is happening. If I use the Old Style rather than Explorer style, I may catch the double click event? It still doesn't seem to work though.
|
|
|
|
|
Did you use of OFN_ENABLEHOOK and did you set lpfnHook ?
From the MSDN:
"If the OFN_EXPLORER flag is not set in the Flags member, lpfnHook is a pointer to an OFNHookProcOldStyle hook procedure that receives messages intended for the dialog box"
|
|
|
|