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
D

Daffy d

@Daffy d
About
Posts
3
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Random Numbers
    D Daffy d

    This works for me : srand( (unsigned)time( NULL ) ); // Initialise rand with the current time to get // a truly random seed int ivariable = rand() % 5 // result between 0 and 5

    C / C++ / MFC help tutorial question lounge

  • Scrollbar looses grip
    D Daffy d

    Sorry I forgot the setup of the scroll bar :-O Its done like this. SCROLLINFO si ; si.cbSize = sizeof(SCROLLINFO) ; si.fMask = SIF_PAGE | SIF_RANGE ; si.nPage = myRect.Width() - 110; // The 110 is because I type measurement related info in a small box there. si.nMax = pDoc->m_datasize + myRect.Width() - 110; si.nMin = 0 ; I hope someone can help. Thanks.

    C / C++ / MFC css com help tutorial

  • Scrollbar looses grip
    D Daffy d

    Hi there! I’m currently playing with a PICO scope. (it’s a small parallel port oscilloscope that runs at 20KHz max.) I’m trying to make a custom graphical interface showing the results acquired from the scope (was hoping to use it in a dynamometer project I was planning) . This part of the deal runs great. But I wanted to add a horizontal scroll bar to make navigation trough the data easier. So l borrowed from Roger Allens tutorial. On scrollbars (http://www.codeproject.com/miscctrl/Scrollbar.asp) And everything works almost according to plan. Unfortunately I’m using a quite large data buffer. -16 KB to 512 KB. Ant that’s where things get strange. It seems that things behave quite normal when I’m below 32KB. But as soon as I get above 32 KB the scrollbar position returns to 0 and starts counting over - When using “SB_THUMBTRACK” and “SB_THUMBPOSITION” But behaves normal (counts and scrolls all the way up to 512KB) when using all the other “positioning” options (like SB_PAGE & SB_LINE) The problem looks like the variable holding the bar position has a max of 32768 and than turns over to 0. (but only when dragging the bar) That would be a 16 bit signed variable. But the SCROLLINFO.nPos which I use is a int so that shouldn’t be the problem. My code is as I said pulled more or less directly from Rogers tutorial and looks like this : // m_datasize is the size of the collected data 16 KB to 512 KB. int i_CurPos = GetScrollPos(SB_HORZ); int iPrevPos = i_CurPos; CRect myRect; GetClientRect(&myRect); switch(nSBCode) { case SB_LEFT: i_CurPos = 0; break; case SB_RIGHT: i_CurPos = GetDocument()->m_datasize; break; case SB_LINELEFT: i_CurPos = max(i_CurPos -6, 0); break; case SB_LINERIGHT: i_CurPos = min(i_CurPos + 6,(GetDocument()->m_datasize+ myRect.Width() - 110)); break; case SB_PAGELEFT: i_CurPos = max(i_CurPos - myRect.Width(), 0); break; case SB_PAGERIGHT: i_CurPos = min(i_CurPos + myRect.Width(), (GetDocument()- \ >m_datasize + myRect.Width() - 110)); //- myRect.Width()-1)); break; // The part that doesn’t work case SB_THUMBTRACK: case SB_THUMBPOSITION: i_CurPos = nPos ; break; // The part that doesn’t work } SetScrollPos(SB_HORZ, i_CurPos); ScrollWindow(iPrevPos - i_CurPos, 0) ; A

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