|
Again, as I said to you, many, many, many, many, many times, the registry shouldn't be polluted with such kind of info.
That said, if you really, badly, want to do that, it is not difficult, really.
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]
|
|
|
|
|
You use the registry to store application related information in it (application settings, usually). An INI file should be OK-ish, but then you would be better of using a database if you expect the data to grow over the time.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi all,
i m using a TreeCtrl in CTreeView Derived class.
use this to insert item in TreeCtrl.
void CSideTree::OnInitialUpdate()
{
CTreeView::OnInitialUpdate();
CTreeCtrl& trCtrl = GetTreeCtrl();
trCtrl.ModifyStyle(0,WS_VISIBLE | WS_CHILD | WS_BORDER| WS_TABSTOP|TVS_HASBUTTONS|TVS_LINESATROOT |TVS_INFOTIP);
HTREEITEM parent1=trCtrl.InsertItem( _T("Parent1"),TVI_ROOT );
trCtrl.InsertItem(_T("Child1"),2,2,parent1);
trCtrl.InsertItem(_T("Child2"),2,2,parent1);
trCtrl.InsertItem(_T("Child3"),2,2,parent1);
trCtrl.InsertItem(_T("Child4"),2,2,parent1);
HTREEITEM parent2=trCtrl.InsertItem( _T("Parent2"),TVI_ROOT );
trCtrl.InsertItem(_T("Child5"),2,2,parent2);
trCtrl.InsertItem(_T("Child6"),2,2,parent2);
trCtrl.InsertItem(_T("Child7"),2,2,parent2);
trCtrl.InsertItem(_T("Child8"),2,2,parent2);
}
Here if i select any item than it diplayed in blue box i mean display selected.
but the blue box size is greater than the size of item text in case of parent selection, and in case of selection of child the blue box size is proportianate to child item text.
if this possible to show selected employee blue box according to its text.
please help me for this.
thank in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
I've looked at a tree control I have in my code, with linesatroot set.
Selecting a root item gives my the same sort of selection as selecting a child item. The blue background is a *little* bigger than the text, but going no wider than that.
Try putting a tree on a dialog, and using different styles in resource editor's preview to see the selections there.
Then have a look at your CTreeView's constructor, and follow it down to CCtrlView::CCtrlView's constructor and see what styles are used. You may see something that shows a difference.
Iain.
|
|
|
|
|
I m using it in SDI type application.
i have no idea of CCtrlView class,
please tell me how can solve this.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
"_$h@nky_" wrote: i have no idea of CCtrlView class, please tell me how can solve this.
Then GET an idea about it. Look in your CMyApp::InitInstance function, and you'll see that your program uses the CTreeView class. Look in the documentation (MSDN), search for CTreeView, and you'll see that it inherits from CCtrlView, which in turn inherits from CView.
You can search the source directorys for MFC for CTreeView::CTreeView and put a breakpoint in the constructor. That should help you see the path of creation of your view class.
Iain.
|
|
|
|
|
thanks.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi All,
Is there any C++ library (free software or open source) for PDF
creation, other than PDFLib? [ PDFLib is good but it puts a watermark
across the PDF output.]
I'm looking for such a library to use for:
Doing PDF generation from C++.
Thanks & regards,
Anitha
|
|
|
|
|
|
Hi,
I know C++ but I am very new to Visual Studio, I want to develop a simple windows application with basic controls like text boxes, buttons, grids etc. and there will be communication to com port (serial port).
But when I saw the new Visual Studio 2008 Express Editions, I am confused what to use. I need your advice on what tool of these express editions needs to be used for developing the application i said.
What kind of development kit would I need?
And let me know if this is the right message board i am using or i need to post this message in some other message board.
Thanks a lot for your time and Knowledge Sharing.
Karmendra
|
|
|
|
|
You may use profitably Visual C++ 2008 Express Edition to build such GUI applications.
However you should use Win32 API for the purpose, since the MFC framework is not included in the Express Edition of Visual Studio .
If you select a new Win32 Project , Visual Studio kindly generates the code of a basic, working, GUI application for you.
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]
|
|
|
|
|
Hi,
I am having a CRichEditCtrl that is able to display bitmaps.
I want it to display the urls as hyperlinks.
My application in in mfc.
Please help me to achieve this.
Thanks.
Dhiraj
|
|
|
|
|
|
Send the control the EM_AUTOURLDETECT message.
"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
|
|
|
|
|
|
izyani wrote: CryptAcquireContext returned error 80090019
CryptAcquireContext doesn't return an error code.
The 80090019 error can also indicate the key container doesn't exist.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
i run the test sample program..
i took it from cspdk code that i've downloaded from internet.. the same thing also..
C:\WINDOWS\system32>testcsp.exe
Calling CryptAcquireContext - CryptAcquireConext returned error 80090019
FAILED
|
|
|
|
|
hey i am making a program in which i want so save some data inside
the exe being executed also please give me some code examples
for saving data as well as using encription
|
|
|
|
|
akshay.is.gr8 wrote: please give me some code examples
list of rants
- This forum doesn't work that way.
- There's an article search engine, here at CodeProject[^].
- There's your best friend, Google [^].
- Microsoft kindly expose documentation online [^].
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]
|
|
|
|
|
Hi,
I want to know how to display name of selected file. If user seelcted any file (test.doc) in windows explorer is there any way my application can find out the selected file name.
Thanks
jhghjghj
|
|
|
|
|
I think this[^] will help you.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Thanks for your reply.
I am using VC++ 6.0 and need code developed in VC++ 6.0. Can you pls provide the demo source code that you may have developed for VC++ 6.0. Because the urls that you provided requires to download Windows® Server 2003 SP1 Platform SDK, which is currently not possible from this end.
Or is it mandatory that any one of (Windows® Server 2003 SP1 Platform SDK / Windows® Server 2003 SP1 Platform SDK Full Download) these download needs to be install on my m/c to compile the demo code that provided.
Thanks
SNI
jhghjghj
|
|
|
|
|
You should better post those questions on the message boards of the article itself.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Please help me.....
my sectionname is same as the name entered....
my code:
void CFileINIDlg::OnBnClickedInsert()
{
const CString szINIFILE = ("C:\\FileINI.ini");
//Accept name , address and phone no from edit box
m_Name.GetWindowText(Name);
m_Ad.GetWindowText(Address);
m_Phone.GetWindowText(Phoneno);
CT2A sectn = Name;
int cmp;
int cmpflag=0;
char message[4096];
strcpy (message, "Entries :\n\n"); //Initialize
LPTSTR lpszReturnBuffer;
lpszReturnBuffer = new TCHAR[MAX_PATH];
char* pNextSection = NULL;
GetPrivateProfileSectionNames(lpszReturnBuffer,MAX_PATH,szINIFILE);
pNextSection = lpszReturnBuffer;
strcat(message, pNextSection);
while (*pNextSection != NULL)
{
//to avoid overwriting entries with same section name
cmp = _stricmp(sectn, pNextSection);
if(cmp==0)
cmpflag= 1;
else
cmpflag=0;
pNextSection = pNextSection + strle(pNextSection) + 1;
if(*pNextSection != NULL)
{
strcat(message, "\n");
strcat(message, pNextSection);
}
}
sprintf(message,"%s\n CMP %d\n FLAG %d \n", message, cmp, cmpflag);
MessageBox(message);
if(cmpflag==1)
MessageBox("ERROR - DUPLICATE");
else if(cmpflag==0)
{
WritePrivateProfileString(Name, "Name", Name, szINIFILE);
WritePrivateProfileString(Name, "Address", Address, szINIFILE);
WritePrivateProfileString(Name, "Phone", Phoneno, szINIFILE);
}
}
Im writing the values entered to the INI file.....
I want to prevent overwritng an entry ...that has
the same section name.......
if sectionname is same....i reject the entries insertion to INI file...
my code compiles.....
but strcmp() is not working.....
it always returns 1.....
how do i correct it?
modified on Wednesday, November 5, 2008 3:35 AM
|
|
|
|
|
Use your debugger and check the contents of the strings.
BTW, if you need to post code, please use the code tags, it makes your code much more readable (check also the posting guidelines at the top of this forum).
|
|
|
|
|