|
rajeevktripathi wrote: void COEPATHDlg::InsertKeyIntoTree(HTREEITEM htRootKey,CString strCurString,HKEY hCurKey)
{
m_RegistryTree.InsertItem(strCurString,NULL,NULL,htRootKey);
}
you forget to store the returning HTREEITEM handle in required variable
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi
Here I have been stucked in maintaining HTREEITEM for all the Registry keys because every time InsertKeyIntoTree( ) is called htRootKey is passed so each key is inserted at the same level
So please tell me that how can I maintain HTREEITEM for all the keys so that when I pass it to the InsertKeyIntoTree( ) it get place at the desired location in the hierarchy.
Please reply.
Thanks.
|
|
|
|
|
rajeevktripathi wrote: So please tell me that how can I maintain HTREEITEM for all the keys so that when I pass it to the InsertKeyIntoTree( ) it get place at the desired location in the hierarchy.
Here is small logic :-
1. Change Signature of the InsertKeyIntoTree function to return the HTREEITEM handle.
2. Now when you Insert the Parent, store the Keys into some Data structure
3. otherwise pass that key as Parent Paramter to then Tree Ctrl
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Dear members hi
Thanks for your advises, now I have been able to to generate the tree as desired.
Once again thanks
Bye
rajeevktripathi
|
|
|
|
|
I need to develope my app using Visual C++ and MFC
But then i have dificulties in learning its classes
any idea where i could obtain any reference from web which can help to know about MFC classes
|
|
|
|
|
|
|
TBBUTTON tbb;
memset(&tbb, 0, sizeof(tbb));
int iString = m_mytoolbar.GetToolBarCtrl().AddStrings(_T("About"));
tbb.iString = iString;
tbb.fsState = TBSTATE_ENABLED;
tbb.fsStyle = TBSTYLE_AUTOSIZE;
tbb.iBitmap = 0;
tbb.idCommand = ID_ABOUT;
tbb.dwData = 0;
VERIFY(m_mytoolbar.GetToolBarCtrl().AddButtons(1, &tbb));
I created a toolbar used TBBUTTONs.But I found that I can't get the button text.
I used GetString and GetButtonText. But the compiler said that they were all undeclared.
What's wrong?
Thank you!
|
|
|
|
|
strText = m_mytoolbar.GetButtonText(m_nButtonIndex);
I used GetButtonText,but the strText is always NULL.
|
|
|
|
|
Tcpip2005 wrote: I used GetButtonText,but the strText is always NULL.
Use
CToolBarCtrl::GetButtonInfo::GetButtonInfo( int nID, TBBUTTONINFO* bbi );
it's bbi pointer contain the Button text Information!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Take a look at the CToolBarCtrl Class Members[^] topic in the MSDN. The GetButton member returns information about buttons. It doesn't look like any of the members return the text assigned to a button directly. I have a feeling it's simpler to just remember the text you assign when you create the control.
Software Zen: delete this;
|
|
|
|
|
Hi to All,
How can I make my Exe as a service using VC++. that service should appear in Services of Administrator tools and that should start when the system is boot up and should appear in system tray icon to tell that it is started. Can anybody help in this regard.
Thanks in advance.
|
|
|
|
|
|
I have used DialogBar in my application on which i have few Dropdown listbox,
i dynamically create and destroy the DlgBar depending the option selected
by the user.
The problem is that the DlgBar is not visible when i creat it ,
i tried
AfxGetMainWnd()->RedrawWindow();
AfxGetMainWnd()->Invalidate (TRUE);
But it donot work .............
When i minimise and maximise the application then i can see the DlgBar
by using this code.
AfxGetMainWnd()->ShowWindow(SW_MINIMIZE);
AfxGetMainWnd()->ShowWindow(SW_MAXIMIZE);
Can anyone point out what i am missing .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I'll assume you mean a control bar.
You could try: CFrameWnd::ShowControlBar(CControlBar* pBar, BOOL bShow, BOOL bDelay);
INTP
Every thing is relative...
|
|
|
|
|
Whoops!
A Dialog bar is derived from a control bar, so ShowControlBar is probably the corrent function to use.
INTP
Every thing is relative...
|
|
|
|
|
error C2039: 'ShowControlBar' : is not a member of 'CDialogBar'
its not the member of the DlgBar class
Can u tell me the way that will Repaint the
Main window in any conditon .
I think i will have to try that because when i
minmise and maxime the mainwindow the dlgbar
show its presence .
AfxGetMainWnd()->RedrawWindow();
AfxGetMainWnd()->Invalidate (TRUE);
AfxGetMainWnd()->UpdateWindow ();
this->PostMessage (WM_ERASEBKGND ); this dont work
I have already tried this things;
Thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
ShowControlBar() is a member of CFrameWnd from which your main frame window is derived. Therefore you would probably call it like this:
AfxGetMainWnd()->ShowControlBar((CControlBar*)pMyDlgBar,TRUE,0);
Why? Because CDialogBar is derived from CControlBar .
vikas amin wrote: Can u tell me the way that will Repaint the
Main window in any conditon
First should call Invalidate() before you call RedrawWindow() .
AfxGetMainWnd()->Invalidate();
AfxGetMainWnd()->RedrawWindow();
When dealing with control bars and dialog bars this might help:
AfxGetMainWnd()->RecalcLayout();
INTP
Every thing is relative...
|
|
|
|
|
Thank you
AfxGetMainWnd()->ShowControlBar((CControlBar*)pMyDlgBar,TRUE,0);
it solved my problem by setting the second parameter TRUE/FALSE
we can change the visibility of the Dlgbar
ok
On this link you will find the new free courses
offered by microsoft for VS2005.
http://www.financialexpress.com/latest_full_story.php?content_id=107645
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
-----> hr = db.Open(_T("SQLOLEDB.1"), dbinit);
if (FAILED(hr))
{AfxMessageBox("Failed To Connect Datasource"); }
My code is terminating on above line please help.
Actually senior programmer who developed code left for me to debug
help.
|| ART OF LIVING ||
|
|
|
|
|
please answer my above question
|| ART OF LIVING ||
|
|
|
|
|
42
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Will you join conversation to solve problem
|| ART OF LIVING ||
|
|
|
|
|
You're question doesn't have enough information to make sense, or expect a usefull answer.
You posted about 50 lines of code but the error is on the 3rd line - why do we need to see the rest at this point.
There are many things that could be wrong that have nothing to do with the code.
You should check that the database is setup right and explain what you have checked.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Send the details pls
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|