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
S

SJolly

@SJolly
About
Posts
20
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • USB driver
    S SJolly

    How do I do that?

    C / C++ / MFC debugging regex question announcement

  • USB driver
    S SJolly

    Hi all, I am trying to write a driver for a USB device. I have taken the following steps: > Built checked version of BulkUSB from DDK samples. > Adapted the .inf file provided with the sample so that the vendor and product id match those of the device I'm writing the driver for. > Installed the driver using the wizzard - this seems to work fine and the device is reported as working properly. However, no debug messages come out of the system, no matter what I do with the device (unplug/insert/attempt to connect etc). Can anyone see anything I may have missed? Thanks in advance, Simon

    C / C++ / MFC debugging regex question announcement

  • CPropertyPage / CPropertySheet problem
    S SJolly

    Sorry, my fault: I am now titled. :-D Thanks again, Simon

    C / C++ / MFC help question

  • CPropertyPage / CPropertySheet problem
    S SJolly

    Yes - the knowledge base article helped and I am now sorted. ;) Thanks very much, Simon

    C / C++ / MFC help question

  • CPropertyPage / CPropertySheet problem
    S SJolly

    Hi all, I have a set of property pages on a property sheet. I am trying to add a page to the sheet and change the title, but the title does not change. If I do: //AddPage(thepage); //SetActivePage(thepage); SetWindowText("TEST"); CString strTest; GetWindowText(strTest); Then strTest is changed to "TEST" correctly, but the text does not show up on the control. Am i missing something? Thanks and Regards, Simon

    C / C++ / MFC help question

  • random number
    S SJolly

    Yes, my bad - I forgot that the time bit was in seconds.

    C / C++ / MFC lounge

  • random number
    S SJolly

    The numbers will be repeated in the same sequence only if you start two copies of the application at the same time - the numbers are psuedorandom. If that isn't good enough then you could seed the timer again each time you get a new random number - then differences such as the processor speed / load etc will mean that the sequence will definitely not be repeated. Regards, Simon

    C / C++ / MFC lounge

  • random number
    S SJolly

    The output wouldn't be a random number as you are affecting the outcome, however to generate random numbers: // seed the random number generator using the current time srand((unsigned)time(NULL)); // gets a random number between 0 and 0x7fff int iRandom = rand(); // scale this number down to a value between 0 and 1000. iRandom /= (RAND_MAX / 1000); Regards, Simon

    C / C++ / MFC lounge

  • DLL Registration problem
    S SJolly

    Try asking here: http://www.codeproject.com/script/comments/forums.asp?forumid=1644[^] Regards, Simon

    C / C++ / MFC help

  • How to control the connecting time in SOCKET?
    S SJolly

    Before calling connect, add a call to set the socket up as non-blocking: ULONG ulParam = 1; ioctlsocket(m_hSocket, FIONBIO, &ulParam); Then call connect as normal. After calling connect, you can do a select (writing) with whatever timeout you want to see if the socket has connected - if the socket can be written to it is connected. Regards, Simon

    C / C++ / MFC tutorial question

  • ISDIGIT Function
    S SJolly

    Try: if(isdigit(var1)) continue; in place of: if(var1 == isdigit) continue; Regards, Simon

    C / C++ / MFC question

  • mobile phone
    S SJolly

    ;) Do I need to buy a new laptop to go with that, or will the old one still work?

    The Lounge hardware help question

  • April 1st early this year
    S SJolly

    Just wait for the next version of IE, complete with the default security option of disabling all hyperlinks!

    The Lounge com security question

  • i want to get the handle of Dialog , that i created after clicking on a button
    S SJolly

    Hello, The handle is a member of the CDialog object - m_hWnd. I think this will be NULL until you have called the Create function on a modeless window. Regards, Simon

    C / C++ / MFC

  • How to move Bitmap in Dialog ?
    S SJolly

    If by DC, you mean device context, I am sorry but I don't know as much about this as I always use move window. However, I know to get the device context you would do: CDC * pDeviceContext = NULL; pDeviceContext = GetDlgItem(IDC_YOUR_CONTROL)->GetDC(); Then you'll have to look in the MSDN for a CDC function that moves the image. Regards, Simon

    C / C++ / MFC graphics tutorial question

  • How to move Bitmap in Dialog ?
    S SJolly

    In the handler for the button press, put something along these lines: RECT stNewPosition; // setup the new position for the bitmap (this can also resize it) stNewPosition.top = 50; stNewPosition.left = 50; // etc... // this moves the bitmap only GetDlgItem(IDB_YOUR_BITMAP)->MoveWindow(&stNewPosition, TRUE); I think you can move the image off your dialog with this - effectively making it vanish so beware. Regards, Simon

    C / C++ / MFC graphics tutorial question

  • IP Address
    S SJolly

    Sorry, yes you will definitely need the platform SDK. Regards, Simon

    C / C++ / MFC tutorial question

  • IP Address
    S SJolly

    Hello, I've done this before using windows sockets. I don't know if it's the best way, but it definitely works: char szHostName[400]; struct hostent *hostinfo = NULL; IN_ADDR addr; char szIP[16]; // "xxx.xxx.xxx.xxx\0" ULONG ulIP = 0; // get the dns name as a string gethostname(szHostName, 400); // get the host info (contains ip address) hostinfo = gethostbyname(szHostName); if(hostinfo == NULL) { DWORD dwError = WSAGetLastError(); // handle the error } else { // get the ip as ULONG ulIP = *reinterpret_cast(hostinfo->h_addr_list[0]); // put the ip it into an IN_ADDR addr.S_un.S_addr = ulIP; // changes ip into string sprintf(szIP, "%s", inet_ntoa(addr)); TRACE("My IP address is %s\n", szIP); } Regards, Simon

    C / C++ / MFC tutorial question

  • Refreshing windows systray
    S SJolly

    Hello, How are you removing the window - I have seen this problem before if you miss: Shell_NotifyIcon(NIM_DELETE, IconNotificationData); Without the above the notification gets sent when you put the mouse over the icon - making it vanish. Regards, Simon

    C / C++ / MFC help

  • How to get/set the position of buttons, ListCtrl etc.?
    S SJolly

    Try: RECT stItemRect = {0}; GetDlgItem(IDC_NAME_OF_CONTROL)->GetWindowRect(&stItemRect); This ensures that you are using the correct CWnd item. It gives you all the corners of the item, so you can also work out the size. If this still crashes then I would guess the list control is being declared incorrectly - does it display on screen with those lines commented out? Simon.

    C / C++ / MFC help c++ debugging tutorial 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