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

Roman Fadeyev

@Roman Fadeyev
About
Posts
70
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • CArray woes
    R Roman Fadeyev

    Firstly, i advise you to read at least a couple pages of any book about templates. It will help you to control a situation. As for your question, you should type: CArray < SRawData, SRawData& > m_array1; Notice that your function

    CArray CRainAttDoc::GetRawDataArray()

    will copy whole array since you return it by value, not by ref. It is better way to use

    const CArray<......> & CRainAttDoc::GetRawDataArray() const

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

  • Focusing window
    R Roman Fadeyev

    Hmmm... This forum is generally about VC, not VB. But if you want.. it's a SetForegroundWindow. This function "puts the thread that created the specified window into the foreground and activates the window. Keyboard input is directed to the window, and various visual cues are changed for the user.". You also can try to use SetFocus function, but i do not guarantee it will work between processes

    C / C++ / MFC json

  • Using CRichEditView in Splitter window
    R Roman Fadeyev

    OK. Then you can use a notify message EN_SELCHANGE, which inform you about cursor position changing. You can find out current line by means of EM_GETSEL, EM_LINEFROMCHAR, EM_LINEINDEX messages. Then, knowing total count of lines in the edit and current line you can calculate vert. scrollbar's thumb position. Something similar is possible for horz. scrollbar too Is it convenient solving for you?

    C / C++ / MFC question announcement

  • Detecting 16/32 bit DLLs
    R Roman Fadeyev

    Matt Pietrek, "Windows 95 System Programming Secrets", Chapter 8. May be, it will help you.

    C / C++ / MFC csharp php question

  • Invalidate window...
    R Roman Fadeyev

    Neha wrote: I want to send WM_ERASEBKGND message to the control. SendMessage(YourHandle, WM_ERASEBKGND, YourHDC,0)???? But for what? It can't give you anything useful. Use InvalidateRect if you want to repaint certain rectangle of the window.

    C / C++ / MFC question

  • Right aligned Tree !
    R Roman Fadeyev

    In standard way - nowise. There is only sole method to do it - to write own tree. ;) It might be possible to use ownerdraw style, but as I understood you need to mirror whole tree, with buttons, lines and etc, didn't I? In this case ownerdraw style won't help.

    C / C++ / MFC game-dev question html database com

  • Using CRichEditView in Splitter window
    R Roman Fadeyev

    But why to not make it vice versa? Hide the scroll bar of slitter window, align your richedit control in all client area of splitter window and all will be pleased. :)

    C / C++ / MFC question announcement

  • Project / Workspace
    R Roman Fadeyev

    What's the problem? Create CProjectDoc class derived from CDocument, create CProjectDocTemplate from CDocTemplate. The document tree is your project view. Then you are creating some interface for you class, something likes as void AddToProject(LPCTSTR szFileName) void RemoveFromProject(LPCTSTR szFile) and etc. The project is a simplest type of document I have ever seen. Then, workspace's scheme: If you want use same tree for all open projects, you must refuse to use view in CProjectDoc. Point to MFC that you document has no any views

    void CProjectDocTemplate::InitialUpdateFrame(CFrameWnd* pFrame, CDocument* pDoc,BOOL bMakeVisible)
    {
    // __super :: InitialUpdateFrame(pFrame, pDoc, bMakeVisible);
    pFrame->DestroyWindow();
    }

    and create separate window (of course, docked :) to a hair's breadth as microsoft - chief of fashion) and scan all projects and show their contents as you wish. I had once similar project and i don't mind to share it with you, but it is simpler to make it on its own than to ransack some thousands lines of foreign code

    C / C++ / MFC c++ visual-studio question workspace

  • How to compress files in a ZIP file ??
    R Roman Fadeyev

    http://www.gzip.org/zlib/ [^] http://www.codeproject.com/useritems/uoth.asp[^]

    C / C++ / MFC tutorial question

  • How to judge a handle?
    R Roman Fadeyev

    GetHandleInformation()

    C / C++ / MFC tutorial question

  • Invalidating() all view
    R Roman Fadeyev

    UpdateAllViews() in CDocument. Look at http://www.codeproject.com/script/comments/forums.asp?forumid=1647&select=358653&df=5#xx358653xx for details

    C / C++ / MFC question c++

  • Handles to View Classes :: MFC
    R Roman Fadeyev

    If you mean sending to some views belonging to the same document, the way is to use

    POSITION pos = GetFirstViewPosition();
    while (pos != NULL) {
    CView* pView = GetNextView(pos);
    ...
    }

    For some documents use CDocTemplate::GetFirstDocPosition/GetNextDoc and then - the code above To enumerate all views of all documents of all types you can use CDocManager::GetFirstDocTemplatePosition/GetNextDocTemplate, then see above How to get instance of docmanager see CWinApp documentation. If my memory doesn't fail me, CWinApp have a member m_pDocManager

    C / C++ / MFC c++ question

  • Detect the path where is running an application VC++
    R Roman Fadeyev

    geo_m is completely right. But I would add little remark: you can pass NULL to GetModuleFileName() to retrieve your app path. It's easier to use. Especially it is important to pass NULL when you get AppPath from DLL. How to cut filedir from path? All functions for manipulating with filenames are placed in shlwapi.h. Their names are beginning from "Path" word. For example: PathFindFileName (Searches a path for a file name). Also you can use C++ function _splitpath

    C / C++ / MFC c++ question

  • CString Vs std::string
    R Roman Fadeyev

    Unfortunately, you can't. In concept of C++ std library you must use streams (like as stdout, stdin and etc). This method was perfectly described by Alexandrescu in his book "Modern C++...". But personally I like to use old good method as Format. And I have invented my own function. May be it will be useful for you

    string_smart Format(cstr szText,...)
    {
    cstr szPtr=szText;
    size_t lLen;
    //Calculating Average length
    for (lLen=0;*szPtr; ++szPtr,(*szPtr=='%') ?lLen+=10:lLen++);

    string\_cstr strRes(++lLen);
    
    va\_list marker;
    va\_start( marker, szText);     
    
    while (\_vsnprintf(strRes.buffer(),strRes.buffer\_size()-1,szText,marker) <0 ) 
    	strRes.reserve(strRes.buffer\_size()\*2);
    
    //\_ASSERTE( \_CrtCheckMemory( ));
    strRes.buffer()\[strRes.buffer\_size()-1\]='\\0';	//Don't remove this line!
    strRes.recalc\_len();						
    								
    
    va\_end( marker );              
    
    return strRes;
    

    }

    This function works with my class string_smart, but it is not hard to remake it for std::string

    C / C++ / MFC visual-studio question

  • Loading .LIB file and .DLL into MFC App.
    R Roman Fadeyev

    E3 wrote: creating an warpper for that file??? By Hands, sir, by your own hands :)

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

  • Abstract class as interface
    R Roman Fadeyev

    Sovann wrote: This time, the problem exist: there is no HWND attached. I have not understood what it means (hwnd of what???), but I want to give you small advice: mfc classes must be first at deriving order (MSDN says that). Swap 'public ITab' and 'protected CWnd', otherwise you will have a problems

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

  • SetItemText
    R Roman Fadeyev

    David Kadish wrote: What should I do? You should write with what type of control you work. It is a ListView? Show a code. Do you think we have a telepathy?

    C / C++ / MFC question

  • Listview images in LVS_REPORT mode
    R Roman Fadeyev

    ListView_SetImageList(hwnd, ImgListHandle, LVSIL_SMALL);

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

  • Basic MFC question
    R Roman Fadeyev

    This site contains some examples of how to save and restore window position. I saw an article http://www.codeproject.com/docview/persistframes.asp[^] about storing and loading positions of SDI/MDI ChildFrame, MainFrame and so on more recently.

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

  • Problem with CDialogBar e CTreeCtrl
    R Roman Fadeyev

    Override OnCreate (+OnInitDialog for guarantee) in your DialogBar. Set breakpoints at end of functions. Make sure that your TreeCtrl has been created (m_hWnd!=NULL). Just in case try to use GetDlgItem to obtain CTreeCtrl* pointer and check its m_hWnd. If ASSERT or exception raises earlier than you rich these breakpoints, you, it seems, have raise conditions Show us a fragment of code which refuses to run After all, try to rebuild all :)

    C / C++ / MFC data-structures help 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