This following proc works fine and finds all the files and directories in Temporary Internet Files but I want to take out the final (invoke ShowCache) and put it elsewhere so I display a file name with each event like button click. It shouldn't be any problem but I need to make 'Buffer' a global variable instead of local. Even when I copy 'Buffer to a global buffer and try to use that in Path it doesn't work. Any ideas? Like how do I define MAX_PATH as a global variable, maybe that would help. This has puzzled me for a few hours and any helped is appreciated. best regards, czDrillard ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;szS==%s%s ;szS2==%s%s\ ;szFile==*.* ShowCache proc Path :DWORD LOCAL wfd:WIN32_FIND_DATA LOCAL hFile:DWORD LOCAL Buffer invoke wsprintf,ADDR Buffer,OFFSET szS,Path,ADDR szFile invoke FindFirstFile,ADDR Buffer,ADDR wfd cmp eax,INVALID_HANDLE_VALUE jz @next mov hFile, eax jmp @dir @next: invoke FindNextFile,hFile,ADDR wfd or eax,00h jnz @dir invoke FindClose,hFile xor eax,eax jmp @f @dir: mov al,byte ptr cmp al,2eh jz @next invoke wsprintf,ADDR Buffer,offset szS2,\ Path,ADDR wfd.cFileName invoke RtlZeroMemory,ADDR szFileNameBuf,128 invoke lstrcpy,ADDR szFileNameBuf,ADDR wfd.cFileName invoke ShowCache,ADDR Buffer ;this what I want to move ;and call with global variable jmp @next @@: ret ShowCache endp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Posted on 2001-05-22 23:33:00 by czDrillard
Hey,hey disease_2000 I thought for sure your idea would work cuz I didn't know how to declare MAX_PATH as global but now I do, thanx. I tried this but it doesn't work. Same thing happens. It finds directories but doesn't go in to find files - list directories and quits. This still not comprehensible. Why would it matter if buffer is local or global? What kinda magic is it? best regards czDrillard
Posted on 2001-05-23 01:07:00 by czDrillard
MAX_PATH is just a windows constant, it's equal to 260 and is the largest string a path may be. Buffer could be global as well. forge
Posted on 2001-05-23 02:44:00 by forge