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
R

ryuki

@ryuki
About
Posts
23
Topics
8
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to activate OnFileNew()?
    R ryuki

    Thank you! It works! The right answer is: AfxGetMainWnd()->SendMessage(WM_COMMAND,ID_FILE_NEW);

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

  • How to activate OnFileNew()?
    R ryuki

    I did not make me clear enough. I used the App Wizard and clicking the New Document button or selecting it in main menu works. I want to start it from another point too. For example a context menu or from another button. If there is a button in another toolbar that launches a funktion that requires a new document, I have to call the OnFileNew Funktion. But it doesn't work at the moment. How can I create a new document from within own classes or functions?

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

  • How to activate OnFileNew()?
    R ryuki

    I work on a single document app. Now I have the problem that messagehandling doesn't work right. I want to activate the creation of a new document from another point as the main menu and toolbar. For that purpose I included ON_COMMAND(ID_FILE_NEW, OnFileNew) in a view class and tried to start the OnFileNew() function by sending a message to the view class: pvw->SendMessage(ID_FILE_NEW) It doesn't work! When debugging the whole matter I saw that OnFileNew() wasn't activated (and processed). Even if it does, I have to do all by myself (setting default name for empty document and so on). How can I activate the applications OnFileNew Funktion? Why doesn't the message sending work? I hope someone helps me with that (basic MFC) matter.

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

  • CFileFind allocates memory but does not release it?
    R ryuki

    Thank you for the hint. I use the standart documentation, the msdn library coming with VC++ 6. Next Time I will check the online docu too.

    C / C++ / MFC question algorithms performance help announcement

  • CFileFind allocates memory but does not release it?
    R ryuki

    I work under Win98 and use the systemmonitor for viewing allocated memory. Its not easy to say but there seems to be more to the memory issue than expected. I managed to find another source of consuming memory. It is a little part including SHGetFileInfo. And that small codebit causes much more trouble than all other together. It seems that SHGetFileInfo allocates memory too. But you can't see it at the systemmonitor. It eats all of it with time and at a single point I can't create threads anymore or some functions like StretchDIBits doesn't work properly because there is no memory anymore. I get a lot of "Not enough memory" errors allthough all ressourceviewers say there are more than 100 MB of free memory still there. I can give you the small code example: SHFILEINFO sfi; UINT uFlags = SHGFI_SYSICONINDEX | SHGFI_DISPLAYNAME | SHGFI_ICON | SHGFI_SMALLICON; if ( SHGetFileInfo ( tmp, 0, &sfi, sizeof(SHFILEINFO), uFlags )) m_ctrPathFrom->InsertItem ( npos, sfi.szDisplayName, sfi.iIcon ); Thats all. I looked at the documentation but it says nothing about freeing the structure or something. Does someone know what to do? And you can be believe me, i traced the cause of the memory issue to that single if-line. I hope someone can help.

    C / C++ / MFC question algorithms performance help announcement

  • CFileFind allocates memory but does not release it?
    R ryuki

    I had some trouble with my app because it allocates a lot of memory. The longer you use it the more memory was eaten away. After searching for a reason I endet up with CFindFile as the only reason for that. I have a loop and after deleting all but the CFileFind calls it is the only think that keeps running and allocating memory. Unfortunately CFileFind seems to not release the memory it uses. I tried everything: CFindFile* findfile=new CFindFile(); //... searching files findfile->Close(); delete findfile; doesn't release any of the allocated memory. Can someone help me? How can I free the allocated memory. Is there a alternate way to search for files in a directory?

    C / C++ / MFC question algorithms performance help announcement

  • How set message handling right?
    R ryuki

    I have a singledocument MFC app. In the mainwindow it displays a listview. If you pick an item in that view a couple of docking Toolsbars with views should show a preview and Informations of that item. You know ACDSee? Than you know what I speak of. I managed to set things up so far and it works. When selection changes the view sends a message (SendMessage()) with an ID to my MainFrame class and that one loads the new information in the preview tool bars (it calls the functions for loading in the toolbar classes). Now I have the problem that changing selection in the mainview gets a little bit bumpy. When pressing the down key the selection cicles through the view. Without the views the speed is allways the same. With the views it stops sometimes but the speed changes again and again. What I want is a steady speed. The other downside is that the toolbars crashes. It is not a fatal error, the toolbars still work but the updated Informations are not displayed anymore. Even the overall appearance of the bars look damaged. I use a class from codeproject for them: CSizingControlBar so its difficult to say if its a problem with that class or a memory / message issue of my app. Anyway I would be grateful if someone could help me with the first issue, and even more if someone knows something about the second one.

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

  • Question for jpeg.lib users
    R ryuki

    I found a solution on my own. I posted it at the comments of the cximage article.:)

    C / C++ / MFC c++ com graphics help question

  • Best way To Do?
    R ryuki

    Make the background a view too. That helps allot, since windows keeps your backround image clean. If you realy need to redraw it you only need to call backview.invalidate();. You have to create a OnSize() Function that redraws the whole background in the view.

    C / C++ / MFC question

  • Message Box
    R ryuki

    You could create a dialog in the ressource dialog editor, with 2 buttons and 1 Editbox. Press Strg+W and the Classwizzard will come up, here you can add variables linked to the Editfield or functions that operate when buttons are pressed and more. If you set up all fine you can include the dialogclass in your app, write the sentense you want to the variable in your dialogclass,say mydialog.DoModal();, react on buttons, and have a good time. No more than 10 minutes on it all.

    C / C++ / MFC question

  • Question for jpeg.lib users
    R ryuki

    I have some trouble using the code and library from the Independent JPEG Group. It only occurs with damaged jpg files. I tried and cximage can load that damaged files better than my functions. Besides, every professional pictureviewer/editor can do so. I posted the whole matter under the cimage article you can find on codeproject: http://www.codeproject.com/bitmap/cximage.asp[^] Since the project is discontinued I can't rely that I get a answer there. So I hope some people using VC++ too can help me with that matter. I know the chances are very low since there are only few people using jpg decompression directly in theyr apps.

    C / C++ / MFC c++ com graphics help question

  • please help with link error LNK2005 (png.lib?)
    R ryuki

    I just tried something and could fix the problem for the moment. I changed the compiler argument from /MLd to /MDd for debugging and /ML to /MD for release. Now I only got a last warning for MSVCRT.lib (only debug mode): LINK : warning LNK4098: Standard library "MSVCRT" is in conflict with another library; /NODEFAULT:Library used (sorry, I have to translate all messages since I did not use the englisch localisation, so the warning can look different from the one you get)

    C / C++ / MFC help c++ question performance announcement

  • please help with link error LNK2005 (png.lib?)
    R ryuki

    Ok, VC++ tells me the same errors all the time: MSVCRT.lib(MSVCRT.dll) : error LNK2005: _sprintf allready defined in LIBCD.lib(sprintf.obj) As far as I understand it, it is a problem with incompatibel iostream librarys. VC++ chooses the right version itself but now there is a conflict since I build something in that requires different iostream versions. I put some png reading code in my previous well working project. I used the same code in another project without any trouble. But last time it was an MFC application and now it is a simple VC++ win32 application project. Maybe the way I linked the library caused some trouble too. I had to use that methode: extern "C" { #include "png.h" #include "pngconf.h" } other includes are #include "ddraw.h" #include "windows.h" #include "windowsx.h" #include "mmsystem.h" #include "iostream.h" #include "conio.h" #include "stdlib.h" #include "malloc.h" #include "memory.h" #include "string.h" #include "stdarg.h" #include "stdio.h" #include "math.h" #include "io.h" #include "fcntl.h" How can I get rid of this annoying link errors? Every help is welcome.

    C / C++ / MFC help c++ question performance announcement

  • vc++ string Find problem
    R ryuki

    The best solution would be to use CString. It has many constructors. For LPCTSTR you can use CString::CString( LPCTSTR lpch, int nLength ) and for searching a substring or a character Value in another String use CString::CString::Find(...). Just check the CString class and you will see. If it still not work than look at the return value of GetMenuString. Maybe it redrives not the whole string (don't think so).

    C / C++ / MFC c++ help question

  • vc++ string Find problem
    R ryuki

    I did not used TCHAR yet. I did a simple test with strstr() and it worked. char tst[50]; strcpy(tst,"Hello you!\nThis works!"); // put a string into tst if (strstr(tst,"lo y")) // strstr returns NULL if there is no ocurance m_output="OK"; UpdateData(FALSE); The str-functions are pretty old and are not very object orientated but they don't let you down. I like them. ;)

    C / C++ / MFC c++ help question

  • Help with program structure
    R ryuki

    That simple... X| I read "MFC in 21 days", and they mentioned it earlier but I forgot. Sometimes I wonder if I will ever get used to the whole document - view and message concept of MFC. Think about that, there is no member for the CYOURDoc and CYOURView in any class in your whole project. Thank you again!

    C / C++ / MFC c++ question html com help

  • Help with program structure
    R ryuki

    http://www.geocities.com/stormcatcher712/sample.html[^] Its an image of my private project. I'm still a beginner an so I have several questions. First some word about the structure of my application. It is a single doc app created with the VC++ 6.0 project wizard. At the right site you see the applications docview. It contains a CListCtrl. At the left side I managed to add a CDialogBar with a dialog conaining a CTabCtrl. If you switch the tabs the checkbuttons and texteditfields will be activated or deactivated. Now my questions: 1) I want to manipulate the CListCtrl from within the CDialogBar dialog. If you push the start button some processing should be done and the result should be displayed in the right View. How can I do this? As I see it there is no way to give the doc or view class access to the dialogbar class and the other way too. X| 2) Isn't there an easy and simple example of an application that uses register cards and diffent dialogs on every page? You know like the preferences dialog unter Visual C++ -> Project -> Preferences ? Or think about the tiny search program for Windows 95, 98, 2000? :omg: It has all elements I need for my application. Different Dialogs with a propertysheet, and the result of the processing is displayed in an explorerlike Listview. Although it is just a simple application I did not see sourcecode for a similar program. Thank you for your time and help! :rose:

    C / C++ / MFC c++ question html com help

  • How to view a file with default viewers?
    R ryuki

    Thanks a lot! I managed to solve my problem. :-D

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

  • How to view a file with default viewers?
    R ryuki

    How can I view a file with an external viewer from within my application? I know I could use the "system" command, but then I have to give the path to the external viewer, but what when I don't know the path? I mean if my application needs to view a html page I could give a path to netscape or IE, but what if there is not one of them at the system because the user only installed opera? Is there a quick and easy way to access the windows default viewer for the different fileformats? You know if you doubleclick on a file windows starts an application for viewing or editing that fileformat. Is there a command to do that easiely in a VC++ project?

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

  • modeless dialog trouble
    R ryuki

    Thank you! It worked perfect. Even when dwLen=1 it is enough to make the second dialog accessable.

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

  • Don't have an account? Register

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