|
The first thing you need to do is learn how to ask a question with enough detail that someone can think about answering it. For example, what version of Visual Studio is the error from?
Secondly, you need to learn to use Google - the assertion that's failing is ASSERT(AfxGetThread() == NULL) (I have psychic debugging capability - don't ask). Googling[^] that leads to several pages indicating that a) you have more than one object derived from CWinApp, b) you're calling your application objects constructor multiple times, or c) you're using multiple MFC DLLs with inconsistent results.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Have you looked at line 380 of appcore.cpp to see what the assertion is?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
i have a report style CListCtrl.
How do i retrieve the text from the individual cell.
Actually I have been able to get the selected row but seem to be having problems trying to get the row,column combination.
this gives me the row:
int nSelected = m_handselection.GetNextSelectedItem(x);
I have searched and might have either overlooked or could not find anything to give me the column.
|
|
|
|
|
GetItemText[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Yes.
CString GetItemText(
int nItem,
int nSubItem )
I can get the the nItem which is the row i have clicked.
How do I get the nSubItem?
|
|
|
|
|
FISH786 wrote: CString GetItemText(
int nItem,
int nSubItem )
CString GetItemText(
int nItem,
int nSubItem )
Did you see the definition. Don't you spot the return value from the function.
Spoonfeeding Uhh!
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Not. really. I did get the row, but can't get the column.
I used
nItem = m_myListCtrl.GetNextSelectedItem(pos);
but could not find anything simmilar to GetNextSelectedItem() to get the Column.
Like I said I don't know and could not find what to use to get the column.
Was asking for help only.
Thanks In advance.
|
|
|
|
|
nSubItem == column
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
thanks. I realized that but am having a hard time or have missed something to get the column.
I know I have the right row, since when i use the getItemtext with the nItem, and hadcoded "0", I get the first column values.
But once again I am having a difficult time to change that "0" to the selected column or clicked column cell.
|
|
|
|
|
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.
|
|
|
|