|
Mmmmhh... I didn't even think about trying to reboot......
It's working fine now ! Thank you !
Jerome
|
|
|
|
|
Glad to hear it.
I've seen plenty of occurances of visual studio just going nuts, and needing a reboot to fix it
Such as tracing through a function that was behaving oddly, only to be able to find an if statement that was deciding that 0 == 1
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
I get this problem right after DevStudio crashes on me (which is not very often, fortunately). If I then run it again, and reopen the project, I get that message.
The solution then is to open the TaskManager and search for MSDEV.EXE in the list of processes. I usually find two, the one I just ran and the one that had crashed. You can distinguish them by the CPU time. I kill the old process, reopen the project, and everything's cool.
Regards,
Alvaro
The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing. -- Albert Einstein
|
|
|
|
|
Hy all,
I'd like to ask to someone if is already happened to see this error message during the Compilation phase.
"type name first seen using 'struct' now seen using 'class'"
Do you know something about it??
Thanks in advance
Andrea
|
|
|
|
|
Don't you have the same name for a class and a struct ??
Jerome
|
|
|
|
|
Hy Jerome,
thanks in advance for your support!!
No, or better I think not.
Because I observed this behaviour sometimes.
I create a ATL wizard project, simply dll without MFC support,MTS etc...
After that I add a simple object with ATL wizard, and after again I add a method.
Since I compile this project on order to obtain a simple dll and seems all fine.
When I import the library with #import ....\<name>.tlb no_namespace in other project and try to compile appear the famous error!!
I believe that depend by some setting in my Visual Studio but I'm not sure!!
Bye;)
Andrea
|
|
|
|
|
I know this may seem like a rather simple problem, however it has stumped. Any help would be greatly appreciated.
How are child controls (CEdit, CButton, etc) resized when the window is manually resized or maximized? (I know that all controls are endowed with the ability to redraw themselves, however if I maximize or manually resize the frame window how do I stretch the control either horizontally or vertically so that I am not left with lots of empty space in the window?)
Thanks,
Don
|
|
|
|
|
Alas,
MFC (and Win32 API) doens't automatically support this, you need to do it by hand, on the OnSize(...) handler of WM_SIZE.
There are a couple of ways of doing it, either you manually resize and reposition each control, or you use one of many solutions presented here on codeproject, search for them in the dialog section.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
One solution is to override OnSize() and move the objects accordingly via MoveWindow() and SetWindowPos().
Kuphryn
|
|
|
|
|
I spawned a modeless dialog from my view class. It debug asserts or crashes in release:
BOOL CMsg::OnInitDialog()
{
CDialog::OnInitDialog();
m_nTimer =SetTimer(1,4000,0);
return TRUE;
}
void CMsg::OnTimer(UINT nIDEvent)
{
DestroyWindow();
KillTimer(m_nTimer);
CDialog::OnTimer(nIDEvent);
}
void CMsg::PostNcDestroy()
{
delete this;
CDialog::PostNcDestroy();
}
Switching the order of destroyW and KillTimer doesnt help...Call stack says OnTimer...
Appreciate your help,
ns
|
|
|
|
|
ns wrote:
delete this; CDialog::PostNcDestroy();
Rethink the order. In 2 lines above you delete an object and then you call a method on that object
|
|
|
|
|
aaargh! I see ....
I was also being blind in the OnTimer function...destroying a window and trying to process it....
Hope I learned from this lesson!!!
Appreciate your help,
ns
|
|
|
|
|
ns wrote:
Hope I learned from this lesson!!!
That's the difference between the idiot and the smart. Both make mistakes, but only the smart learns something out of it.
--
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. (Douglas Adams)
|
|
|
|
|
The drag and drop using "DragAcceptFile" do not produce results...
the code that I use is :
void dragDialog::OnDropFiles ( HDROP hdrop )
{
AfxMessageBox ("Done");
}
but the messagebox is not displayed when i drag and drop a file on the dialog.
Is needed a register method to do this ?
Can everyone help me sending me a small code ?
redlion@freemail.it
tank you
|
|
|
|
|
can anyone give me a sample of how to receive a UDP Packet using recv() call.
i have a criteria that i don't want the usual recvfrom() call but instead want to use the recv call.
any suggestions appreciated....
|
|
|
|
|
How can i place a dialog as a control on another dialog ??? We can place buttons on a dialog, similarly i want to place another dialog on a parent dialog ????
|
|
|
|
|
You can use property pages for this
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
benjymous wrote:
You can use property pages for this
Uh ? You mean property sheets and pages ?
He means adding sub-dialog to parents dialog, like adding complex components to another dialog.
You can't do it with the resource editor, you need to create them manually and place them in yout parent dialog.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Yeah, that's exactly what I've meant
I've used property pages in the past to be able to show and hide groups of controls on multiple pages. You can automate it to a certain extent by placing a frame on the parent dialog in the resource editor and then querying it's size and position when displaying the child dialog on top
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Yep, I understand now what you mean.
That's the way it usually done when placing "Components" dialogs inside other dialogs.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Specify the DS_CONTROL style for the 'child' dialog, and make parent its parent.
Software Zen: delete this;
|
|
|
|
|
I want to change the text of the statusbar inside an MDI application created with the appwizard. m_wndStatusBar.SetWindowText(text);
Now, running this, the text will not change. But, if you show a messageBox after that, the text will change. So, probably it is some sort of update/validate thing I have to do after the SetWindowText. I tried UpdateWindow(), but that's not it.
What is the function to force that?
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
Maybe m_wndStatusBar.SetPaneText(0, text) works better...
rechi
|
|
|
|
|
I have been reading Michael Dunn's article about Custom Draw and the List Control to figure out how to change the background and text color to change on a selected item. I have tried the code below in both the pre and post paint stages. Also in both stages I have tryed returning both CDRF_DODEFAULT and CDRF_SKIPDEFAULT, either nothing happens.. or no selection highlight is drawn.
Anybody have any ideas? I'm lost with Custom Draw.. I don't understand why I can change the text/bk color for every item.. but if I test for a selected item, and then try and change the text/bk color.. nadda.. nothing .. zip..
<code>
void CPlayListWindow::OnCustomDrawList ( NMHDR* pNMHDR, LRESULT* pResult )
{
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
*pResult = 0;
if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
*pResult = CDRF_NOTIFYITEMDRAW;
else if(CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
{
*pResult = CDRF_NOTIFYPOSTPAINT;
}
else if(CDDS_ITEMPOSTPAINT == pLVCD->nmcd.dwDrawStage)
{
LVITEM rItem;
int nItem = static_cast<int>( pLVCD->nmcd.dwItemSpec );
ZeroMemory ( &rItem, sizeof(LVITEM) );
rItem.mask = LVIF_IMAGE | LVIF_STATE;
rItem.iItem = nItem;
rItem.stateMask = LVIS_SELECTED;
GetListCtrl().GetItem(&rItem);
if(rItem.state == LVIS_SELECTED)
{
pLVCD->clrTextBk = RGB(0,0,255);
pLVCD->clrText = RGB(0,0,255);
*pResult = CDRF_SKIPDEFAULT;
}
}
}
</code>
C# a poor attempt at bringing C++ to the VB masses
|
|
|
|
|
I have been working from the same article just yesterday. Hers a copy of mu OnCustom draw...
void CCommunicationView::OnCustomDrawLog(NMHDR* pNMHDR, LRESULT* pResult)
{
NMLVCUSTOMDRAW *pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
*pResult = CDRF_DODEFAULT;
if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
{
*pResult = CDRF_NOTIFYITEMDRAW;
}
else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
{
*pResult = CDRF_NOTIFYSUBITEMDRAW;
}
else if ((CDDS_ITEMPREPAINT | CDDS_SUBITEM) == pLVCD->nmcd.dwDrawStage)
{
int item = pLVCD->nmcd.dwItemSpec;
LVITEM rItem;
ZeroMemory(&rItem, sizeof(LVITEM));
rItem.mask = LVIF_IMAGE | LVIF_STATE;
rItem.iItem = item;
rItem.stateMask = LVIS_SELECTED;
m_Log.GetItem(&rItem );
int value = m_Log.GetItemData(item);
CDC* pDC = CDC::FromHandle ( pLVCD->nmcd.hdc );
CRect rcText;
CRect rcIcon;
CString text;
m_Log.GetItemRect(item, &rcIcon, LVIR_ICON);
m_Log.GetItemRect(item, &rcText, LVIR_BOUNDS);
rcText.left += rcIcon.Width();
text = m_Log.GetItemText(item, 0);
if (rItem.state & LVIS_SELECTED)
{
pDC->SetTextColor(GetSysColor(COLOR_HIGHLIGHTTEXT));
CBrush brush(GetSysColor(COLOR_HIGHLIGHT));
pDC->FillRect(rcText, &brush);
}
else
{
pDC->SetTextColor(value);
CBrush brush(GetSysColor(COLOR_HIGHLIGHTTEXT));
pDC->FillRect(rcText, &brush);
}
pDC->DrawText(text, rcText, DT_END_ELLIPSIS | DT_EXPANDTABS | DT_SINGLELINE | DT_VCENTER);
pLVCD->clrText = value;
m_ilLog.Draw(pDC, rItem.iImage, rcIcon.TopLeft(), ILD_TRANSPARENT);
*pResult = CDRF_SKIPDEFAULT;
}
}
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|