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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
C

CodeBrain

@CodeBrain
About
Posts
85
Topics
25
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Page layout library
    C CodeBrain

    Currently I try to find a library/framework/component to develop a page layout tool. It should provide a framework to build a custom appplication. The user should be able to define a page from pre-defined components like text-boxes and graphics. The display should be the preview of the page like it will be printed (wysiwyg). The user should be able to arrange/resize the components on the page and edit and format the contents of the text boxes. In-place editing of the text twould be nice. Does anyone know a library (open-source or commercial) which provides those basic capabilities in C++/MFC or COM. So far I could not find suitable libraries.

    Graphics c++ com graphics

  • Doing print abort with a toolbar button
    C CodeBrain

    Thanks for your answer. Of course this would work, but I try not to change how the internal printing routine work. So want to avoid using a thread if it is possible.

    C / C++ / MFC com question

  • Doing print abort with a toolbar button
    C CodeBrain

    I have a printing application which works quite good for some years now. It uses a modless abort dialog which can be used to abort the banded printing process. The dialog uses the well known "keep the message pump alive" method which is e.g. described in this article (http://www.codeproject.com/threads/TemplatedLengthyOperation.asp[^]. So the printing process queries an abort method of the dialog continuously which keeps the message handling alive and checks the abort button. This works very good for years now. But now I want to use a progress bar and an abort button in the toolbar of the print preview view instead of the dialog - but I am not sure if this will work with the same technique like in the abort dialog. I could not find any information about it. Everyone seems to use a dialog. Has anyone an idea if this works?

    C / C++ / MFC com question

  • Desktop PDA filesync dialog?
    C CodeBrain

    I am currently starting to work on a small project containing a module which can copy files to the PocketPC. I found the RAPI and wrote a small program which does what I want to do: copy files to the PDA. But now I think it would be better to have a dialog with 2 directory trees (left desktop, right PDA) where the user can select a file on a desktop and select the new directory on the PDA. Does anyone has an idea if such a dialog already exists (I want a guild in solution and don't want to use ActiveSync)? Using Google did not help...

    Mobile help question

  • CFileDialog::DoModal() crashing with "stack overflow"
    C CodeBrain

    Use oDlg.m_ofn.lpstrTitle = "Find Sound File"; I don't know what the pOFN Pointer you are using does exactly...

    C / C++ / MFC c++ data-structures help question

  • DHTML and MFC
    C CodeBrain

    Thanks again :) I will try the wrappers. Since I only want to do some basic things I will not use JavaScript. The simple browser wrapper for the MS Web Browser control which I use is very good. It already offers message handlers. So this should be easy. You helped me a lot. :-D

    Web Development c++ html help question com

  • DHTML and MFC
    C CodeBrain

    Thanks for the detailed answer. I think now I have the starting point I need. But do I need the wrappers if I don't add new HTML elements? My plan is to change existing HTML elements only. So If I get a pointer like IHTMLElement and change the properties of the object that should be no problem? The MSHTML documentation in the MSDN library seems also to be very good. Thanks for your help. :)

    Web Development c++ html help question com

  • DHTML and MFC
    C CodeBrain

    Thanks for your answer Andy, it's exactly what you say. Today I have found a solution. I can get a IHTMLDocument pointer. So I have access to the HTML code. But that leads me to another question. How can I insert an image into the HTML code which is in memory and not on HD. Must I save the image to a file in order to insert it into the HTML document or is there an other way?

    Web Development c++ html help question com

  • DHTML and MFC
    C CodeBrain

    I am developing a MFC (VC++ 6) application which should be able to display some dynamic HTML content. The HTML page has some static elements and some dynamic elements so I want to use DHTML. I want to use a static HTML template and let my MFC application fill in the dynamic content. To display the HTML page I will use the IE browser component (or the MFC wrapper from Gary R. Wheeler http://www.codeproject.com/miscctrl/simplebrowserformfc.asp) The problem which I have is: how can I access the dynamic HTML content (DOM) of my template and fill in my content using MFC. Is there a DOM/DHTML parser? I found a lot of information in the internet and in the MSDN library, but I could not find a good startig point. Can anyone give me some hints or direct me into the correct direction? At least a starting point would help me a lot. Thanks in advance.

    Web Development c++ html help question com

  • Printing problem
    C CodeBrain

    OK, if you use the same GDI functions, than it seems to be an other problem. What are your configurations in the OnBeginPrinting and OnPrepareDC methods? Have you overwritten those methods? Do you modify the CPrintInfo object, e.g. you can set the number of pages to print.

    C / C++ / MFC help graphics testing beta-testing

  • Printing problem
    C CodeBrain

    Do you have both reports in the SDI view or do you switch between the 2 reports? Do you print both reports on 2 pages or only one? If you do something more complex the MFC classes often won't do as they should. I think that I can say that I have stressed the MFC classes to their limits with the printing in my project... :( I would try to implement the CView::OnPrint method and try to draw your content not directly to the print DC but first into a memory DIB which is compatible to the screen. Then you have to have to use StretchDIBits to "copy" the DIB to the printer. My experience is that in general it is not a good idea to do the output directly on the printer with the same drawing code which you use for your screen output. Many printers support only a subset of the GDI functions which you can use to draw on the screen. Often the output looks ugly or you won't have any ouput. Since the PrintPreviw uses a compatible screen DC to draw (the print DC is only used to do the sizing) your output may look good on print preview but not on the printer. But there are also some cases where your output sucks in print preview but looks good on the printer. If you dont't have experience with DIBs take a look at the MSDN knowledge base article "DIBs and Their Use" from Ron Gery. So I would do something like this: void CReportView::OnPrint(DCD* pDC) { // Create compatible memory DC for screen // Create compatible DIB for the screen // Select DIB into the memory DC // Call your original drawing code using the memeory DC OnDraw(&memoryDC); // Use StretchDIBits or other DIB function to copy the bitmap to printer } Since I don't know your implementation this is just a hint how I would do it. But I think drawing in a DIB may solve your problem.

    C / C++ / MFC help graphics testing beta-testing

  • Adding text to CRicheditctrl?
    C CodeBrain

    Yes and I have also tried GetSel(start, end); SetSel(end, -1); But GetSel returns 0,0 so I think the problem is that the RTF ctrl loses the focus(?)

    C / C++ / MFC help question learning

  • Adding text to CRicheditctrl?
    C CodeBrain

    I have a dialog based application and I have added a CRichEditCtrl to the dialog using the resource editor (incl. a CRichEditCtrl member variable). Now I am trying to add text to this control if the user clicks on a button. I have the following code in the message handler of the button: m_RTFEdit.SetSel(-1,-1); m_RTFEdit.ReplaceSel(pszData); But this seems not to work. In the past I used StreamIn to copy text to a rich edit ctrl but now I want to use ReplaceSel. Is it possible that the CRichEditCtrl loses the focus and so ReplaceSel can not work? Thanks in advance for your help.

    C / C++ / MFC help question learning

  • MFC SDI FormView - need multi-edit views
    C CodeBrain

    I can not help you directly but you may take a look at this topic in the MSDN library, it may help you: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/\_core\_document.2f.view\_architecture\_topics.asp

    C / C++ / MFC question c++ java asp-net design

  • MFC printing extra blank page
    C CodeBrain

    Yes it seems that the printer gets some extra line feed or something like that. If the print preview is ok, it seems to be a hardware problem. Did you try your program on an other PC? You may also check how often your OnPrint method is called during printing.

    C / C++ / MFC c++ tutorial question

  • How to Insert Table in Rich Text Box Control
    C CodeBrain

    Do you want to create a table by programming or do you want to be able to copy and paste a table from other RTF applications? Copy/Paste should work. Since the Windows WordPad application can not create tables and this is a demo application which has been build using CRichEditView (a CRichEditCtrl wrapper) it seems to be not very easy to create tables by programming. You may have to write the RTF code yourself to do this, but I don't know how to do it.

    C / C++ / MFC help tutorial

  • MFC printing extra blank page
    C CodeBrain

    Have you tried different printers?

    C / C++ / MFC c++ tutorial question

  • MFC drawing confusion
    C CodeBrain

    The only virtual methods which are called by the MFC framework are those with OnXXX. OnInitialUpdate is called after the view is attached to a document but before the view is initially displayed. OnUpdate is called if you change the document data and call UpdateAllViews. So OnUpdate is called by UpdateAllViews. The default implemenation is also called by OnInitialUpdate and it invalidates the entire client area and so it will be repainted if the next WM_PAINT messages is received. UpdateAllViews should be called if you changed the documents data and so the view of the document must be marked invalid so that it is repainted in the next WM_PAINT message! So it forces the views of the document to display the changed data. As I said above UpdateAllViews calls OnUpdate of all views which are attached to this document (except the sender view). Note: you can prevent that OnUpdate invalidates the whole client area, if you overwrite UpdateAllViews/OnUpdate and pass a hint object with the information which part of the view must be updated in order to refelect the document changes! InvalidateRect adds the given rectangle to the windows update region. The update region will be repainted if the next WM_PAINT message is received. It is used by OnUpdate to invalidate the given region of the view. OnDraw will be called by the MFC framework in order to display the document. So OnDraw is called if a WM_PAINT message has been received.

    C / C++ / MFC graphics c++ game-dev question announcement

  • A DIBSection wrapper for Win32 and WinCE
    C CodeBrain

    When I started with DIBs the MSDN article "DIBs and Their Use" was very helpful for me. It is quite old, but gives basic knowledge about how to use DIBs. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dngdi/html/msdn\_dibs2.asp I know that there is a CDIB class which wrapps the DIB API. This class has been introduced in an atricle in one of the MS development magazines. Unfortunately it is not yet part of MFC. I think you should find it if you search in the MSDN library.

    C / C++ / MFC question c++ performance

  • Changing paper size - how???
    C CodeBrain

    Do you want to change the paper size during a print job or do you want to have different paper sizes for each print job? If you want to set the paper size for a print job you have to get the printer DC and then you can change the dmPaperSize member of the DEVMODE structure. But I think you should give some more information what you exactly want to do.

    C / C++ / MFC c++ tutorial question
  • Login

  • Don't have an account? Register

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