Results 1 to 4 of 4

Thread: findfirstfile

  1. #1

    Thread Starter
    Hyperactive Member MPrestonf12's Avatar
    Join Date
    Jun 1999
    Location
    NY
    Posts
    330

    findfirstfile

    Does anyone know whats wrong with this line of code because I cannot figure it out.

    "dir" is a textbox containing the directory.

    Code:
    	int temp;
    	char wtxt[25];
    	HWND fhwnd;
    	WIN32_FIND_DATA fd;
    
    temp = GetWindowText(dir, wtxt,25);
    
    fhwnd = FindFirstFile(wtxt,&fd);
    this is the error I get:

    cannot convert from 'void *' to 'struct HWND__ *'
    Conversion from 'void*' to pointer to non-'void' requires an explicit cast
    Matt

  2. #2
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    On which line are you gettings this error? Try typecasting with "(HWND)" or declare fhwnd as HANDLE.
    Baaaaaaaaah

  3. #3
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    .........aahhhhhh why would a function that finds a FILE handle return a windows handle?

    To add to abdul's statement

    I think you want to delcare:

    HANDLE fhwnd;
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  4. #4

    Thread Starter
    Hyperactive Member MPrestonf12's Avatar
    Join Date
    Jun 1999
    Location
    NY
    Posts
    330

    Thumbs up

    thanks, that was the problem
    Matt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width