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
N

nm_114

@nm_114
About
Posts
95
Topics
36
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • STRRET Structure Question
    N nm_114

    «_Superman_» wrote:

    In that case, the string is a unicode string.

    Um, if you don't mind me asking, how do you *know*. I was just guessing on how it (the PIDL) works internally.

    C / C++ / MFC question

  • STRRET Structure Question
    N nm_114

    «_Superman_» wrote:

    uOffset is declared as UINT (unsigned int). So it is not a string.

    uOffset is an offset to a string. I was wondering whether the string it's "pointing" to was ANSI or Unicode.

    «_Superman_» wrote:

    ANSI or UNICODE is not dependent on the OS. It depends on whether the macro UNICODE or _UNICODE is declared or not. For example, LPTSTR (TCHAR*) becomes LPSTR (CHAR*) if UNICODE is not declared and LPWSTR (WCHAR*) if UNICODE is declared.

    I know about the TCHAR stuff. The reason I mentioned the OS was because I was thinking since Win9x used ANSI internally (mostly, I think) and WinNT used Unicode (but supported programs compiled for ANSI for compatibilty), the string inside the PIDL where uOffset is "pointing" would be that type.

    C / C++ / MFC question

  • STRRET Structure Question
    N nm_114

    When uType is STRRET_OFFSET, MSDN doesn't say whether the string uOffset is pointing to is an ANSI or Unicode string. Is it always ANSI or always Unicode? Is it ANSI on Win9x systems and Unicode on WinNT systems? Thanks.

    C / C++ / MFC question

  • timeSetEvent only in Windows XP?
    N nm_114

    MSDN says the requirements for timeKillEvent are

    Windows NT/2000/XP: Included in Windows NT 3.1 and later.
    Windows 95/98/Me: Included in Windows 95 and later.

    but the requirements for timeSetEvent are

    Windows XP: Included in Windows XP only.

    Really? Since timeKillEvent uses the return value of timeSetEvent, this doesn't seem to make sense.

    C / C++ / MFC business question

  • Exact size font question
    N nm_114

    Will calling CreateFont(-8, 0, 0, 0, 0, FALSE, FALSE, FALSE, 0, 0, 0, 0, 0, TEXT("small fonts")) always create the exact size font on all systems (assuming the "small fonts" font is present)? For example, would the zero character always be exactly 4 pixels wide and 6 pixels high?

    C / C++ / MFC question tutorial

  • HDN_TRACK Notification never comes?
    N nm_114

    I subclassed a listview to try and get the HDN_TRACK notification from the header control, but the only notifications that seem to come are NM_RELEASEDCAPTURE and NM_CUSTOMDRAW. Is there any way to get the others?

    C / C++ / MFC question

  • NNTP question about getting new headers
    N nm_114

    I hope this is the right forum... I'm confused about how you get new headers from a newsserver. I guess when you first suscribe to a group you get what is already on the server by sending a GROUP command to get the the low and high article numbers and send an XOVER command with these two values. But to get new headers later, do you add 1 to that high article number and send the GROUP command again to get the new high article number and then send the XOVER command with these two values? If this is the case, what happens when the high article number is greater than the maximum int value? Does it wrap around from 0, which would make the high article number lower than the low article number? - thanks

    Web Development question sysadmin

  • DateAdd equivalent?
    N nm_114

    Yep. I guess I was hesitant to write my own because I don't know how to account for leap years, but I guess it's not critical. I'll probably use that other article and write something similar to your example for months/years. Thanks.

    C / C++ / MFC c++ question

  • DateAdd equivalent?
    N nm_114

    DavidCrow wrote:

    nm_114 wrote: How? By using SystemTimeToFileTime().

    Well I knew that much! :-D I was asking how you do the adding/subtracting...

    DavidCrow wrote:

    That article is exactly what you need.

    Well not really, as it doesn't handle months/years.

    DavidCrow wrote:

    That's because a month does not have a constant value (i.e., 28, 29, 30, or 31 days) like the other items do.

    I knew that too! :-D But it's ok, I guess what I was looking for doesn't exist (a tested/bug-free exact replica of DateAdd() in C++). Oh well :sigh:. Thanks anyway.

    C / C++ / MFC c++ question

  • DateAdd equivalent?
    N nm_114

    :confused: How? I found an article at http://www.codeproject.com/datetime/winapi_datetime_ops.asp[^] but it doesn't work with months/years, and I have no idea if it works right with leap years etc.

    C / C++ / MFC c++ question

  • DateAdd equivalent?
    N nm_114

    DavidCrow wrote:

    Why would you need a function, when one statement will work:

    It was a bad example I guess. It needs to be arbitrary. Like DateAdd(Month, 309, mydate), DateAdd(Day, -909, mydate) etc. I'm not sure if I'm explaining it right.

    DavidCrow wrote:

    Take a stroll through the other date/time functions to see what is available to you.

    I did. I didn't see anything like DateAdd.

    C / C++ / MFC c++ question

  • DateAdd equivalent?
    N nm_114

    I don't know of any function that does this. I was looking for something like VBScript's DateAdd where I could do something like DateAdd(Month, 24, &stMyDate) and it would add 24 months to the date (2 years), taking into account leap years etc..

    C / C++ / MFC c++ question

  • DateAdd equivalent?
    N nm_114

    SYSTEMTIME.

    SYSTEMTIME stDateIWantToAddDaysOrMonthsTo;
    FILETIME ft, ftLocal;
    GetSystemTimeAsFileTime(&ft);
    FileTimeToLocalFileTime(&ft, &ftLocal);
    FileTimeToSystemTime(&ftLocal, &stDateIWantToAddDaysOrMonthsTo);

    C / C++ / MFC c++ question

  • DateAdd equivalent?
    N nm_114

    GetSystemTime() (then converting it to local time).

    C / C++ / MFC c++ question

  • DateAdd equivalent?
    N nm_114

    DavidCrow wrote:

    If you are using MFC, see the COleDateTime class.

    Nope, pure Win32 :(

    C / C++ / MFC c++ question

  • DateAdd equivalent?
    N nm_114

    Is there a c++ equivalent of vbs's DateAdd where you can add or subtract any amount of hours, days, months etc. to a date? - thanks

    C / C++ / MFC c++ question

  • Your favorite source code font
    N nm_114

    Sheldon Narrow

    The Lounge csharp html com data-structures tools

  • Menu items missing in shell context menu...
    N nm_114

    I'm trying to show the shell context menu for a file when only having the file name. I got the menu to come up but not all the menu items are showing up - like the ones virus scanners or zip utilities add to all files ("Scan File", "Add to Zip" etc.). Is there anything I'm missing:typedef HRESULT (WINAPI *lpfnSHBindToParent)(LPCITEMIDLIST pidl, REFIID riid, VOID **ppv, LPCITEMIDLIST *ppidlLast); LRESULT OnContextMenu(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { lpfnSHBindToParent pSHBindToParent = (lpfnSHBindToParent)GetProcAddress(GetModuleHandle(TEXT("SHELL32.DLL")), "SHBindToParent"); if (pSHBindToParent) { LPOLESTR pwszFileName; #ifdef UNICODE pwszFileName = strFullFileName; #else WCHAR wsz[MAX_PATH]; MultiByteToWideChar(CP_ACP, 0, strFullFileName, -1, wsz, ARRAYSIZE(wsz)); pwszFileName = wsz; #endif LPSHELLFOLDER pDesktopFolder; if (SHGetDesktopFolder(&pDesktopFolder) == NOERROR) { LPITEMIDLIST pidl; if (pDesktopFolder->ParseDisplayName(hMainWnd, NULL, pwszFileName, NULL, &pidl, NULL) == S_OK) { LPSHELLFOLDER pParentFolder; LPCITEMIDLIST pidlLast; if (pSHBindToParent(pidl, IID_IShellFolder, (void**)&pParentFolder, &pidlLast) == S_OK) { IContextMenu* picm; if (pParentFolder->GetUIObjectOf(hMainWnd, 1, &pidlLast, IID_IContextMenu, NULL, (void**)&picm) == S_OK) { HMENU hMenuPopup = CreatePopupMenu(); if (hMenuPopup) { if ( SUCCEEDED( picm->QueryContextMenu(hMenuPopup, 0, 1, 0x7fff, CMF_NORMAL) )) { // when menu is shown not all the menu items are there... } DestroyMenu(hMenuPopup); } picm->Release(); } pParentFolder->Release(); } CoTaskMemFree(pidl); } pDesktopFolder->Release(); } } return 0; }

    - thanks

    C / C++ / MFC linux announcement

  • What's the best (free) newsreader?
    N nm_114

    XanaNews is the best (free) one I've used: http://www.wilsonc.demon.co.uk/delphi.htm[^] Another one called microplanet gravity or something was ok.

    The Lounge com question career

  • how to show shell context menu, given only file name?
    N nm_114

    Thanks for the reply. Unfortunately it uses SHBindToParent() which requires Win2k+ :sigh:

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