Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow is a differance in win98 and win2000 for image management? Pin
hahyojin1-Apr-01 22:29
hahyojin1-Apr-01 22:29 
GeneralConversion of a default file format to PDF. Pin
1-Apr-01 19:45
suss1-Apr-01 19:45 
GeneralRe: Conversion of a default file format to PDF. Pin
Kannan Kalyanaraman1-Apr-01 20:56
Kannan Kalyanaraman1-Apr-01 20:56 
QuestionHow to create a Button array ........ Pin
Vistac1-Apr-01 19:31
Vistac1-Apr-01 19:31 
AnswerRe: How to create a Button array ........ Pin
Erik Thompson1-Apr-01 21:36
sitebuilderErik Thompson1-Apr-01 21:36 
GeneralRe: How to create a Button array ........ Pin
Vistac2-Apr-01 6:17
Vistac2-Apr-01 6:17 
GeneralRe: How to create a Button array ........ Pin
Erik Thompson2-Apr-01 6:23
sitebuilderErik Thompson2-Apr-01 6:23 
GeneralBest way to write a drawing tool? (AKA The nightmare of windowless ActiveX) Pin
Brendan Tregear1-Apr-01 18:56
Brendan Tregear1-Apr-01 18:56 
Hi,

My software needs some drawing tools, which need to be drawn transparently over a bitmap. The tools include:

-> Line, freehand, text, etc.
-> A 'cup to disc' tool. Essentially this is two circles, one inside the other. They are dragged by the user to a particular spot on the image (which is why they have to be transparent) and the software calculates the ratio of the area of one circle to the next.

Now being my naive self, I thought "Jee, if i made the cup-to-disc tool a windowless activex control i won't have any messy message handling in my view's mouse message classes, because the activex control will receive all the messages". You'll probably notice that the cuptodisc tool not only needs resizing but also repositioning in the container. Well I got all working, except:

-> After about 30seconds of moving the tool around, I start getting first-chance exceptions and finally an unhandled exception which bombs the software. I've since found out this could have something to do with a bug in MFC (Q192942) which causes a stack overflow... Great

-> In my CCupToDiscCtrl::OnLButtonUp() function if the tool is being moved I call:

<br />
		myRect.SetRect(point.x, point.y, point.x + 20, point.y + 20); <br />
		if (!SetRectInContainer(&myRect)) //in device units<br />
		  TRACE("Fail set rect!\n");<br />


But I might click on the tool and drag it to the bottom-right of the screen, and it ends up in the top-left! Or I drag it down and it goes up! And resizes! Note that in my OnDraw I only draw within the confines of rcBounds. Its driving me crazy...

So the point of all this is:

1/ Do I swallow my pride and dump this whole windowless ActiveX thing? It works well if it wasn't for the damn crashing and the fact it doesn't go where I want.

2/ What other options do I have to implement this? Assuming the number of tools may grow to 12 or more, what's the best way to lay them out so my windows message handlers and View's OnDraw stays relatively clean? I saw the JTDraw example on Codeguru and it seemed to be getting too noodle like for me (not quite spaghetti Smile | :) . Is making the View a OLE container going to help?

Thanks for any help. Sorry for my ramblings... but I've run out of options Frown | :(
GeneralRe: Best way to write a drawing tool? (AKA The nightmare of windowless ActiveX) Pin
Christian Graus1-Apr-01 19:09
protectorChristian Graus1-Apr-01 19:09 
GeneralThanks. You've given me the energy to give it another shot :) (n/t) Pin
Brendan Tregear2-Apr-01 14:12
Brendan Tregear2-Apr-01 14:12 
QuestionWhat this means?! Pin
webman011-Apr-01 18:40
webman011-Apr-01 18:40 
GeneralArray copying Pin
1-Apr-01 17:39
suss1-Apr-01 17:39 
GeneralRe: Array copying Pin
Christian Graus1-Apr-01 17:50
protectorChristian Graus1-Apr-01 17:50 
GeneralChanging the clock text Pin
Greg Hedlund1-Apr-01 16:41
Greg Hedlund1-Apr-01 16:41 
GeneralGetVolumeInformation Pin
paulb1-Apr-01 15:52
paulb1-Apr-01 15:52 
GeneralSupport MultiLanguage in VC Pin
hs1-Apr-01 15:29
hs1-Apr-01 15:29 
GeneralRe: Support MultiLanguage in VC Pin
Masaaki Onishi1-Apr-01 16:02
Masaaki Onishi1-Apr-01 16:02 
GeneralMy problem is: Pin
hs1-Apr-01 16:35
hs1-Apr-01 16:35 
GeneralRe: My problem is: Pin
Masaaki Onishi1-Apr-01 17:56
Masaaki Onishi1-Apr-01 17:56 
GeneralRe: Support MultiLanguage in VC Pin
l a u r e n2-Apr-01 6:45
l a u r e n2-Apr-01 6:45 
GeneralRe: Support MultiLanguage in VC Pin
Masaaki Onishi2-Apr-01 7:08
Masaaki Onishi2-Apr-01 7:08 
Generaldot operator menu... Pin
Cam1-Apr-01 15:28
Cam1-Apr-01 15:28 
GeneralRe: dot operator menu... Pin
Christian Graus1-Apr-01 17:07
protectorChristian Graus1-Apr-01 17:07 
Generaltry / catch : not compiled && unreachable in release build. Pin
Matt Cooper1-Apr-01 14:54
Matt Cooper1-Apr-01 14:54 
GeneralRe: try / catch : not compiled && unreachable in release build. Pin
Tim Deveaux2-Apr-01 6:54
Tim Deveaux2-Apr-01 6:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.