|
Hi,
How can i find the selected row and read the cell values with mouse click event using the MS DataGrid v6 ActiveX Control ?
Regardsm
sdancer75
|
|
|
|
|
Hi all
Can any one post a sample source code for counting the number of children excluding the grand children in a particular node in a Tree
Lovekesh
|
|
|
|
|
If I understand your question correctly you want to count the immediate children of a node. If this is the case code like this should do it:
UINT Count = 0;
HTREEITEM hItem = m_Tree.GetChildItem(hRootItem);
while (hItem != NULL)
{
++Count;
HTREEITEM hNextItem = m_Tree.GetNextSiblingItem(hItem);
}
NOTE: I haven't actually tried this! Assumes you're using MFC (although it is easily adaptable if you're not).
Steve
|
|
|
|
|
Hi steven
the above code is not working
the while loop is iterating continously and it is not at all terminating
can u suggest me why it is happening
-- modified at 9:57 Saturday 28th January, 2006
|
|
|
|
|
Oops, it should look like this:
UINT Count = 0;
HTREEITEM hItem = m_Tree.GetChildItem(hRootItem);
while (hItem != NULL)
{
++Count;
hItem = m_Tree.GetNextSiblingItem(hItem);
}
Steve
|
|
|
|
|
Hi stephen
I ve written another code for my problem it works for me
but if i want to retreive the child including its children
and to retreive parent of a child
how the code willbe look like
-- modified at 4:13 Sunday 29th January, 2006
|
|
|
|
|
I want a MDI app withOUT a menu, any menu.
With a SDI all I have to do is override PreCreateWindow() as follows:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.hMenu = NULL; // no menu
return CFrameWnd::PreCreateWindow(cs);
}
This will not work for MDI (vs. SDI). Any ideas?
|
|
|
|
|
In the app after mainframe creation
m_poMainFrame->SetMenu(NULL);
In a custom CMdiClient intercept and eat
ON_MESSAGE(WM_MDISETMENU , OnMDISetMenu )
ON_MESSAGE(WM_MDIREFRESHMENU, OnMDIRefreshMenu)
|
|
|
|
|
HI joey Bloggs!
thank you for your reply!
i add the SetMenu(NULL).it works!@thank you very much,
but still has problems..
I add the micros to the ChildFrame as you metioned manually(there isn't WM_MDISETMENU message in my class wizard of VC6)as follow:
in the childfrm.cpp:
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
ON_MESSAGE(WM_MDISETMENU , OnMDISetMenu )
ON_MESSAGE(WM_MDIREFRESHMENU, OnMDIRefreshMenu)
END_MESSAGE_MAP()
and int the childfrm.h i add :
afx_msg void OnMDIRefreshMenu();
afx_msg void OnMDISetMenu();
but int the functions OnMDISetMenu() and OnMDIRefreshMenu(),it can't receive the message WM_MDISETMENU and WM_MDIREFRESHMENU!
could you explain it detailedly?
thanks a lot!
|
|
|
|
|
It's not ChildFrame it's MDIClient that you need to customise
class CMdiClient : public CWnd<br />
{<br />
.<br />
.<br />
.<br />
afx_msg LRESULT OnMDIMaximize (WPARAM wParam, LPARAM lParam);<br />
afx_msg LRESULT OnMDIRestore (WPARAM wParam, LPARAM lParam);<br />
afx_msg LRESULT OnMDISetMenu (WPARAM wParam, LPARAM lParam);<br />
afx_msg LRESULT OnMDIRefreshMenu(WPARAM wParam, LPARAM lParam);<br />
}
Then make CMdiClient a member of MainFrame and subclass it in the create
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)<br />
{<br />
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)<br />
{ <br />
return -1;<br />
}<br />
<br />
if (!m_oMdiClient.SubclassWindow(m_hWndMDIClient))<br />
{<br />
MYTRACE(_T("Failed to subclass MDI client window\n"));<br />
return -1;
}<br />
-- modified at 1:53 Tuesday 11th April, 2006
|
|
|
|
|
Hai,
I am struggling, not able to put IStream object into IDataObject.Here is the code snippet.I get error at set data line as Access Violation.Pls help me
LPDATAOBJECT pDO ;
FORMATETC fmtetc = {0};
fmtetc.cfFormat = CF_TEXT;
fmtetc.dwAspect = DVASPECT_CONTENT;
fmtetc.lindex = -1;
fmtetc.tymed = TYMED_ISTREAM;
fmtetc.ptd = NULL;
//STGMEDIUM definition
STGMEDIUM medium = {TYMED_ISTREAM,NULL,NULL};
medium.tymed = TYMED_ISTREAM;
medium.pstm->AddRef();
//error in this line during execution
pDO->SetData(&fmtetc,&medium,TRUE);
Saravana Kumar
|
|
|
|
|
saravana pandy wrote: STGMEDIUM medium = {TYMED_ISTREAM,NULL,NULL};
medium.tymed = TYMED_ISTREAM;
medium.pstm->AddRef();
Where is pstm set - It should be a pointer to a stream. I would think this code would crash when you call AddRef as you're calling it on a NULL pointer.
Steve
|
|
|
|
|
Yes the progam crashes at that point.
How to set the pointer to the Stream.
If i give the pointer to the stream it throws error as
'initializing' : cannot convert from 'struct IStream' to 'struct HBITMAP__ *'
I just give like this:
LPSTREAM lpStream = NULL;
.
.//Write some data into stream
.
STGMEDIUM medium = {TYMED_ISTREAM,lpStream,NULL};
medium.pstm = lpStream;
Saravana Kumar
-- modified at 7:23 Saturday 28th January, 2006
|
|
|
|
|
Here's how I'd do it:
STGMEDIUM medium;
medium.tymed = TYMED_ISTREAM;
medium.u.pstm = lpStream;
lpStream->AddRef();
medium.pUnkForRelease = NULL;
Steve
|
|
|
|
|
Hai stephen,
Thanks for reply.
Wht is that medium.u.pstm?
I dnt get any thing called medium.u
Instead i set value as
medium.pstm = lpStream
lpStream->AddRef();
It gives me the same exception as access violation at
LPDATAOBJECT pDO;
FORMATETC fmtetc = {0};
fmtetc.cfFormat = CF_TEXT;
fmtetc.dwAspect = DVASPECT_CONTENT;
fmtetc.lindex = -1;
fmtetc.tymed = TYMED_ISTREAM;
fmtetc.ptd = NULL;
//Access violation exception 0xC0000005
pDO->SetData(&fmtetc,&medium,TRUE);
Can u please point out where i am going wrong?
Thanks for ur help.
Saravana Kumar
|
|
|
|
|
Did you NULL out "pUnkForRelease" and set "tymed" like in the code below?
STGMEDIUM medium;<br />
medium.tymed = TYMED_ISTREAM;<br />
medium.pstm = lpStream;<br />
lpStream->AddRef();<br />
medium.pUnkForRelease = NULL;<br />
Steve
|
|
|
|
|
Yes.Here is the code part using IDataObject:
LPDATAOBJECT pDO;
//FORMATETC definition
FORMATETC fmtetc = {0};
fmtetc.cfFormat = CF_TEXT;
fmtetc.dwAspect = DVASPECT_CONTENT;
fmtetc.lindex = -1;
fmtetc.tymed = TYMED_ISTREAM;
fmtetc.ptd = NULL;
//STGMEDIUM definition
STGMEDIUM medium ;
medium.tymed =TYMED_ISTREAM;
medium.pstm = lpStream;
lpStream->AddRef();
medium.pUnkForRelease = NULL;
pDO->SetData(&fmtetc,&medium,TRUE);
Is there any thing i have to add before setdata()?
Saravana Kumar
|
|
|
|
|
I can't see anything obviously wrong here. Can you send the machine code around the instruction that is causing the crash and a stack trace?
Steve
|
|
|
|
|
i have to give a presentation on any rescent trends in IT... can anyone suggest a good title... thanks-V.G
|
|
|
|
|
"Beauty & the Beast" (lucrative but dangerous)
"Earn like kings & live like Queens" (more salary, posh living)
"Respected Career" (b4 only docs & engrs were respected, now IT guys also)
Best Regards,
Bobby
|
|
|
|
|
Hi,
I'm running this package at http://www.codeproject.com/audio/featuretracking.asp in visual studio.net and encountering the following problem:
c:\featuretracking_src\Tracker.rc(436): fatal error RC1015: cannot open include file 'res\Tracker.rc2'.
Please help.
Thanks & Regards
Anish chowdhri.
|
|
|
|
|
Look for the file "c:\featuretracking_src\res\Tracker.rc2". Is it present?
Steve
|
|
|
|
|
Hi Steve,
Thanks for your response.
When I downloaded this package it did not have any 'res\Tracker.rc2'.
But when I try to run this package it certainly asks for it.
Is the file missing from the package?
<<if you="" want="" can="" have="" a="" lok="" at="" the="" package="" "http:="" www.codeproject.com="" audio="" featuretracking.asp"="">>
Thanks & Regards
Anish chowdhri.
|
|
|
|
|
|
Hi Steve,
Thanks for your help. I too think that a file is missing from the package. But there is no such comment on the page where this package is released. There are only +ve comments.
Please help.
Thanks & Regards
Anish chowdhri.
|
|
|
|