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
C

Chintoo723

@Chintoo723
About
Posts
219
Topics
108
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Why do some people use HeapAlloc instead of malloc?
    C Chintoo723

    Portability across different OSes or even across different flavours of Windows?

    thanks!

    C / C++ / MFC question

  • Why do some people use HeapAlloc instead of malloc?
    C Chintoo723

    I have seen some folks using HeapAlloc instead of malloc, how is that different?

    thanks!

    C / C++ / MFC question

  • Catching "R6025 - pure virtual function call error" using SEH
    C Chintoo723

    I am getting "R6025 - pure virtual function call error" somewhere in my code but I can't seem to catch it using SEH. Is this a known issue with SEH? Here is an example to demonstrate this: #include "stdafx.h" #include /* Compile options needed: none */ class A; void fcn( A* ); class A { public: virtual void f() = 0; A() { fcn( this ); } }; class B : A { void f() { } }; void fcn( A* p ) { p->f(); } // The declaration below invokes class B's constructor, which // first calls class A's constructor, which calls fcn. Then // fcn calls A::f, which is a pure virtual function, and // this causes the run-time error. B has not been constructed // at this point, so the B::f cannot be called. You would not // want it to be called because it could depend on something // in B that has not been initialized yet. int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // TODO: Place code here. __try { B b; } __except(EXCEPTION_EXECUTE_HANDLER) { assert (false); } return 0; } thanks!

    C / C++ / MFC help tutorial question

  • VS2005 - ellipsis in a macro
    C Chintoo723

    Cool, that is what I was looking for. Thanks. Now one more thing - is there any preprocessor variable that indicates what compiler is compiling the code? I want to write this macro seperately once for VC8 and once for VC6/VC7 so that the code can still be compiled with the older compiler, just in case someone wants to use the older compilers. thanks!

    C / C++ / MFC csharp php question

  • VS2005 - ellipsis in a macro
    C Chintoo723

    VS6 and VS2003 do not support varargs in a C macro. The link http://sourceforge.net/mailarchive/forum.php?forum_id=40270&max_rows=25&style=nested&viewmonth=200503[^] hints that this is possible in VS2005. I dont have VS2005 installed, can someone who has VS2005 quickly check if the following compiles? #define myprint(fmt, args_...) _snprintf(str, fmt, ##args_) char str[64]; myprintf("hello %s", "world"); thanks!

    C / C++ / MFC csharp php question

  • Identifying sequence point errors in VS6
    C Chintoo723

    John R. Shaw wrote:

    A fully compliant compiler could compile that statement without giving any warning at all. But is should at the least give a warning and at the most consider it an error (becuase it is undefined behaviour).

    So it may be the case that the C compilers shipped with VS6, VS2003, VS2005 all aren't fully compliant with the standard. What is puzzling is, they dont qualify your "at the least" part, forget about "at the most" part. thanks! -- modified at 0:55 Sunday 19th March, 2006

    C / C++ / MFC csharp html visual-studio com

  • Obtaining recycle bin folder
    C Chintoo723

    OK, that means I cannot use both of SHGetFolderPath and SHGetSpecialFolderPath. Btw, both of these APIs returned last error 6 (invalid handle), which in some sense is meaningless. Looking at the codeproject article you gave, they use SHGetSpecialFolderLocation which supports CSIDL_BITBUCKET, but it returns LPITEMIDLIST and I am not sure how to obtain the folder name from that. In any case, I was looking at the documentation of CSIDL_BITBUCKET again, and it gives me the virtual folder containing the items in the recycle bin. I'm not sure if COM is the only way to access the items in this virtual folder, as shown in the article, or if there is a simpler way too. So, what I really want is, the name of the recycle bin folder on each of the drives on the system, like C:\RECYCLER. Since it is C:\RECYCLED on a FAT drive, I wanted to use a windows API to obtain the correct name. So, I guess CSIDL_BITBUCKET wont give me that - is this right? So, may be I should just enumerate the drives, get the file system type, and use RECYCLED or RECYCLER appropriately. Here is a link that talks about these folder names - http://blogs.msdn.com/oldnewthing/archive/2006/01/31/520225.aspx[^] - although it is not clear from this link what happens to a folder named RECYCLER on a FAT drive that is converted to NTFS. thanks!

    C / C++ / MFC question

  • Obtaining recycle bin folder
    C Chintoo723

    The first one returns E_INVALIDARG and the second one returns FALSE. MSDN doesnt say these APIs set the last error code, so I havent printed them. I'm away from the computer that has this code, I will get back with the error codes in a couple of hours. thanks!

    C / C++ / MFC question

  • Obtaining recycle bin folder
    C Chintoo723

    I'm trying to obtain the recycle bin folder and have tried the following two ways. Both of them dont work, any idea what is wrong in each of them? I ran them on Windows XP. void recycle_bin1() { char szPath[4096] = { '\0' }; HRESULT hr = SHGetFolderPath(NULL, CSIDL_BITBUCKET, NULL, SHGFP_TYPE_CURRENT, szPath); const char *str = "SUCCEEDED"; if (hr == S_FALSE) { str = "S_FALSE"; } if (hr == E_FAIL) { str = "E_FAIL"; } if (hr == E_INVALIDARG) { str = "E_INVALIDARG"; } MessageBox(NULL, szPath, str, NULL); } void recycle_bin2() { char szPath[4096] = { '\0' }; BOOL bRet = SHGetSpecialFolderPath(NULL, szPath, CSIDL_BITBUCKET, FALSE); const char *str = "SUCCEEDED"; if (bRet == FALSE) { str = "FAILED"; } MessageBox(NULL, szPath, str, NULL); } thanks!

    C / C++ / MFC question

  • Where are IE favourites in registry
    C Chintoo723

    If I am to add an IE favourite programmaticallly - is there an IE API? - where are the favourites stored in registry? thanks!

    C / C++ / MFC windows-admin json question

  • Identifying sequence point errors in VS6
    C Chintoo723

    Trollslayer wrote:

    Did you change the warning level to 4? (Project->Settings->C/C++)

    I just checked with both VS6 and VS 2003, both of them dont detect and warn for a[i] = i++. Do you have VS 2005 to check this out? GCC 3.4.3 does, if you want to check this out with GCC. thanks!

    C / C++ / MFC csharp html visual-studio com

  • Identifying sequence point errors in VS6
    C Chintoo723

    Is is actually disallowed in C as it can lead to undefined behaviour, see the two links I gave. GCC takes a command line option to detect this as a warning. thanks!

    C / C++ / MFC csharp html visual-studio com

  • Identifying sequence point errors in VS6
    C Chintoo723

    See http://c-faq.com/expr/evalorder1.html[^] and http://c-faq.com/expr/seqpoints.html[^]. a[i] = i++ is disallowed. GCC has flags "gcc –Wsequence-point –Werror " to detect these errors, can microsoft compiler detect this? I use Visual Studio 6. If the CL compiler in VS6 cannot detect it, how about VS2003 and VS2005? thanks!

    C / C++ / MFC csharp html visual-studio com

  • Win32 equivalent of a .NET API
    C Chintoo723

    oshah wrote:

    your problem should be solvable, If you make it clearer what feature of IsolatedStorage you need. ie. why do you need IsolatedStorage?

    Fair enough, here is what I want: 1. I want to remove files that are present in these folders. DeleteFile does not delete them. I dont know what GetLastError DeleteFile returns as I have limited access to experiment on this computer that has these files. 2. Why I want to remove these files? I am writing a cleanup program in which I need to remove these files. 3. I believe they cant be removed so easily using any of DeleteFile or SHFileOperation. I havent got a chance to examine these files and their attributes yet, but if you know, I am wondering if they leverage any of underlying file system's functionality, and if it is NTFS's, then is this API not supported with FAT? This is unlikely, as I dont see any mention of file system in the IsolatedStorage documentation.

    oshah wrote:

    do you need to get at the Publisher.cya1vn0ixvflytpedycizjvrbaqeoksg folder directly without using .NET

    You said it! And, remove the things there as I mentioned above. thanks!

    C / C++ / MFC csharp json question

  • Win32 equivalent of a .NET API
    C Chintoo723

    Do all .NET APIs have Win32 SDK equivalent? I am looking for using IsolatedStorage API without using .NET. So far I havent been able to figure out the Win32 API for it, does anyone know if one exists? thanks!

    C / C++ / MFC csharp json question

  • Linking C runtime
    C Chintoo723

    Saurabh.Garg wrote:

    why do you want to link with vc6 runtime, is there any specific reason do it?

    Oh yeah, so that I dont have to expect msvcrt7 dlls on the end user system. thanks!

    C / C++ / MFC question

  • Linking C runtime
    C Chintoo723

    Is there any way to use VS2003 or VS2005 for development and still link with VS6's C runtime libraries? thanks!

    C / C++ / MFC question

  • What is IsolatedStorage
    C Chintoo723

    OK, this link http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemioisolatedstorageisolatedstoragefileclasstopic.asp[^] provides an example to remove the Isolted Storage files. I can use the C++ code, but it seems to require .Net framework. I have only Visual Studio 6 with platform SDK. I dont want to install .NET, does IsolatedStorage have an API outside .NET? thanks!

    C / C++ / MFC question

  • What is IsolatedStorage
    C Chintoo723

    Does anyone know what is IsolatedStorage? I have this directory that I am unable to delete: C:\Documents and Settings\\Local Settings\Application Data\IsolatedStorage\1cz2yllv.kcp\v44qcfut.b25 \Url.b01cm1a5pqdgmvysoo2gnkbuohme03bk\Url.b01cm1a5pqdgmvysoo2gnkbuohme03bk\Files Is there any way to remove this IsolatedStorage folder? thanks!

    C / C++ / MFC question

  • Deleting a file to recycle bin
    C Chintoo723

    How do I delete a file so that it goes to recycle bin, the following code doesnt seem to work? static void delete_file() { SHFILEOPSTRUCT shf; int ret = 0; shf.wFunc = FO_DELETE; shf.pFrom = filename; shf.fFlags = FOF_ALLOWUNDO; if(0 != (ret = SHFileOperation(&shf)) { printf("could'nt delete \"%s\" to recycle bin (err=%d/%ld)\n", filename, ret, GetLastError()); } } thanks!

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