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
H

Harsh Shankar

@Harsh Shankar
About
Posts
22
Topics
9
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Pre used resource ids by visual studio
    H Harsh Shankar

    Hi guys, Today i discoverd a new problem with Visual Studio. I used a resource ID for string resource as 16033 and when with the running application, keeping the mouse to the Close button of the same string got over as tooltip.:confused: After some random hits i found that it is the same value of the IDS_AFXBARRES_AUTOHIDEBAR and it have used the range from 16000 to 17109:mad:. Now i want to know what value should be kept and what is not safe or used by the VS. Even after googling got no lucks.:confused: can some one help me over it??

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC visual-studio help question csharp lounge

  • Putting CMFCToolBar in CFormView problem
    H Harsh Shankar

    Thanks for the relpy Eugen Podsypalnikov, however i have done the same in my code its not working :( and i have no clues why is it so.. the bitmaps are still improper, buttons are disabled and i am getting no update message for them..

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC help announcement

  • Putting CMFCToolBar in CFormView problem
    H Harsh Shankar

    Hi Guys,
    Need help in the current task..
    I was  trying to put a CMFCToolBar inside the CFormView and i thought will have no problems and used the code bellow. Now this form view is to be kept a Dockable pane. But while doing this i got few problems. To put the toolbar in the FormView, i did this..
    The TOOLBAR in the RC File is like this..

    IDR_TOOLBAR1 TOOLBAR 16, 16
    BEGIN
    BUTTON IDC_BTN_1
    BUTTON IDC_BTN_2
    BUTTON IDC_BTN_3
    END

    The InitialUpdate of the FormView Derived class is like this: -

    void CMyFormView::OnInitialUpdate()
    {
    CFormView::OnInitialUpdate();
    CWnd *pWnd = NULL;
    CRect rcPos;
    if(!m_wndToolView.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_TOOLBAR1))
    {
    TRACE0("Failed to Create Dialog Toolbar\n");
    }
    m_wndToolView.LoadToolBar(IDR_TOOLBAR1, 0, 0, TRUE /* Is locked */);
    m_wndToolView.CleanUpLockedImages();
    m_wndToolView.LoadBitmap(IDR_TOOLBAR1, 0, 0, TRUE /* Locked */);
    m_wndToolView.SetPaneStyle(m_wndToolView.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | WS_CHILD | WS_TABSTOP);
    m_wndToolView.SetPaneStyle(m_wndToolView.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));
    m_wndToolView.SetOwner(this);
    CSize szToolBar = m_wndToolView.CalcFixedLayout( FALSE, TRUE ); // returning CSize(69,24).. which should have been CSize(48, 16)
    }

    Now a few problems i am getting are: -
    1. The Toolbar images are not coming proper
    2. The Update of the Toolbar items is not coming.

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC help announcement

  • convert UCHAR array to UINT array
    H Harsh Shankar

    fasked wrote:

    void uchar2uinta(UCHAR * in, UINT * out, size_t outlen) { while(outlen--) { *out++ = uchar2uint(in); in += 4; } }

    Try this instead, its simpler and will do the same you are looking for void uchar2uinta(UCHAR * in, UINT * out, size_t outlen) { while(outlen--) { *out++ = *(UINT*)in; in += 4; } }

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC data-structures tutorial question

  • Context Menu and Modelless Dialogs problem
    H Harsh Shankar

    Hi guys, As i am working on MDI application on VS2008, it had few modeless dialogs and tabbed views. During work, i found that if a modelless dialog is there and i invoked some context menu from the view, and now i clicked on the button of the modeless dialog, the dialog gets activated but the menu is not gone. I guess i am clear what is the problem. as this is a normal problem and can be reproduced easily, no reelevent code snippet can be given. Expecting some quick help..

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC help question

  • Opening File that is already exclusively opened
    H Harsh Shankar

    Hi Guys, As i was working i got a problem. as i have to open a file, i simply call CreateFile and it Opens it. now if some application like MS Excel ect have open it previously, it is not letting me open the file.. now if it is about sharing voilation, how notepad manages the file to open it?? i think i am clear to whar i require Expecting some Quick responce..

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC help question

  • Application Theme changes automatically
    H Harsh Shankar

    Thanks Eugen, I'll try n let you know..

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC help c++

  • Application Theme changes automatically
    H Harsh Shankar

    Hi guys, Looking for some help... In my application using VS2008 (MFC 9.0) + SP1, i encountered an error and i felt that it is of the MFC/Framework. I am giving a very simple scenerio, and i hope amy body may reproduce it easyly. Follow these steps: - 1. Create a new MFC Application Project. 2. The type i choose is MultiDoc Application with Doc/View Support and Office Project Style and Ribbon Menu Here my View is derived from CScrollView. Now i Run the Application and changed the theme, say to Silver and now i hibernated the PC. After Starting the PC i got that the application is in the default theme (BLUE). However as i checked the selected style in the menu, its still the Silver. I an expecting any boddy will help me soon.


    Regards Harsh

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC help c++

  • Watermark printing
    H Harsh Shankar

    Hi, First of all thanx replying Richard, Well if i'll pring or draw something and then if something will come over it, it will be gone. Even Suppose I'll make the impression of "INTRODUCTION" on the DC and in some next step i'll draw a text like "abc<10-20spaces>xyz", what ever will be written bellow the white spaces will again be gone.. I hope you got the problem

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC help

  • Watermark printing
    H Harsh Shankar

    hi guys, In my current assignment, i am looking to print watermark on the page as per the type of the page, say on the introduction page i wish a watermark of "INTRODUCTION". i firstly tried some googling. but so far no lucks :((.. I guess i am clear what i need.. any body please help..

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC help

  • CDockablePane AutHide issue
    H Harsh Shankar

    Hi guys, Looking for some help.. In my current assignment, its needed to hide all the Dockeble panes and to get them back as they where before hiding. during hidden period, they should not be visible/available to the user. it is some how like closing the project and opening a new project in the Visual studio IDE. However it is working fine with al the panes until they are not in the AutoHide mode. to resolve the issue, i first set Checked the Auto Hide state, if its true, then i set it to false. Now as on getting back i want to turn the pane back in the Autohide state, i set it by calling the function: SetAutoHideMode(TRUE, CBRS_ALIGN_ANY); but then the application crashes :( Here is the snap of the code to clear the problem: - To Save the state, i did this:- pPane is the pointer of the CDockablePane

    m_nState = 0;
    if(pPane->m_hWnd)
    {
    if(pPane->IsDocked() && pPane->IsAutoHideMode())
    {
    pPane->ToggleAutoHide();
    m_nState = 1;
    }
    else if(pPane->IsVisible())
    {
    m_nState = 2;
    }
    pPane->ShowPane(FALSE, FALSE, FALSE);
    }

    To Set the previous state i did this:- Here since i have passed the pointer with CPane

    if(m_nState == 0)
    {
    return;
    }
    pPane->ShowPane(TRUE, FALSE, TRUE);
    if((m_nState == 1) && pPane->IsDocked() && !pPane->IsAutoHideMode())
    {
    pPane->SetAutoHideMode(TRUE, CBRS_ALIGN_ANY);
    }

    And then It calles crash at BOOL CDockablePane::CheckStopSlideCondition(BOOL bDirection).

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC help visual-studio csharp

  • Print Preview on Main frame in MDI Application
    H Harsh Shankar

    Hi sashoalam, So do you think i should minimize all the Ribbons by some explicite call. But don't you think, making calls for hiding all the views, menues, tabs, Panes etc and maintaining its previous states is not really a good idea if you may have about 10 Ribbon-tabs, about 10-20 Panes and uncountable Views are possible. Event on remembering the 6.0 days, you'll notice that we didn't have to do all those things by us and it was MFC's responsbility to do so. i think must have understood my problem.

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC help

  • Print Preview on Main frame in MDI Application
    H Harsh Shankar

    Hi Sashoalm,

    sashoalm wrote:

    What about minimizing the ribbon? Try minimizing the ribbon before print preview and see if you like it.

    It is not practically possible and good to hide all the ribbons, views and panes on Preview and restore them OnEndPreview since the are many in count.. Like in VC 6.0, i didn't needed to do any thing like that and the compiler was doing this for me, i want something like that. Thanks

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC help

  • Print Preview on Main frame in MDI Application
    H Harsh Shankar

    Hi, Thanks for quick reply.

    sashoalm wrote:

    try to place the code I posted in CMainFrame::OnFilePrintPreview

    There is an issue in doing as you are saying but there is no such function "DoPrintPreview" in class CMDIFrameWndEx from which the CmainFrame Class is derived.. However, i already have tried:

    CView *pView = GetActiveFrame()->GetActiveView();
    if(pView == NULL)
    {
    return;
    }
    CPrintPreviewState* pState = new CPrintPreviewState;

    if (!pView->DoPrintPreview(AFX_IDD_PREVIEW_TOOLBAR, pView,
    RUNTIME_CLASS(CPreviewView), pState))
    {
    delete pState; // Preview failed to initialize, delete State now.
    pState = NULL;
    }

    But it prepares the preview in the same document only and not capturing the frame. And this not what i wanted :( Please suggess something else.

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC help

  • Print Preview on Main frame in MDI Application
    H Harsh Shankar

    Hi sashoalm, First thanks for replying... I already know the way how to prepare print preview. But i guess i was not clear enough with my requirement. My requirement is to show the preview capturing the entire main frame including all Menues, Panes, Views etc in VS 2008, how VS 6.0 does. In VS2008, the preview comes like a view only and menues etc are remain enabled.. Please suggess something else may be that will help... Thanks

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC help

  • Print Preview on Main frame in MDI Application
    H Harsh Shankar

    Hi All, I am working on VC2008's MDI application with Ribbon bar and have to provide print preview. Now, However VC2008 do have print preview, but the client requires it to look it like the VC6.0's Print preview capturing the entire main frame along with some certain buttons, all like VC6.0. Can some body please help me on it

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC help

  • running a application as service
    H Harsh Shankar

    Madhu Nair wrote:

    How to: Create Windows Services[^] (C++ Programming)

    Sorry Madhu, but i don't think it gives any good light on what the question is :(

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

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

  • Querry!!
    H Harsh Shankar

    Wouldn't it be easier to read and write the data in the file by my given way??

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    modified on Tuesday, June 30, 2009 5:25 AM

    C / C++ / MFC question

  • Querry!!
    H Harsh Shankar

    I Don't know why u are trying there tipical methods. Just Try the "C" way: -

    struct MyStruct
    {
    	char Name\[20\];
    	int age;
    }
    // Fill the Structure with the appropriate values
    MyStruct myStruct;
    FILE \*pFile = fopen("Record.txt", "Wb+");
    fwrite((char\*)&myStruct, sizeof(MyStruct), 1, pFile);
    

    and to reead :-

    fread((char*)&myStruct, sizeof(MyStruct), 1, pFile);

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    C / C++ / MFC question

  • Querry!!
    H Harsh Shankar

    Dear Razanust, I'll first suggess you not to create a new thread if you aren't satisfied with the answer.

    Razanust wrote:

    couldn't get that. Plesae elaborate the clue so that i can learn a bit more. I am trying to use the "isdigit" command for this purpose. Would that be suitable?

    Now, as your file is a text file, :confused: First Clear whether you have stored it by formating by sprintf and then WriteFile etc or Writing the structure directly? HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    modified on Tuesday, June 30, 2009 3:59 AM

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