|
Ah - you want the sub-item that the user clicked on!
The selection model for lists only includes selected rows, not columns. This means that what you need to do is handle the NM_CLICK notification[^] for the list view. This notification contains a pointer to an NMITEMACTIVATE structure[^] which contains details of where the click occurred, including the sub-item. You can then store that sub-item as the 'last-clicked sub-item'?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Hello,
I have a project without Doc-View Architecture.I have ChildFrame derived from CMDICildWnd and ChildView1 derived from CView .When a new window is made it is made properly but when I want to close the window I get Debug Assertion failure.
When I debugged the program the problem is with the destructor of the ChildView.
I have another ChildView2 derived from CWnd but there is no problem in closing this window.
How should I go about rectifying the destructor ?
Prithaa
|
|
|
|
|
Debugger is your best friend...
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]
|
|
|
|
|
Hello,
Thanks for your answer.
But I wanted to ask you if creating a ChildView derived from CView must have created a problem since the basic project's view is derived from CWnd which works fine.
And why is it that the view's destructor causing a Debug Assertion ?
Pritha
|
|
|
|
|
prithaa wrote: But I wanted to ask you if creating a ChildView derived from CView must have created a problem since the basic project's view is derived from CWnd which works fine.
Form experimental point of view your code has (at least) a problem.
prithaa wrote: And why is it that the view's destructor causing a Debug Assertion ?
You probably won't know that, since you apparently are not using the debugger as suggested.
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]
|
|
|
|
|
Hello,
Thanks for your answers.
You probably won't know that, since you apparently are not using the debugger as suggested.
How is the debugger to be used ?
Pritha
|
|
|
|
|
prithaa wrote: How is the debugger to be used ?
Like a debugger, I suppose.
You should reach the offending line, try to understand why it is offending, and so on...
You may also get a better help from us if you give us more details (and the debugger usually help in finding such details).
Moreover 'Debug assertion failure' isn't much informative. Why it is asserting (i.e. what's asserted?)? . You're hiding information.
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]
|
|
|
|
|
|
What do you mean exactly by start ? If you put the loop, your program will never end (well, that seems to be obvious). I don't really understand your question.
|
|
|
|
|
vctrlao wrote: as the program below,when I click the .exe file it starts very slow,but if I delete the endless loop it can start very quick,why??
How can you see that?
What's the purpose of the experiment (just curiosity)?
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]
|
|
|
|
|
|
No, not on a windows platform. Anyway, even having a resolution of 1msec is not possible because windows is not a real time operating system.
|
|
|
|
|
And see Timers in MFC / C++[^]and Timers Tutorial[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
My application is MDI.but we modified the precreatewindow and using as single window applicaiton.
And we transfer to different window using menu or pageup,page down.
For ex,i have 5 pages of graphics window showing some animation and index of all five pages as index window.By clciking the topics in index,the new window will appear and we destroy the prevoius window.I draw the window details in OnDraw().
But now i want some graphics window appear as popup with close button.So i set flag for tht particular window and i set setwindowpos()...But its now flcikering...
I dnt know wat to do...
Code:
Same window:
---------------
///Clciking function in Index page
{
.
.
.
.
if( gpGView->glg_animation[giSchPNo].m_hWnd )
{
gpGView->glg_animation[giSchPNo].DestroyWindow();
giSchPNo = iPanNo - FirstGraph();// - 1;
giSchPNo = giGraphicCnt;
return;
}
Then it goes to Ondraw() and draw the window.
As Popup:
----------
///Clciking function in Index page
if(help==1) ////shown as popup
{
if( gpGView->glg_animation[giSchPNo].m_hWnd )
{
////gpGView->glg_animation[giSchPNo].DestroyWindow();
giSchPNo = iPanNo - FirstGraph();// - 1;
giSchPNo = giGraphicCnt;
return;
}
}
in Ondraw() i add this line
((CGraphView *)(((CMainFrame *)AfxGetMainWnd())->pDisplayedViews[6]))->glg_animation[giSchPNo].SetWindowPos(HWND_TOP,(GetSystemMetrics(SM_CXSCREEN)/2) - (480/2),(GetSystemMetrics(SM_CYSCREEN)/2) - (350/2),505,280,SWP_SHOWWINDOW);
Anu
|
|
|
|
|
I have developed dialog based application to capture data from a device on RS232 & display those data in VC++ 6.0 frontend. Now i need to print this data in defined format on the printer. May be i need to select the printer & then print the report.This methode would be better as the printer to be used is not finalized yet with this application. I am new to VC++, I am not sure which method would be better to use in VC++.
Could you guide how to proceed about his requirement.
|
|
|
|
|
If you're using MFC then you may take advantage of this class [^], also have a look at its inspiring article [^].
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]
|
|
|
|
|
which class would i use to implement multithreading...could you send me some literature & sample code to achieve this...
|
|
|
|
|
diptipanchal wrote: which class would i use to implement multithreading
Is this related to your previous question?
Anyway have a look at this page [^]. Be warned, multithreading is a rather complex topic.
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]
|
|
|
|
|
thanks Pallini...I could print the data displayed on the frontend...& customized the printout....Really thanks a lot...
|
|
|
|
|
See Printing a Document (Windows)[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I could print the data displayed on the frontend...& customized the printout. But when the print command is clicked, it displays as below:
Set Font Arial Size = 8
My name is George Papaioannou _________________________________________________________________
Set Font Arial Size = 9
My name is George Papaioannou
....
and so on...
I want to print the data without line feed. that means printout as below.
Set Font Arial Size = 8 My name is George Papaioannou _________________________________________________________________
Set Font Arial Size = 9 My name is George Papaioannou
i don't know where line feed is given in the print?
snippet:
prt.Print(hFont,"Set Font Arial Size = 8",FORMAT_NORMAL);
prt.Print(hFont,"My name is George Papaioannou",FORMAT_NORMAL);
prt.Line (PS_SOLID);
prt.Print(hFont1,"Set Font Arial Size = 9",FORMAT_NORMAL);
prt.Print(hFont1,"My name is George Papaioannou",FORMAT_NORMAL);
prt.Line (PS_SOLID);
I would need to print the data on the same line as actually i want to print text & variable defined in the frontend.
If its only a text there is no problem But i want to print text & variable together which i am not able to print on the same line.
Pl help.....
|
|
|
|
|
Hi ,
Can anybody help me out as i have an application that is developed using multibyte character set now i have to convert it to Unicode so as the application can provide support to multiple languages.
Thanks
Varun Bhatt
|
|
|
|
|
If you made sure that you always used TCHAR instead of char then things should not be too difficult. Otherwise, well, you have to replace everything by TCHAR strings. Anyway, this article[^] is very good to get started.
|
|
|
|
|
That was a great help and interesting article.
Thanks !!!!!!!!!!
Varun Bhatt
|
|
|
|