News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

I\O queston

Started by foofatron, July 28, 2008, 01:27:12 PM

Previous topic - Next topic

foofatron

Say I want to go to a specific offset insted of just opening and starting at the start of the file, kinda like seekp in C++, how would I do it in Masm? Can I do it with the normal CreateFile or something? Can you show me how to do mit with just Masm and with Masm and windows api?

BogdanOntanu

Search for info on SetFilePointer API
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

foofatron

Ok,

SetFilePointer PROTO,

  handle:DWORD,hfile ; file handle

  nDistanceLo:SDWORD, ; bytes to move pointer

  pDistanceHi:PTR SDWORD, ; ptr to bytes to move

  moveMethod:DWORD ; starting point

INVOKE SetFilePointer,

  fileHandle,0,0,FILE_CURRENT


What exactly does it mean?

foofatron

Say I want to have an option that shows only C and C++ files, how would I do it?
I've tried numorus things yet I can only seem to have one at a time :\.

db "C\C++ Files",0,"*.cpp",0

MichaelW

You should search for "*.c*" and then filter out any bad matches.
eschew obfuscation

Tedd

"*.c??" might be better in that case, though you'll still need to filter out in case of things like "*.car", "*.com", "*.cc", etc.

Anyway, if you're using GetOpenFileName, you can do this:
C_CppFiles db "C/C++ Files",0,"*.c;*.cpp",0,0
No snowflake in an avalanche feels responsible.