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

Manmohan29

@Manmohan29
About
Posts
60
Topics
21
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How old were you when you first wrote a line of code ?
    M Manmohan29

    I was 7 :) It all started with LOGO.

    --------------------------------------------- _" Future Lies in Present "_Manmohan Bishnoi

    The Lounge question

  • Data from multiple tables
    M Manmohan29

    yes you were right. I had to change actual data of those fields. thanks

    --------------------------------------------- _" Future Lies in Present "_Manmohan Bishnoi

    Database question sales

  • Data from multiple tables
    M Manmohan29

    Actually I modified the fields SaleDateTime and PurchaseDateTime. These fields contain only date values like 09-11-2011.

    --------------------------------------------- _" Future Lies in Present "_Manmohan Bishnoi

    Database question sales

  • Data from multiple tables
    M Manmohan29

    I have two tables like this Sales table Purchases table --------------------- ------------------------------ SaleDateTime | Cost PurchaseDateTime | Cost --------------------- ------------------------------ 02-09-11 | 35 02-09-11 | 48 03-09-11 | 35 02-09-11 | 48 06-09-11 | 35 04-09-11 | 48 07-09-11 | 35 05-09-11 | 48 08-09-11 | 35 08-09-11 | 48 I want to produce result like this Date | Sale_total | purchase_total -------------------------------------------- 02-09-11 | 35 | 96 03-09-11 | 35 | 0 04-09-11 | 0 | 48 05-09-11 | 0 | 48 06-09-11 | 35 | 0 07-09-11 | 35 | 0 08-09-11 | 35 | 48 how can I do this ? Additional info:- I am using MS Access.

    --------------------------------------------- _" Future Lies in Present "_Manmohan Bishnoi

    Database question sales

  • CFormView control sizing
    M Manmohan29

    yes you were right. now code is working. thanks. :thumbsup:

    --------------------------------------------- _" Future Lies in Present "_Manmohan Bishnoi

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

  • CFormView control sizing
    M Manmohan29

    I use it to just test whether grid_rect fetches some values or not. Ok. I comment it out. But still it doesn't help.

    --------------------------------------------- _" Future Lies in Present "_Manmohan Bishnoi

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

  • CFormView control sizing
    M Manmohan29

    In CMainView :- grid_rect {top=-0 bottom=912 left=0 right=1819} CRect In CMembersView :- grid_rect {top=-32639 bottom=-32483 left=-32709 right=-31884} CRect

    --------------------------------------------- _" Future Lies in Present "_Manmohan Bishnoi

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

  • CFormView control sizing
    M Manmohan29

    Doesn't help much.

    --------------------------------------------- _" Future Lies in Present "_Manmohan Bishnoi

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

  • CFormView control sizing
    M Manmohan29

    This is working fine :-

    void CMainView::OnInitialUpdate() // CMainView is my application's default view
    {
    CFormView::OnInitialUpdate();

    initialized = TRUE;
    CWnd \*pGridCtrl = GetDlgItem(IDC\_SALEPURCHASEGRIDCTRL);
    CRect rect,grid\_rect;
    
    CWnd \*pWnd = this->GetOwner();
    pWnd->GetClientRect(rect);
    
    
    pGridCtrl->GetWindowRect(grid\_rect);     // works fine here
    grid\_rect = rect;
    grid\_rect.left += 16;
    grid\_rect.top += 150;
    grid\_rect.bottom -= 300;
    grid\_rect.right -= 16;
    
    pGridCtrl->MoveWindow(grid\_rect);        // GridCtrl is resized properly
    

    .
    .
    .

    This is not working properly:-

    void CMembersView::OnInitialUpdate()
    {

    CFormView::OnInitialUpdate();
    
    initialized = TRUE;
    CWnd \*pGridCtrl = this->GetDlgItem(IDC\_MEMBERSGRID);
    ASSERT(pGridCtrl);		// Must exist
    
    CRect rect,grid\_rect;
    
    CWnd \*pWnd = this->GetOwner();
    pWnd->GetClientRect(rect);                // Also tried with &rect
    
    pGridCtrl->GetWindowRect(grid\_rect); // problem is here. no grid\_rect coordinates.   Also tried with &grid\_rect
    grid\_rect = rect;
    grid\_rect.left += 16;
    grid\_rect.top += 150;
    grid\_rect.bottom -= 300;
    grid\_rect.right -= 16;
    
    pGridCtrl->MoveWindow(&grid\_rect);
    

    .
    .
    .

    --------------------------------------------- _" Future Lies in Present "_Manmohan Bishnoi

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

  • CFormView control sizing
    M Manmohan29

    I have two views ( CMainView and CMembersView ) in my SDI application. The code below resizes my MFC GridCtrl according to size of app's window when the view is initialized. I get valid values for CRect grid_rect {top=0 bottom=952 left=0 right=1819} in CMainView. But in CMemberView I am having some undesired values.

    void CMembersView::OnInitialUpdate()
    {

    CFormView::OnInitialUpdate();
    
    
    initialized = TRUE;
    
    CWnd \*pGridCtrl = this->GetDlgItem(IDC\_MEMBERSGRID);
    ASSERT(pGridCtrl);		// Must exist
    
    CRect rect,grid\_rect;
    
    CWnd \*pWnd = this->GetOwner();
    pWnd->GetClientRect(rect);
    
    
    **pGridCtrl->GetWindowRect(grid\_rect); // problem is here. no grid\_rect coordinates
    

    // grid_rect {top=-32639 bottom=-32483 left=-32709 right=-31884} CRect**
    // some adjustments
    grid_rect = rect;
    grid_rect.left += 16;
    grid_rect.top += 150;
    grid_rect.bottom -= 300;
    grid_rect.right -= 16;

    pGridCtrl->MoveWindow(grid\_rect);
    

    Where am I going wrong ?

    Future Lies in Present. Manmohan Bishnoi

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

  • Proxy aware application
    M Manmohan29

    by proxy aware i meant to say that the application should detect proxy setting from computer. I'll try CInternetSession. The third parameter i.e., Access Type Parameter Value INTERNET_OPEN_TYPE_PRECONFIG should do the work.

    Future Lies in Present. Manmohan Bishnoi

    C / C++ / MFC sysadmin help tutorial question workspace

  • Proxy aware application
    M Manmohan29

    How to make my applications proxy aware? Actually the problem i'm facing is that our network admin has installed a HTTPS proxy server in our campus LAN and my older applications are not aware of proxy configuration. :confused::confused::confused:

    Future Lies in Present. Manmohan Bishnoi

    C / C++ / MFC sysadmin help tutorial question workspace

  • Help - Horizontal dropdown menu
    M Manmohan29

    Thanks, It works :thumbsup: But why the problem was there in IE; was it due to the reason the way IE handles CSS ?

    Future Lies in Present. Manmohan Bishnoi

    JavaScript javascript help html css tools

  • Help - Horizontal dropdown menu
    M Manmohan29

    hello everyone, i am writing a code for horizontal dropdown menubar the problem i'm facing is that the menu just works fine in firefox :) , but in Internet explorer the submenu is shifting to 30 pixels to the right when mouse is over the menu :( . I don't know that it is actually shifting or aligning to center ??? :confused: the background image i m using for menu buttons is 150x35 px in dimension. Here's my code for all the files:- home.html -------------------------------------------------------------------------------------------

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <link href="css/menu.css" rel="stylesheet" type="text/css" />
    <script language="JavaScript" type="text/javascript" src="scripts/menu_script.js"></script>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <div class="Menubar">
    <ul>
    <li class="nav_li"><a href="#" class="menu1" id="m1">Item 1</a></li>
    <li class="nav_li"><a href="#" class="menu2" id="m2" onmouseover="showmenu('m2', 'sm2')" onmouseout="hidemenu('m2', 'sm2')">Item 2</a></li>
    <ul class="submenu2" id="sm2" onmouseover="showmenu('m2', 'sm2')" onmouseout="hidemenu('m2', 'sm2')">
    <li class="nav_li"><a href="#">Item 2.1</a></li>
    <li class="nav_li"><a href="#">Item 2.2</a></li>
    <li class="nav_li"><a href="#">Item 2.3</a></li>
    </ul>
    <li class="nav_li"><a href="#" class="menu3" id="m3">Item 3</a></li>
    <li class="nav_li"><a href="#" class="menu4" id="m4" onmouseover="showmenu('m4', 'sm4')" onmouseout="hidemenu('m4', 'sm4')">Item 4</a></li>
    <ul class="submenu4" id="sm4" onmouseover="showmenu('m4', 'sm4')" onmouseout="hidemenu('m4', 'sm4')">
    <li class="nav_li"><a href="#">Item 4.1</a></li>
    <li class="nav_li"><a href="#">Item 4.2</a></li>
    <li class="nav_li"><a href="#">Item 4.3</a></li>
    </ul>
    </ul>
    </div>

    </body>
    </html>

    ------------------------------------------------------------

    JavaScript javascript help html css tools

  • How to find multiple servers on LAN using TCP socket
    M Manmohan29

    Suppose I create a thread for every subnet. .then How many TCP sockets should i use (Per thread) ? My loop is like this - for(;;) {for(;;) {for(;;) {for(;;) { connect(MySocket, ...); } } } } then how do i decide socket's TIMEOUT if i use single socket per thread ?

    Future Lies in Present. Manmohan Bishnoi

    C / C++ / MFC question tutorial

  • How to find multiple servers on LAN using TCP socket
    M Manmohan29

    How can I find multiple servers Listening on our college LAN using TCP socket ? my loop will run from ip 192.168.100.0 to 192.168.120.255.

    Future Lies in Present. Manmohan Bishnoi

    C / C++ / MFC question tutorial

  • Owner drawn ListBox problem
    M Manmohan29

    It's solved :cool::thumbsup: just done as you said with some modification:- REPLACE

    COLORREF rgbBkgnd = COLOR_WINDOW;

    WITH

    COLORREF rgbBkgnd = ::GetSysColor(COLOR_WINDOW);

    Thanks SUPERMAN

    Future Lies in Present. Manmohan Bishnoi

    C / C++ / MFC c++ wpf graphics help tutorial

  • Owner drawn ListBox problem
    M Manmohan29

    now background goes black for each line added to the listbox.

    Future Lies in Present. Manmohan Bishnoi

    C / C++ / MFC c++ wpf graphics help tutorial

  • Owner drawn ListBox problem
    M Manmohan29

    removing these lines causes my control to not even display a single line. now my listbox is not displaying anything in it.

    Future Lies in Present. Manmohan Bishnoi

    C / C++ / MFC c++ wpf graphics help tutorial

  • Owner drawn ListBox problem
    M Manmohan29

    I created a listbox (owner drawn) using the code given below. the problem with my application is that when i click on any item in the listbox it gets selected :confused:. how to rectify that ? Here's my code :- CChatHistory is my ListBox's class name

    // ChatHistory.cpp : implementation file
    //

    #include "stdafx.h"
    #include "sock.h"
    #include "ChatHistory.h"

    // CChatHistory

    IMPLEMENT_DYNAMIC(CChatHistory, CListBox)

    CChatHistory::CChatHistory()
    {

    }

    CChatHistory::~CChatHistory()
    {
    }

    BEGIN_MESSAGE_MAP(CChatHistory, CListBox)
    END_MESSAGE_MAP()

    // CChatHistory message handlers

    // Colored entries in List Box

    //		Override the CListBox::MeasureItem virtual function to specify the height for each item.
    
    
    //		Override the CListBox::DrawItem virtual function to perform the painting.
    
    
    //		Override the CListBox::CompareItem virtual function to determine the order in which the a string has to be added. This is necessary only if you wish to have a sorted list. 
    //		Note that the list box should have the LBS\_OWNERDRAWVARIABLE and LBS\_HASSTRINGS styles set. You need to select these styles for the list box when you create it using a resource editor. Otherwise, if you create the list box dynamically, specify these styles during creation. 
    
    //		The following CLineListBox class provides an implementation. Here the color for the text is stored as item data and retrieved during painting. First, we implement the AddItem function, which adds the string to the list box and stores the color in the 32-bit item data associated with the string:
    

    void CChatHistory::AddItem(const CString& str, COLORREF rgbText)
    {
    int nIndex;
    nIndex = AddString(str);
    if( CB_ERR != nIndex )
    SetItemData(nIndex, rgbText);
    }
    // Next, we override DrawItem to draw the string in the color stored in the item data:

    void CChatHistory::DrawItem(LPDRAWITEMSTRUCT lpDIS)
    {
    CDC dc;
    CRect rcItem(lpDIS->rcItem);
    UINT nIndex = lpDIS->itemID;
    COLORREF rgbBkgnd = ::GetSysColor((lpDIS->itemState & ODS_SELECTED) ?COLOR_HIGHLIGHT : COLOR_WINDOW);
    dc.Attach(lpDIS->hDC);

    		// Save these value to restore them when done drawing.
    		COLORREF crOldTextColor = dc.GetTextColor();
    		COLORREF crOldBkColor = dc.GetBkColor();
    
    		CBrush br(rgbBkgnd);
    		dc.FillRect(rcItem, &br);
    		if( lpDIS->itemState & ODS\_FOCUS )
    			dc.DrawFocusRect(rcItem);
    		if( nIndex != (UINT)-1 )
    		{
    			// The text color is stored
    
    C / C++ / MFC c++ wpf graphics help 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