|
Is it easier to create INI file in REGISTRY
then READ/WRITE TO it?
|
|
|
|
|
For your kind of application, the registry shouldn't be used.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Why cant i use registry????
can u tell me please....
im quite IGNORANT abt all these
|
|
|
|
|
Well, you actually can, but you definitely shouldn't.
The registry should be used for maintainig application settings (i.e. few data), not as application general data storage (i.e. big amount of data).
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
i need to find the BEST and EASIEST method to
CREATE/READ/WRITE INI file
|
|
|
|
|
Reading and writing to a INI file it is very simple.
You can easily make a 'test' INI file, using, for instance the notepad , and then write to (or read from) programmatically.
Check out one of the articles I linked in one of my previous replies to see (in the source files) some sample code.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes i did check all those links....
thanks..it was helpful...
but it all tells abt WIN32 CONSOLE Application...
whereas i need.... MFC Application
|
|
|
|
|
For the purpose of read/write to a INI file, the fact it is negligible.
BTW are you able to code a very simple MFC application?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes... i can...
Ive done MFC database programming too....
|
|
|
|
|
anna mathew wrote: Yes... i can...
Wow, like Obama.
anna mathew wrote: Ive done MFC database programming too....
Then shouldn't be difficult for you to have a look at the (console) article and adapt the code to the MFC application. Good luck.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
I went through all the codes and sites....
BUt its all WIN32 CONSOLE application...
what i want is MFC Application...
The other programs i got is
MFC Application.........but...
It just reads an INI file...thats already created...
Im using Visual Studio 2003.....
Visual Studio 2008 supports CIniFile....
but the lower versions dont....
so is there any direct....or easy way to READ/WRITE INI file...
Other than using the CIniFile code availabe in this forum????
|
|
|
|
|
You must redirect the CWinApp application data storage from the registry to your ini file. See the MSDN documentation on CWinApp::m_pszRegistryKey and CWinApp::m_pszProfileName.
By freeing m_pszRegistryKey and setting m_pszProfileName to an appropiate path you will be able to use CWinApp::GetProfileString
CWinApp::GetProfileInt
CWinApp::WriteProfileInt
CWinApp::WriteProfileString
on an ini file instead of the registry.
When I switched my application to use an .ini file, this took me a while to find out. However, it's not likely we are the first people to face this issue ... there must be an example somewhere.
|
|
|
|
|
Yes i read abt it.....
thank you....
I got the right answer that i was looking for
|
|
|
|
|
Hi all,
I am checking this condition in VC2008
if((fp!= NULL) && (fp.m_hFile != 0xFFFFFFFF))
but its giving an error:-
error C2040: '!=' : 'HANDLE' differs in levels of indirection from 'unsigned int'
How can i remove this error?
Thanks in advance
|
|
|
|
|
You need a cast to HANDLE, ((HANDLE)0xFFFFFFFF)
BTW, there is already a definition for this, #define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR)-1)
use INVALID_HANDLE_VALUE.
|
|
|
|
|
VCProgrammer wrote: if((fp!= NULL) && (fp.m_hFile != 0xFFFFFFFF))
(fp && fp->m_hFile!=INVALID_HANDLE_VALUE) maybe works?
|
|
|
|
|
It's easy enough to fix, as mentioned, but why are you doing a
comparison like that?
What type is fp? How can fp be compared to null then have a dot operator
used on it?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: What type is fp?
It likely belongs to CFile .
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
|
Well, Mark. It's time again for you to be reminded: "Some questions are really tough out here".
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi,
I try to build up a monitoring system, which shows me all opened files and the process ids, using this files.
All opened files mean not only the exe and dlls but .cpp , .h, .pdf, .doc, etc...
I get either the process id using a driver and "NtQuerySystemInformation" function or get the files by using "ReadDirectoryChanges".
So, how can I get the association between them? Is there a way to get it by the driver or is there any winapi function which gives me the pid and open files (not only processes and modules) together.
Thank you in advance for any hints, code or examples.
Marco
|
|
|
|
|
Marco14 wrote:
Thank you in advance for any hints, code or examples.
How about NetFileEnum() ?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hhmm, I'll take a look.
Thank you!
|
|
|
|