Question about FZ2 DLL / CListCtrl

Moderator: Project members

Post Reply
Message
Author
RyanA
500 Command not understood
Posts: 4
Joined: 2004-12-23 12:03

Question about FZ2 DLL / CListCtrl

#1 Post by RyanA » 2004-12-23 20:57

It seems that any time I create a CListCtrl control with any project (vstudio7.1), I get about 10 dll's loading when I click to a select an item in the ListCtrl (only the first time). I downloaded FZ2 to compare, and it does not cause any DLL loading, yet it makes the same use of all CListCtrl items. I checked the CWinApp/CMainCtrl/CQueueView/CQueueCtrl classes for any differences relating to the ListCtrl (CQueueCtrl) but I can find none. (all project settings seem the same).

I traced the occurence of the DLL's loading to after the mouse click but before any LVN_ITEMCHANGED notifications are sent.

Did you do something special in your project to control this?

During my experiments I also noticed that I see a message in the debug output window for each DLL unloaded "'filezilla.exe': Unloaded...." when the program exits. Again, I can not understand why your program does this but mine does not. I traced it to occuring just before CMainFrame::OnDestroy is called.

I've spent about 7 hours trying to figure this out, any light you can shed on this strange occurence would be great, thanks.

-Ryan

User avatar
botg
Site Admin
Posts: 35566
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

#2 Post by botg » 2004-12-23 21:50

I'm sorry, but I've no idea why your app loads additional DLLs if clicking a list control. Did you check that those DLLs weren't already loaded in FZ prior to clicking anything in the list controls?

RyanA
500 Command not understood
Posts: 4
Joined: 2004-12-23 12:03

#3 Post by RyanA » 2004-12-23 22:18

Yea, I checked that. I even went through it with dependency walker and found out that even though both of our programs call the same functions in comctl32.dll, my program calls waveOutGetNumDevs() from comctl32.dll which causes all of the loading. For now, I will just load the libraries at the beginning to avoid the delay while the program is running.

Thanks for replying,
-Ryan

User avatar
botg
Site Admin
Posts: 35566
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

#4 Post by botg » 2004-12-24 10:28

Interesting. How do you link to the MFC? Are you using the static libs or the DLL version?

RyanA
500 Command not understood
Posts: 4
Joined: 2004-12-23 12:03

#5 Post by RyanA » 2004-12-24 11:03

I tried both.
Another oddity is that all of the CListCtrl's I make have a 2pixel gap between the header and the first item. Your CQueueCtrl does not have this gap (and neither does Windows Explorer). I spent a few hours trying to figure that one out too with no luck. I Dump()'d all of the class objects (CQueueCtrl, CView, CMainFrame, CWinApp) and all of them match exactly between our programs. I even stepped through the CRect sizes. The system is simply passing a CRect vertically offset 2 pixels to DrawItem(...) for my program. All the other sizes are the same. I eventually gave up and filled in the gap with OnEraseBkgnd().

Oh well, even though I can't figure out the cause, I've at least gotten some workarounds going. This is my first real windows GUI project and your code has been extremely valuable in helping me learn a lot of things.

Thanks again,
-Ryan

Post Reply