Thread: Find a file in a directory

  1. #16
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Why do you keep ignoring everything? Keep it managed!
    There is a very simple function somewhere in the framework that does what you want!
    No need for messy conversion and interop between native.

    After just a minute at msdn, I find this:
    http://msdn2.microsoft.com/en-us/library/wz42302f.aspx
    It's the same function in managed that you're trying to use native.
    Last edited by Elysia; 02-11-2008 at 03:03 PM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #17
    Registered User
    Join Date
    Dec 2007
    Posts
    385
    No I am not ignoring... It is just because I really dont know about all alternatives that really could work so I just get a bit confused.
    I did found this one too but the problem is for me how to combine or if it even was possible with browseFolderDialog as the example is so small.
    I do find it quite difficult but now I will really try to keep it managed because it feels much more clean.
    I will go for this one... Thanks again...

  3. #18
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Since it's managed, it accepts system::string^, which is exactly what folderBrowserDialog1->SelectedPath is, as well. No problems! No messy conversion. Just plain, easy code.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #19
    Registered User
    Join Date
    Dec 2007
    Posts
    385
    Yes you are right. Sometimes I am to stubborn to fix things that I should do in another way. Bad side. But I kept learning about LPCSTR and LPWSTR last 10 hours :-P. I will really try to keep things clean.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  2. Formatting a text file...
    By dagorsul in forum C Programming
    Replies: 12
    Last Post: 05-02-2008, 03:53 AM
  3. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  4. Help Required!!!!!
    By bobthebullet990 in forum C Programming
    Replies: 14
    Last Post: 11-27-2005, 03:56 PM
  5. Replies: 3
    Last Post: 03-04-2005, 02:46 PM