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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
H

Henrik

@Henrik
About
Posts
8
Topics
8
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • COM: Getting PID of virtual folders
    H Henrik

    I use m_pDesktopFolder->ParseDisplayName(...); The problem is it works fine when I parse a name from a "real" directory that I created myself named "Spel", but when I try to parse the name of a virtual folder "Den här datorn" (Swedish; aka "My computer" in English) the function fails. So: How can I get the PID of a virtual folder such as "My computer" with the ParseDisplayName(...); I tried both English and Swedish name of the virtual folder, none works. Any ideas? Cheers, Henrik

    C / C++ / MFC question com help

  • IShellFolder pointers, how to copy them safely... (COM)
    H Henrik

    Hello, I got a small problem (or rather question)... global: ------- SHGetDesktopFolder(&m_pShellFolder) // the nFolde value can be diffrent,, also CSIDL_DESKTOP.. depends what button user press SHGetSpecialFolderLocation(NULL, nFolder, &m_ppidl); func: ----- IShellFolder* pFolder; IEnumIDList* pEnumIds; if (::GetSize(m_ppidl) == 2) { // if the user is in the root path (desktop folder) do this... m_pShellFolder->EnumObjects(NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &pEnumIds); pFolder = m_pShellFolder; pFolder->AddRef(); } else { // if the user is in a folder that is BELOW the desktop do this.... the pidl is // a full path list in both cases (ie it holds the desktop id as first entry) m_pShellFolder->BindToObject(m_ppidl, NULL, IID_IShellFolder, (LPVOID *)&pFolder); pFolder->EnumObjects(NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &pEnumIds); } // after this the enumaration process starts and I use pFolder->GetAttributesOf // and pFolder->GetDisplayNameOf... . . . pFolder->Release(); I got this code. Anyway as you might notice I do pFolder = m_pShellFolder. My question is, can this be dangerous when I do pFolder->Release(); since both pointers point at the same memloc...? (SIDENOTE) If GetSize returns 2 I assume that the pidl tells you that your in the root (DESKTOP) else your in a subfolder to the root , my code is supposed to add to the pidl list as the user goes down in the folder structure.. (THE QUESTOIN :)) So my question is, as I said, is it safe to do pFolder = m_pShellFolder; and then release pFolder later with pFolder->Release()?.. Will this destroy m_pShellFolder (or make it unusable) (it worked tough i dunno if its safe?)? What im trying to accomplish is basicly to get a copy of the m_pShellFolder structure(the one it points at) to a new IShellFolder object.. I hope someone understood this :) Cheers, Henrik

    C / C++ / MFC question com help tutorial announcement

  • Date/Time problem.
    H Henrik

    Hello, I got a major issue with trying to set DATE on files, not TIME, that works flawless. Here's the way I did: void CDialogAttribs::DoDataExchange(CDataExchange *pDX) { ... DDX_DateTimeCtrl(pDX, IDC_ATTR_DATE, m_tmeDate); // m_tmeDate is a CTime; IDC_ATTR_DATE is a "caleneder" control created in resource ... } { ... CFileStatus fs; CFile::GetStatus(file, fs); fs.m_atime. = m_tmeDate; CFile::SetStatus(m_strFile, fs); // I KNOW for a fact that m_tmeDate holds valid numbers in month/day/year field // before doing ::SetStatus.. ... } ANY TIPS!? :) Cheers, Henrik ... }

    C / C++ / MFC help question learning

  • Thread management
    H Henrik

    Hello, I start at least 4 threads in my program (besides the main program thread). They all have ::WaitForSingleObject(...); in them, one is for file notification update, one is for other stuff, anyway, my question is, how much does this IMPACT on program speed & memory consumption in general (depending on CPU and memory)? (I'm working on a small file manager app coded in MFC). If anyone got any comments I'm happy to here them. How many threads could one run with ::WaitForSingleObject(...); in them before it would get noticable (depending on CPU and memory)?... How many threads does a normal window program run, and a Windows 95/98/XP session in general? So all you thread experts, gimme comments! :cool: Cheers, Henrik

    C / C++ / MFC performance question c++ announcement lounge

  • Linking problems
    H Henrik

    Hello, I got a small linking problem, I get this error: TabCtrlEx.obj : error LNK2001: unresolved external symbol __imp__PathCompactPathA@12 Debug/FileOpus2.exe : fatal error LNK1120: 1 unresolved externals I try to use ::PathCompactPath(...); I do include the "shlwapi.h" file in my project, but still doesn't want to work. Any tips? Cheers, Henrik

    C / C++ / MFC help debugging question

  • How to set READONLY attrib on a directory.
    H Henrik

    Hello, Anyone know how I can set the read-only attribute on a directory? I tried ::SetFileAttribute(...); but it doesnt seem to work. Also, if someone know how I can safedel files (delete them to the trashcan) I would be happy if you told me :)... Cheers, Henrik

    C / C++ / MFC tutorial question

  • How to display generic dialog to connect a network drive (sharing hdd's)
    H Henrik

    Hello, (1) Does someone know how I can display the Windows dialog for connecting a HDD to the network? (sharing it) (2) I would also like to know how to display the Properties for a specific map (directory). Cheers, Henrik

    C / C++ / MFC sysadmin tutorial question

  • Usage of CArray<> with a CListCtrl derrived class.
    H Henrik

    I got a small problem :eek:... I'm using CArray<> which I define like this: typedef CArray<"CListCtrlEx, CListCtrlEx&"> Type_aCListCtrlEx; Type_aCListCtrlEx m_aCListCtrlEx; (WHEN I PREVIEWED THE POSTING I HAD PROBLEMS WITH <> THEREFOR I ADDED THE " SO THAT NO CODING ERROR) Where CListCtrlEx is a CListCtrl derrived class. Then I do this to add a new CListCtrlEx class to the array: CListCtrlEx wndList; m_aCListCtrlEx.Add(wndList); The problem is that it first gave me copy contructor needed and =operator not found error. So I tried to solve it in the CListCtrlEx class like this: HWND operator=(CListCtrlEx &s) { return s.GetSafeHwnd(); } CListCtrlEx(const CListCtrlEx &s) {} I do not know if this is the correct way to do it. But when I try to retrive the CListCtrl wnd handle to use its methods etc like this it doesn't work: CListCtrlEx wnd; wnd = m_aCListCtrlEx.GetAt(0); If someone could gimme a few hints I would be forever greatfull :-D... Cheers, Henrik

    C / C++ / MFC help data-structures
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups