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
M

misha_grewal

@misha_grewal
About
Posts
56
Topics
35
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Resource Files in Web Farm
    M misha_grewal

    Hello Experts, We have a ASP.Net 2.0 web site.. This web site is now web - farm enabled. The web site provides a User Interface to update the resx files to teh various admin users. So imagine, with web farm setup, there could be a different version of resx file on Server A than Server B.. Can we keep these resx files on a central location? If not, what is the best possible way to resolve this problem? I read a lot about it and it seems the best method is to keep it in a database. The database will also be able to provide the locks etc via the stored proc. The shared assembly option is the other way, but I think that doesn't resolve my problems. The assembly will still have the resx files located on both the server and it doesn't ensure that teh similar files are kept at both ends. Any pointers? This looks like a tough one for me.. Regards, Misha G

    Evil triumphs when good people sit quiet...

    ASP.NET question announcement csharp asp-net database

  • OutProc on State Server: Thread problem
    M misha_grewal

    Hi folks, I am new to ASP.Net development as such, so my questions can be really stupid. Thanks a ton in advance and pointers greately appreciated The problem: For Web Farm setup, we are trying to keep the session data in State Server. We have marked the objects as [Serializable] to make them fit in State Server. Now, we keep some of the data bjects in session and we are also keeping threads that operate on these objects in session. The class looks like: [serializable] Class DataManager { Data1 data1Obj; Data2 data2Obj; [nonserialized]Thread m_thread; [nonserialized]AutoResetEvent m_event; [nonserialized]Thread m_updateThread; ..... } Now we are getting exception as threads and events are non-serializable when we run the program. We added the attribute [nonserialized] to these individual thread variables and events. But the strange thing is, once we allocate the threads and start them, some how the thread objects are set to null. I guess this happens after one serialization operation. So imaginge, the program is continuously stuck on checking the thread null and allocating it again. This obviously is not working at all. // the code looks like void somefunction() { if (m_thread == null) { RespawanThread() // this happens all the time } } My question is even after adding the [nonserialized] tag to the individual thread members, what makes them null after some time?

    Evil triumphs when good people sit quiet...

    ASP.NET help question csharp asp-net sysadmin

  • Output Cache, cookie save and page expiry
    M misha_grewal

    Thanks so much, It seems the query is not clear. I store the credentials in the cookie. The logic is simple, if cookie found, redirect to next page, else ask for credentials. The problem is that the cookie detection is not working when I do not close the browser and again open the login page in a new browser - via clicking favourites. However, if I close the browser and open the link again, the cookie gets detected. The outputcache tag resolves the problem in some sense, that it forces the page to refresh explicitly, so that the cookie is detected once it is stored. I hope it's understandable now. :confused: Thanks

    Evil triumphs when good people sit quiet...

    ASP.NET question csharp asp-net

  • Output Cache, cookie save and page expiry
    M misha_grewal

    Hi, I am absolutely new to Web programming, so pardon me if I write something stupid in between.. And Thanks for reading the question, any pointers are most welcome The website is in ASP.NET 2.0 / IE 6.0, 7.0 We store login details in a cookie via HTTPCookie class, when user says "Remember Me" in the login page. Now, if he doesn't log out and starts the same website via favourites (The login page loads again), the cookie doesn't get detected and he has to enter his credentials again. If he closes the page and loads the browser again, the cookie does get detected. We have added following values in the login.aspx page, which should take care of reloading the page < OutputCache Duration="1" VaryByParam="none" Location="None" NoStore="true" > It seems, either cookie doesn't get stored until the page is detected or the page is not getting reloaded. Any ideas about it? If the question is not clear, please let me know.. Thanks in advance Misha

    Evil triumphs when good people sit quiet...

    ASP.NET question csharp asp-net

  • message handling for a popup window
    M misha_grewal

    Thanks a ton..

    Rajkumar R wrote:

    Actually you caught the WM_CREATE ( == 1 == LBN_SELCHANGE) message which is send only once.

    Yes, I think thats what I was catching.. The windowproc of the list box is getting all the WM messages like WM_KEYDOWN or LBUTTONUP. But a message like LBN_SELCHANGE is never caught in windowproc. why is it so? WM_COMMAND is sent to a parent of a window and the wparam has the message id. In this case, the list box doesn't have any parent as such, so you never receive WM_COMMAND messages

    Evil triumphs when good people sit quiet...

    C / C++ / MFC question c++

  • message handling for a popup window
    M misha_grewal

    I create a list box as a popup window with parent as NONE and display it below a combo box. (This is imitation of intellisearch IE or IAutoComplete in WTL) The creation of the listbox looks like this CMyComboBox::CreateListbox() { BOOL bRet = _list.CreateEx(0, _T("ComboLBox"), _T(""), WS_POPUP | WS_VISIBLE | WS_BORDER | WS_VSCROLL | LBS_NOTIFY, clientRect.left, clientRect.top, clientRect.Width(), clientRect.Height(), this->GetSafeHwnd(), //this is the combobox control's hwnd// NULL, NULL); } I display this listbox when user starts typing some text in the combobox. I add the filtered strings as per the text to this listbox. There are two problems 1. I am trapping all the messages send to Listbox in its windowproc. I find that the first time I display this listbox, I am able to see LBN_SELCHANGE (or other listbox specific messages) being trapped in Windowproc. But they are sent only once. The next time when I try to change any selection, LBN_SELCHANGE is not sent/trapped (I don't know where this message goes). Although the basic messages - LBUTTON_DOWN/UP, KEY_DOWN/UP are being sent to the Listbox. I intend to write something like below, but LBN_SELCHANGE is caught only once. LRESULT CAutoCompListBox::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { case LBN_SELCHANGE: { //Send this message to the combobox with the selected text // as argument }break; Does the question make sense? or its too vague? :~ 2. I need to find a decent way to send the listbox messages to the combobox. Since the combobox is not at all related to Listbox here, I may have to resort to registering a callback in the Listbox to handle the messages. Is there any other way to handle the messages? Thanks first of all for reading the question. Many many thanks if you got some answers

    Evil triumphs when good people sit quiet...

    C / C++ / MFC question c++

  • Can we draw a child window outside the client area of the parent?
    M misha_grewal

    Thanks, that seems to work. the code looks like this: ClientToScreen(&clientRect); BOOL bRet = _listFilter.CreateEx(0, _T("LISTBOX"), _T(""), WS_POPUP | WS_VISIBLE | WS_BORDER | WS_VSCROLL | LBS_NOTIFY , clientRect.left, clientRect.top, clientRect.Width(), clientRect.Height(), this->GetSafeHwnd(), NULL, NULL);

    Evil triumphs when good people sit quiet...

    C / C++ / MFC question

  • Can we draw a child window outside the client area of the parent?
    M misha_grewal

    Thanks, Thats the problem. I don't want to subclass the list box which comes with CCombobox. I have to keep it separate. all ideas would be greatly appreciated.

    Evil triumphs when good people sit quiet...

    C / C++ / MFC question

  • Can we draw a child window outside the client area of the parent?
    M misha_grewal

    I am trying to implement "intellisearch" combo box like we have in IE. I create a separate list box and draw it below combo box when user starts typing in something. The Combo box has to be a parent of this list box. When I draw the list box using the Create method, it offcourse will try to draw the list box inside the client area of the combo box, and fails to do so. Can we draw a child window outside the client area of the parent? bool CAutoCompComboBox::CreateListBox() { CRect clientRect(-1, -1, -1, -1); GetClientRect(&clientRect); // adjust the height to be like a list box BOOL bRet = _listFilter.Create(WS_CHILD | WS_VISIBLE | WS_VSCROLL | LBS_STANDARD, clientRect, this, 1); // the window is created but not seen here. // however this code works, obviously because I give the parent as // dialog box which is holding the AutoCompComboBox control. _listFilter.Create(WS_CHILD | WS_VISIBLE | WS_VSCROLL | LBS_STANDARD, clientRect, GetParent(), 1); Thanks in advance.. Misha

    Evil triumphs when good people sit quiet...

    C / C++ / MFC question

  • Paint problems during scrolling
    M misha_grewal

    I have a CTreeCtrl derived class which does heavy custom drawing for various styles. One of the style is "Right justified" item, that is a tree item should be drawn at the right most corner of the window. Its an hyperlink as well. I have handled NM_CUSTOMDRAW, and I do painting in PrePaint and say a Skip Default to prevent the custom drawn items to be painted again. The code looks like this (Excerpt only) GetItemRect(hItem, textRect, TRUE); //this gets the rect for text only GetItemRect(hItem, itemRect, FALSE); //get the text for full item area if ( itemStyle is Right Justified ) { // subtract offset for right justified itemRect.right -= _offsetRTJustifed; itemRect.left = itemRect.right - textRect.Width(); pDC->DrawText(sItemText, &itemRect, DT_LEFT); } This right justified item is added under a root item and appears when user expands that root item. When the user plays around with the tree items, expanding and collapsing often, the vertical scroll bar appears and disappears as per the number of tree items. Due to this scroll bar appearing/disappearing, the painting of this right justified item gets garbled. (It seems as if the paint messages are lost in between very frequent scroll bar displays/removals).. Its difficult to suggest, but would appreciate if somebody has a clue about it.. Thanks

    Evil triumphs when good people sit quiet...

    C / C++ / MFC wpf graphics data-structures

  • CPropertysheet and tab ctrol
    M misha_grewal

    Hi, I have a property sheet (in wizard mode) and on one property page of this sheet, I have a pop up dialog. This pop up dialog has a tab control which is again showind a child dialog (no border, style = child). So the picture looks like this Property Sheet Property Page launches CMyDialog (pop up) CMyDialog has CTabCtrl and Child dialog to show on the tab. This child dialog doesn't receive any messages. If I click on the dialog, nothing happens. Tabs get changed though. I am wondering if its a focus problem? how should i fix it. The code to add this child dialog with the tab control looks like this Init of Tab Control : Tab Contrl->Add tabs; Create a vector of dialogs Instantiate the dialog class, add it to vector Create and Repos the dialog window, and say ShowWindow. Thanks in advance, Misha

    Evil triumphs when good people sit quiet...

    C / C++ / MFC help graphics question

  • what is a C# reference type
    M misha_grewal

    I just started learning .Net and C#. I come from C++ background. When I declare a class vble // class A is defined; A a; a = new A(); This object a is allocated in heap right? and its a reference type? It seams all class variables are reference types. And it looks like a class pointer to me when I relate to C++. Any good article? thanks, Misha Evil traiumphs when good people sit quiet...

    C# csharp question c++ learning

  • wizard finish button and message box
    M misha_grewal

    Thanks much it works with this call i m really stupid

    C / C++ / MFC question

  • wizard finish button and message box
    M misha_grewal

    oK I digged into the problem a little bit Is it a message queue problem? Code === pWizard->SetWizardButtons(PSWIZB_BACK); CWnd* pButton = pWizard->GetDlgItem(ID_WIZFINISH); if (pButton) { // this call doesn't work pButton->EnableWindow(FALSE); } but if you put a message box before the call, it works, as in if (pButton) { AfxMessageBox(_T("text")); // this call now WORKS pButton->EnableWindow(FALSE); } Code ends == On the other hand, if I call a "ShowWindow" method instead of EnableWindow, it works fine with or without the message box. What happens in EnableWindow?

    C / C++ / MFC question

  • wizard finish button and message box
    M misha_grewal

    I have a property sheet with wizard style. At one place, I need to disable the Finish button. The code doesn't work and the Finish button is enabled. But if I put a message box before calling the SetWizardButton routine, it works. I tried with invalidate method so as to refresh the current windows, but I guess I am missing something. Any pointers? evil triumphs when good people sit quiet..

    C / C++ / MFC question

  • vector assignment operations
    M misha_grewal

    Thanks a lot Stuart, I have one more doubt..

    Stuart Dootson wrote:

    What happens to the objects contained in pVect when the assignment operator is called? There aren't any objects in pVect when the assignment operator is called.

    But what if pVect already has some objects for e.g. *pVect = vect; //(this time vect has 10 objects) //Again at some point in code *pVect = vect; //(this time vect has 5 objects) Regards, Misha

    ATL / WTL / STL graphics question

  • vector assignment operations
    M misha_grewal

    Hi all - I am little confused over the assignment mechanism in std::Vector. I have a standard vector of some class object, lets say MyClass. This vector has various number of objects at various occasions. I also need to keep a backup of this vector, at times. I am using following code: 1. std::vector vect; 2. std::vector *pVect = new std::vector; //(one time initialization in the owner class's ctor) // for assignment 3. *pVect = vect; What happens to the objects contained in pVect when the assignment operator is called? Is it better to use a resize here? Or is it better if I use this code -- // for assignment if (pVect) delete pVect; pVect = new std::Vector(vect)

    ATL / WTL / STL graphics question

  • Auto Complete Combo box
    M misha_grewal

    Hello all - I need to implement a full featured auto complete combo box just like what it is in internet explorer. Thanks to a lot of help available on codeproject, I implemented the basic features. But there is one bug which is driving me mad. The details: I have handled CBN_EDITCHANGE message here. and I let it be handled by the parent also using the ON_CONTROL_REFLECT_EX method. The idea is that I store the original combo entries in a vector. When user types in something, on edit change, I get the string, if it matches, I modify the comob entries with the search entries found (As i already have the original combo entries with me) and then call the drop down method to show the search strings. When user closes the dropdown or expands it, I restore the original state of the combo box. similarly when the search string is empty, i restore the state again. Everything works fine, but when the dropdown is closed, and I try to enter a string, the combo box selects the first matched string in the combo (Which I do not want) Whereas if I expand the combo box, the string is not selected. I Guess this is too much. But still I hope someone has the answer. Thanks in advance Be the change you wish to see...

    C / C++ / MFC help graphics

  • SetCursorPos and GetWindowText
    M misha_grewal

    Hi, I am a newbie in MFC gui programming. Here is one problem that I am facing.. I am setting text in an edit control and then i need to set the cursor at the end of the text. If I use SetEditSel, it highlights the text also. I do not want the highlighting of the text. I just want the cursor to be at the end of the text ,after I have called SetWindowText(). I searched around and found that SetCursorPos can help. But I do not know how to provide the correct text coordinates to this API. any ideas would be greatly appreciated. Code snippet: InSomeHandler(){ GetWindowText(str); // do something SetWindowText(str); // set the cursor at the end: don't know how to do it.. } Be the change you wish to see...

    C / C++ / MFC help c++ json tutorial

  • Hot keys to CToolBar
    M misha_grewal

    Thanks Maximilien, I added accelerator in the main menu bar. But couldn't add it in the toolbar.. but it works.. Thanks a ton again Misha Grewal, Be the change you want to see

    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