Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8883217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:45:43+00:00 2026-06-14T20:45:43+00:00

I keep having issues with the FindFirstFile and FindNextFile I need to get them

  • 0

I keep having issues with the FindFirstFile and FindNextFile I need to get them to list all dlls into an array but I cant get it to list any files. I have tried using and editing the example code from MSDN but that doesn’t work either they pass the wrong type of variable to a function. The code I have now is below sorry if it’s a mess but I am trying everything to get it to work. I was also using argv[1] because I believe that gives the directory of the .exe which is what I need because that were the dlls will be stored. I am completely confused by why all the examples I try don’t work and why I can’t amend them to work.

WIN32_FIND_DATA FindFileData;
HANDLE hFind = INVALID_HANDLE_VALUE;

string directorySearch = "E:\\My Documents\\Visual Studio 2010\\Projects\\SEP-Asignment-One\\Debug\\*";

// Find the first file in the directory.
hFind = FindFirstFile(LPCWSTR("E:\\My Documents\\Visual Studio 2010\\Projects\\SEP-Asignment-One\\Debug\\*"), &FindFileData);

if (hFind == INVALID_HANDLE_VALUE) 
{
  printf ("Invalid file handle. Error is %u.\n", GetLastError());
} 
else
{
  printf ("First file name is %s.\n", FindFileData.cFileName);

                    // List all the other files in the directory.
  while (FindNextFile(hFind, &FindFileData) != 0) 
  {
     printf ("Next file name is %s.\n", FindFileData.cFileName);
  }
  FindClose(hFind);

Any Help would be apreceated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:45:44+00:00Added an answer on June 14, 2026 at 8:45 pm

    Use std::wstring, wide string literals like L"Hello", and remember to defined UNICODE before including <windows.h> (but that’s done by default in a Visual Studio project).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a C program but I keep having problems with my array of
I'm having some issues filling a list in Python. I keep getting a list
I am trying to get my footer correct but am having issues. I was
I've been playing with tweepy for a while, but I keep having rate-limiting issues,
I am having issues with my software. In my piano software if I keep
I am having issues while inserting XML into XML column in table using SQL
Is anyone else having issues with localStorage on iPad 2 with iOS5? I keep
I am on my transitional trip from MATLAB to scipy(+numpy)+matplotlib. I keep having issues
Having issues with dynamically creating <select> tags and then populating them with XML values.
I'm having issues getting my table to work. I really need to figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.