Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

cdsmith

@cdsmith
About
Posts
15
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How do you use MM_ISOTROPIC mode with a CScrollView?
    C cdsmith

    I am trying to use the MM_ISOTROPIC mapping mode with a CScrollView. I keep getting the "Error: must call SetScrollSizes() or SetScaleToFitSize() before painting scroll view." message. To work around this I put a call to SetScrollSizes in my OnInitialUpdate() method. With this call I set the mapping mode to MM_TEXT and size to 100 x 100. I reset the mapping mode in OnPrepareDC to MM_ISOTROPIC and use the SetWindowExtent and SetViewportExt to get the right part of the document to show. This prevents the error but does not show any scroll bars? Does any body use MM_ISOTROPIC with a CScrollView or know of a demo/sample that does this. Thanks for any help!

    C / C++ / MFC help question

  • How to move a CRectTracker in resppnse to the arrow keys?
    C cdsmith

    I have a graphics app. I use CRectTracker to allow the user to select, move and resize graphic objects. I want to allow the user to have fine control over the moving of the CRectTracker using the arrow keys. I get the arrow keys in the OnKeyUp method of my view class. Does anybody know what method you call on the CRectTracker to make it move in response to the arrow keys. Thanks for any ideas.

    C / C++ / MFC graphics tutorial question

  • Rotating a shape within a bounding rect?
    C cdsmith

    I want to make the shape smaller so it fits in the box, I guess I'll get out the geometry text books... Craig

    C / C++ / MFC tutorial graphics question

  • Converting lines to polygons?
    C cdsmith

    If only it were that ease...:) Yup, you are missing something. The lines are from a wire mesh drawing, there are thousands of lines and they make up hundereds of polygons. The trick is to figure out what lines grouped together make up a polygon. Craig

    C / C++ / MFC algorithms question

  • Converting lines to polygons?
    C cdsmith

    Hello, I am working on an application where I get passed a list of line segments. I want to convert the line segments into polygons. Anybody have a reference to an algorithm or code fragment that can do this? Anybody have a quick sketch of an algorithm to do this. Thanks for any ideas. Craig

    C / C++ / MFC algorithms question

  • Rotating a shape within a bounding rect?
    C cdsmith

    Hello All, I am working on a drawing package. The user can drag and drop shapes (i.e. rect, elipse, star,...) and text into defined boxes on the screen. One requirement is to allow the user to rotate the shapes within the boxes. I have the rotation code down, but I am having trouble keeping the rotated shape in the box. For example when the user drops an elipse (tall and narrow) into a box. When I rotate this elipse 45 degrees it becomes bigger than the bounding box. Any ideas on how to allow the rotation but still keep the shape in the bounding box. Thanks! Craig

    C / C++ / MFC tutorial graphics question

  • Fitting Text into a Rect
    C cdsmith

    I am working on a system were I need to display text in a rect at the best possible resolution. I am passed the a CDC, font name, color, and a CRect. Here is my current approach (which I am not happy with). The rect is passed in logical coords (HIEnglish), so I convert it to device coords with LPtoDP. I fill in the LOGFONT struct with the lf.lfHeight = -rect.Height(). then select the font into the CDC and use the DrawText function with the DT_CALCRECT option to see how big the text will be. If it does not fit, I loop thru this procedure making the font smaller until it fits in the original rect. Does anybody have a better idea? Thanks in advance. Craig

    C / C++ / MFC question

  • What can cause Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called.
    C cdsmith

    Ravi, Thanks again for a reply. It is a complicated app. It is MDI using doc/view model. The veiw of the doc/view is split (with a splitter). One pane of the splitter is a view where I create the property sheet and the property pages. So, they are modeless as I can filp thru the pages and do work in the other panes of the split view. Craig

    C / C++ / MFC debugging question

  • What can cause Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called.
    C cdsmith

    Ravi, Thanks for the feedback. I think these are being caused from property pages of a property sheet. Does this make sence? If so how do I correctly delete pages from a sheet? Thanks!

    C / C++ / MFC debugging question

  • What can cause Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called.
    C cdsmith

    After closing my app the debugger reports this warning: Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called. Any ideas what can cause this? What can I be doing wrong? What should I look for to correct this? Thanks.

    C / C++ / MFC debugging question

  • Oh My GOD, Mass distraction weapon on Baghdad
    C cdsmith

    Muayyad, Where was your outrage last month when Saddam murdered 100's of Iraqi's?:confused: Where was your outrage last year when Saddam had his rape squad rape the inocent women of Iraq?:confused: Where was your outrage 10 years ago when Saddam buchered thousands of Iraqi's who cheared the Americans for destroying the Republican guard?:confused: Where was you outrage 30 years ago when Saddam attempted to assignate the leader of Iraq? :confused: Your hypocricy amazes me!

    The Lounge com

  • How to make an app that runs on Windows 95, 98, ME, NT, 2000 and XP
    C cdsmith

    I am trying to develope an application that runs on Windows 95, 98, ME, NT, 2000 and XP. I develope on a nice new/fast PC running Windows XP. After getting most problems worked out on the desktop I started testing on other version of Windows. Boy was I surprized how the same executable would run differently on different version of Windows. Here are some examples: I have a dialog box that has a property sheet with 3 property pages. On the pages there are buttons that call up a CColorDialog. It works fine on XP, but hangs the machine on ME. For this case I re-designed the dialog to be stand alone property sheet with the same 3 property pages. This approach works on XP and ME, still need to try on others. Another example is the CRectTracker. On XP the code uses a CRectTracker and the handles and cursor change when the tracker is displayed. On ME the cursor disapears when the CRectTracker::Track function is called. I am quickly comming to the conclusion that to have an application that runs on 32 bit windows, it cannot be any more complicated that a list box and a few buttons.:( Does anybody from Microsoft read these pages? So my question is how do you develope an app for all these version of windows? Do you develope on 95 (the worst one) and once you have it working there, there is a good chance it will work on the others? Do I need to build the exe on a PC running each of the different versions? Is building the exe on XP and delivering it to a customer running 95 an approach that will work?I don't even have access to some of these versions. Does anybody have any ideas? Thanks for any ideas Craig Smith

    C / C++ / MFC tutorial question testing sales beta-testing

  • How to handle Text Objects in a PaintShop Pro or PhotoShop type app?
    C cdsmith

    I am trying to use text in a PaintShop Pro or PhotoShop type application. Does any body have any ideas on how to do this. I am specifically interested in ideas about how you let the user manipulate the text object. For example the user can stretch the text object in either direction, or rotate the text or... I have started working on 2 solutions. The first is when I create a text object given a font name, font size, color and attributes (bold, italic...) I put it into a rich text control and grab the bitmap that is generated by the rich text control. Then stretching or rotating the text is basically stretchBlting or rotating a bitmap. This works well but looses quality (especially when printing). The sceond solution is when I create a text object given a font name, font size, color and attributes (bold, italic...) I create a logical font, using the LOGFONT structure. This gives rotation by creating the font rotated. It also gives great quality when printing. But this causes problems with stretching. I have not gotten this approach to stretch into long or heigh text. OK, does anybody have any recomemdations about these approaches? Or another approach? Thanks for any advice! Craig Smith

    C / C++ / MFC tutorial graphics adobe question

  • MFC Statically linked vs. MFC Shared DLL Issues
    C cdsmith

    My program is behaving differently when I link with MFC statically vs. when I link with MFC as a shared DLL. (In both cases I an using a debug build, so this is not a debug/release issue.) The first issue I noticed is with the CRectTracker. When I use a RectTracker while linking with a shared DLL everythink works correctly. The cursor changes when over the rect to a cross and the user can move the rect around the screen. But, when linking with with static MFC the rect tracker does not behave correctly. After the rect tracket is displayed, moving the cursor over the rect makes the cursor disapear. It does not change to the cross, it just disappears when over the tracking rect. Any ideas what I am doing wrong? Any ideas why this is and what I can do about it? Thanks! Craig Smith

    C / C++ / MFC c++ visual-studio debugging help question

  • Off-screen bitmap drawing while printing and print previewing
    C cdsmith

    I am developing a WYSIWYG MDI interface. The graphics look good on screen, now I am venturing into getting the print preview and printed version looking good. All of my drawing code in the CScrollView::OnDraw method. I am using an off-screen bitmap to draw into and at the end of the function I blt it into the CDC. Here are some of my questins: - Will the the off-screen approach work for print preview and printing? - If this is not the way to do print and print preview, the other problem I have is that some of the graphics I draw are transparent. I draw them by blting with SRCINVERT, SRCAND, SRCINVERT rop codes. Can this be done with 'print' DCs? Thanks for any help with printing. Craig Smith

    C / C++ / MFC graphics help question announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups