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
T

tagopi

@tagopi
About
Posts
48
Topics
15
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Can some one please tell me how to insert items into a friggin CListCtrl
    T tagopi

    Hello, First, see the topic - 'How to ask Questions' in this forum. Second, you are missing lvi.iItem I think. Try adding this and see.

    // Insert item for col 0
    lvi.mask = LVIF_TEXT;
    lvi.iItem = 0;
    lvi.iSubItem = 0;
    lvi.pszText = "one";
    m_ListCtrl.InsertItem(&lvi);
    // Insert subitem for col 1
    lvi.pszText = "two";
    lvi.iSubItem = 1;
    m_ListCtrl.InsertItem(&lvi);

    Regards, A. Gopinath.

    C / C++ / MFC tutorial

  • need help to check my code why unzip operation not working
    T tagopi

    Hello, Did you check what this E_FAIL is returning ? Regards, Gopi.

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

  • How to prevent deleting files from Browse dialog
    T tagopi

    Hello everybody, I am in project with win32. I am using OPENFILENAME structure for selecting a file (GetOpenFileName()). Problem is, it is possible to delete a file in browse dialog, which will create some issues. is there any way to prevent deleting the files in browse dialog? Regards, A. Gopinath.

    C / C++ / MFC help tutorial question

  • CString to float conversion
    T tagopi

    Hello everybody, I am trying to convert CString to float using atof(). but its not giving the exact value. for eg.

       CString strVal;
       GetDlgItem(IDC\_MAXLAYER)->GetWindowText(strVal);
       float mVal = atof(strVal);
    

    IDC_MAXLAYER is edit box and in that, i am having the value 386.080, but after atof() conversion, mVal shows 386.07999 is that possible to get exact 386.080 by converting? Thanks in advance. A. Gopinath.

    C / C++ / MFC question

  • Write Text on child window - SDI application
    T tagopi

    Hello Everybody, I have created one SDI Application with one dialog - having some controls. In that, if I click a button, I want to show a child window and with the following code, I am getting that fine.

    CMainFrame *pMainFrm = ((CMainFrame*)(AfxGetApp()->m_pMainWnd));
    CFrameWnd *pFrame = new CFrameWnd;
    RECT rect;
    pFrame->Create(NULL,_T("Solution"), WS_OVERLAPPEDWINDOW ,rect,this);
    pFrame->ModifyStyle(WS_CAPTION + WS_OVERLAPPEDWINDOW , WS_BORDER,SWP_NOMOVE +SWP_NOZORDER );

    pFrame->InitialUpdateFrame(pMainFrm->GetActiveDocument(),TRUE);
    pFrame->SetWindowPos(&CWnd::wndTopMost,100,200,1000,400,SWP\_SHOWWINDOW);
    pFrame->ActivateFrame(SW\_SHOWNORMAL);
    

    Now, I would like to write some text on that child window. Any suggestions? I tried in google also. Thanks in advance, A. Gopinath.

    C / C++ / MFC question

  • char ** initialization and store values
    T tagopi

    Hello Everybody, I am trying to pass some values to char ** (to a third party library). But i am getting some issue in that.

        char\*\* ids = new char\*\[m\_Size\];
        for(int i=0; i
    

    using that third party function, its creating an output file and in that file the stored value is showing like this.

    GROUP : 46,0
    GROUP : 44,0
    GROUP : 42,0
    GROUP : ÝÝÝÝÝÝÝ݆«ãe,0
    GROUP : 40,0
    GROUP : 38,0

    But if I give values like this, then in output file, the values are showing fine.

    char* ids[6] = {"38", "40", "42", "44", "46", "48"};

    in the output file,

    GROUP : 38,0
    GROUP : 40,0
    GROUP : 42,0
    GROUP : 44,0
    GROUP : 46,0
    GROUP : 48,0

    (see the sequence also)

    what i am doing wrong? initialization ? or passing values ?

    Thanks,
    A. Gopinath.

    C / C++ / MFC help question

  • Unicode CString and fopen problem
    T tagopi

    Hello, Since you set the property to Unicode Character Set, you can try like this.

        CString fileName = L"c:\\\\1.bin";
    CT2CA filen(fileName);
    fopen(filen,"wb");
    

    Hope this helps. Regards, A. Gopinath.

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

  • CView::OnDraw - related question
    T tagopi

    Hello Richard, I debug the whole code by putting breakpoints in all the functions, after closing the dialog, its not going anywhere in the code, remains on the application itself. I am attaching the code herewith. Please download and check. http://www.4shared.com/zip/eDwcyehu/SDITest.html[^] Thanks.

    C / C++ / MFC question c++

  • CView::OnDraw - related question
    T tagopi

    Thanks for you reply. Actually, I created one MFC Application using the Template, and its SDI. So, it creates list of files, Doc, View, etc. For View, i select the base class as CView (in the wizard itself). I removed the default created menu and included my menu list. Now, i added a simple dialog, and for that, I created a class also derived from CDialog. Following are the .h and .cpp file contents .h file

    class CSelectOptionsDlg : public CDialog
    {
    public:
    CSelectOptionsDlg(CWnd* pParent = NULL);
    virtual BOOL OnInitDialog();

    public:
    enum {IDD = IDD_SELECTOPTIONSDLG};

    public:
    void OnOkClicked();

    DECLARE\_MESSAGE\_MAP()  
    

    };

    .cpp

    CSelectOptionsDlg::CSelectOptionsDlg(CWnd* pParent)
    : CDialog(CSelectOptionsDlg::IDD, pParent)
    {

    }

    BEGIN_MESSAGE_MAP(CSelectOptionsDlg, CDialog)

    ON\_COMMAND(IDOK, OnOkClicked)
    

    END_MESSAGE_MAP()

    void CSelectOptionsDlg::OnOkClicked()
    {
    AfxMessageBox("Ok clicked");

    EndDialog(1);	
    

    }

    BOOL CSelectOptionsDlg::OnInitDialog()
    {
    CDialog::OnInitDialog();
    return TRUE;
    }

    As I mentioned earlier, if i add this line in OnDraw, its drawing on the first time only,

    pDC->TextOut(20, 20, L"test sdi", 10);

    Also, in MainFrm.cpp file,

    BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
    ON_WM_CREATE()
    ON_COMMAND(ID_START, OnStartPlan )
    ON_COMMAND(ID_STOP, OnStopPlan )
    ON_COMMAND(ID_SELECTOPTIONS, OnSelectOption )
    ON_COMMAND(ID_EXIT, OnExit )
    END_MESSAGE_MAP()

    void CMainFrame::OnSelectOption()
    {
    CSelectOptionsDlg cSODlg;
    cSODlg.DoModal();
    }

    doing like this. OnDraw is not calling everytime. What I need is, whenever i click ok and close the dialog, OnDraw need to be called. How can i do that? Any help. Thanks.

    C / C++ / MFC question c++

  • CView::OnDraw - related question
    T tagopi

    Ok, I understood what you are trying to say. I added this line only in the existing function. pDC->TextOut(20, 20, L"test sdi", 10); Also, I would request you to read the "How to answer the question", especially, 3rd point.

    C / C++ / MFC question c++

  • CView::OnDraw - related question
    T tagopi

    Hello Everybody, I am new to MFC. I used the application wizard to create a SDI application, I was able to replace the existing menu and toolbar. In this, I added a dialog with some controls. Now, what I need is, whatever the details I got from the dialog controls, I need to display the document view. On CView::OnDraw,I added the code like this. CSDITestDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); if (!pDoc) return; pDC->TextOut(20, 20, L"test sdi", 10); This text is writing only once in the beginning. On closing the dialog, this function is not called, how can I do that? I tried with UpdateAllViews and OnUpdate also. Thanks in advance. A. Gopinath.

    C / C++ / MFC question c++

  • How to lock a file when it is in use?
    T tagopi

    Hello everybody, i am having text file opened in some other application(our application). if i delete this opened file from windows explorer, its deleting, so, at some point, my application crashes (while trying to write). how can i lock that file when it is use in other application? i am using VC++ with win32. Thanks in advance, A. Gopinath.

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

  • CB_SELECTSTRING related question
    T tagopi

    Hello, Yes, you are right, now its working. thanks. Regards, A. Gopinath.

    C / C++ / MFC question help tutorial learning

  • CB_SELECTSTRING related question
    T tagopi

    Hello, sorry, i forgot to add that, i tried this also. CB_FINDSTRINGEXACT also returns the same issue. Thanks, A. Gopinath.

    C / C++ / MFC question help tutorial learning

  • CB_SELECTSTRING related question
    T tagopi

    Hello everybody, i am having a combobox (created through resource), and through code, i am updating the combobox with a list. for example, i am filling with "Kir" and "K". if i use CB_SELECTSTRING to select "K", its always selecting "Kir". if i use "Kj" in place of "K", then the selection between "Kir" and "Kj" is fine. from msdn definition : It selects the first list item, if any, that begins with the characters in the specified text. is there any other method to solve this issue? iam trying like this. SendMessage(hList, CB_SELECTSTRING , -1,(LPARAM)(LPCSTR)tt.c_str()); Thanks in Advance, A. Gopinath.

    C / C++ / MFC question help tutorial learning

  • Determine straight line
    T tagopi

    Thanks Albert, hereafter i will use this page to ask questions related. Regards, A. Gopinath.

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

  • Determine straight line
    T tagopi

    Hello, i will try using "double" type. actually this is related 3D project, need to find straight line or not. Thanks again, A. Gopinath.

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

  • Determine straight line
    T tagopi

    Hello Amarnath, yes, i tried this method also, but iam getting like 0.000002 or something like difference which fails the condition checking. rounding off will solve the solution ? is that right method? Regards, A. Gopinath.

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

  • Determine straight line
    T tagopi

    Hello Richard, Yes, i know its a mathematics question, i tried here so that someone can help me. Thanks for the reply. Regards, A. Gopinath.

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

  • Determine straight line
    T tagopi

    Hello everybody, i am having n-number of points like p1(x,y), p2(x,y), p3(x,y), .... pn(x,y). All points lie on a single line.(either a curve or a straight line). i would like to find, using those points, whether that line is straight or not straight. i googled and tried some of the methods given in examples, (straight line equation, finding if collinear) but those are not working fine even for straight line also. i am using visual studio 2008 with win32 (not MFC). Any ideas ? Thanks in advance, A. Gopinath.

    C / C++ / MFC csharp c++ visual-studio 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