|
I find there has no such tool in VS2005. I use vc6's Dependency Walker to view the dll it need.I add all the dlls.
But when I make a install project and using the result setup file to install it in another PC,it could not run but terminated with the message that the configuration is wrong.
How to resolve it?
Thanks
|
|
|
|
|
I have a project complied using shared dll of MFC.
Try with make changes in project settings.
Compile using static library.
May be u'll get the result
|
|
|
|
|
the problem is that,if i compiled it using static library,the program would crash at runtime.
But the debug version works well.Why?
|
|
|
|
|
Hi All,
Our programmes use a generic thread creation and destruction so it makes it easy to create and control threads in the system without everybody having to re-implement the creation code. The problem however is that in debug mode we get:
The thread '___thread_callback' (0x8ec) has exited with code 0 (0x0).
___thread_callback is repeated a number of times equivilant to the number of threads created. Is there any way of changing this debug output in VS2005 to indicate which thread exited?
thanks,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
I think so, you could give your thread a meaningful name.
Use the following code snippit.
{
typedef struct tagTHREADNAME_INFO
{
DWORD dwType;
LPCSTR szName;
DWORD dwThreadID;
DWORD dwFlags;
} THREADNAME_INFO;
const DWORD MS_VC_EXCEPTION = 0x406D1388;
THREADNAME_INFO thrdInfo;
thrdInfo.dwType = 0x1000;
thrdInfo.szName = "The Name";
thrdInfo.dwThreadID = 0xffffffff;
thrdInfo.dwFlags = 0;
__try
{
RaiseException( MS_VC_EXCEPTION, 0, sizeof(thrdInfo)/sizeof(DWORD), (DWORD*)&thrdInfo );
}
__except(EXCEPTION_CONTINUE_EXECUTION)
{
}
}
I use this technique to simplify the debugging for My CWinThread derived, but i'm confident that it
should work for Worker threads as well. At low lever there isn't a difference.
Hope that this helps.
codito ergo sum
|
|
|
|
|
That is an interresting way round the problem
Thanks.
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
That's good but you could have just given him the link[^] to the documentation you got that from.
|
|
|
|
|
I' guess I could have done that but then I would be forced to google for it. Since I didn't remember the link where I first found it.
So I thought that whilst i'm in my project containing this little piece of code, maybe i could just could copy/paste it.
Don't worry won't happen again ...
codito ergo sum
|
|
|
|
|
Hi together,
I put a ListView in my Dialog and wand to catch the LVN_BEGINDRAG Notify-Message.
The ListView has his Notify-property to TRUE.
I tried a ON_NOTIFY_RECENT(LVN_BEGINDRAG,OnDrag) but i never step into it.
A tutorial says that the LVN_BEGINDRAG Notify message is catchable with adding a
new handler via the class wizard.
I tried a lot of things, but i don't find it
Does anyone knows where to add it?
Big thanks
|
|
|
|
|
Resource view -> mark the listctrl
Right click -> Context menu "Add event handler..."
proceed...
It is not so easy to find I still miss the VC6 (CTRL+W) wizard
Greetings from Germany
|
|
|
|
|
Danke für deine Antwort
I only have SetFocus, KillFocus, ThemeChanged, ...
No one likely "BeginDrag" or Notify
|
|
|
|
|
First you must open the Resource view (open the *r.rc file) of your dialog then click at the Treeview. Now right click ...
Greetings from Germany
|
|
|
|
|
Muss ich die Liste zuerst noch als Klasse ableiten?
Denn ich bin im Ressourcen-Modus, sehe den Dialog mit ner Textbox & dem Listen-Control.
Dann wähle ich die Liste aus und gehe auf "Ereignishandler wird hinzugefügt"
Dort drin habe ich jedoch nur Doppelklick, Focus Ereignisse
Nicht was mit Drag&Drog zu tun hat.
Irgendwo ist da der Wurm drin LOL
|
|
|
|
|
I cannot seem to find a message that will give my code a call after the user marks the checkbox on a standard CTreeCtrl. I can trap on the NM_CLICK but that calls me before the checkbox is marked, however, I want to be called after the state of the node is set. Thanks
|
|
|
|
|
I thought this was going to be a trivial question, but I can't see a nice elegant method either.
What you can do is....
1/ Get NM_CLICK
2/ Get the cursor position with GetMessagePos, and translate it to tree window coords.
3/ Use TVM_HITTEST to get the item number, and where the click was (does it return TVHT_ONITEMBUTTON ?)
4/ Get the current check state.
5/ Either get on and handle the fact that the state will change, or post yourself a message to deal with it shortly.
Iain.
|
|
|
|
|
OK, you officially owe me a pint.
There isn't a clear message, but as its a common control, you get owner draw notifications when things have changed. Including the check box...
The below code will raise some repeated messages, eg when you scroll. So in your handling code, I'd check if the change is really a change, or just a redraw.
Iain.
ON_NOTIFY(NM_CUSTOMDRAW, IDC_TREE1, OnTreeCustomDraw)
void CMyDlg::OnTreeCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
{
*pResult = 0;
NMTVCUSTOMDRAW *nmtv = (NMTVCUSTOMDRAW *)pNMHDR;
switch (nmtv->nmcd.dwDrawStage)
{
case CDDS_PREPAINT:
*pResult = CDRF_NOTIFYITEMDRAW;
return;
case CDDS_POSTPAINT:
break;
case CDDS_ITEMPREPAINT:
TRACE1("uItemState=%x\n", nmtv->nmcd.uItemState);
{
BOOL bState = TreeView_GetCheckState (::GetDlgItem (GetSafeHwnd (), IDC_TREE1), (HTREEITEM) nmtv->nmcd.dwItemSpec);
TRACE1(" Check state = %i\n", bState);
}
break;
case CDDS_ITEMPOSTPAINT:
case CDDS_ITEMPREERASE:
case CDDS_ITEMPOSTERASE:
break;
default:
TRACE1("Unexpected draw state =%i", nmtv->nmcd.dwDrawStage);
break;
}
}
BOOL TreeView_GetCheckState(HWND hwndTreeView, HTREEITEM hItem)
{
TVITEM tvItem;
tvItem.mask = TVIF_HANDLE | TVIF_STATE;
tvItem.hItem = hItem;
tvItem.stateMask = TVIS_STATEIMAGEMASK;
TreeView_GetItem(hwndTreeView, &tvItem);
return ((BOOL)(tvItem.state >> 12) -1);
}
|
|
|
|
|
Works great, definately worth a pint... Thanks Iain.
|
|
|
|
|
Hi all,
I have a problem regarding performance of my application in which I have many images in tabpane in which user can select any tab and the appropriate result will be shown to the user respective to the selected tab in my MFC application.
But when user made click on that there is much fluctuation to display data and it takes long time to display a single text line.
I have loaded images by the following code:
m_btnHelp.SetButtonStyle(BS_OWNERDRAW);
m_btnHelp.LoadBitmaps(IDB_BTN_MAINHELPD,IDB_BTN_MAINHELPH,IDB_BTN_MAINHELPD);
So, can any one help me to solve this slow performance problem
or anybody knows how to load this images and open respective pages fast.
Thanks in advance!!!
|
|
|
|
|
I think you are redrawing to much. Or what else are you doing in your drawing code?
Greetings from Germany
|
|
|
|
|
Hi
I can't get your point what is redrawing means???
|
|
|
|
|
You wrote: "much fluctuation to display data and it takes long time to display a single text line"
it sounds like you draw or Invalidate() to much. Make a breakpoint in your drawing code or TRACE-statement.
Greetings from Germany
|
|
|
|
|
Hi,
Thanks for giving me your valuable time....
I have made a simple application in which if user clicks on one button then the respective page will open.
In that page I have put some buttons and at last I have attached some images to that buttons.
So, while I am clicking on the main button then the next page in which I have attached images will open after 2-3 seconds means fluctuation is displayed images are not loading fast.
So, can you please tell me where I am wrong from which I am suffering from this problem.
Thanks again
|
|
|
|
|
You need to load the images before you display the dialog. The OnInitDialog() Function is a real good place.
I would strongly advise you to learn a lot via downloading samples from CP.
Greetings from Germany
|
|
|
|
|
Hi,
LoadBitmaps belongs to CBitmapButtons right, where it resides in page or you are using it instead of Tab control
for CBitmapButtons i think BS_OWNERDRAW has to be set in Create.
|
|
|
|
|
hi sir,,
iam displaying files on the list view ... like file1,file2 ...etc.
after that iam providing multiple selection files on list view.
that is ok.. no problem. then what problem is i would like unselect the files
which files are selected.
plz give me reply
Regards,
Srinivas
|
|
|
|