problems with _lwrite (Win-API-function) 
Author Message
 problems with _lwrite (Win-API-function)

Hi,

I'm trying to write a two dimensional array (lets say an array called a(10,10))
at once to a disk file. I would use the lwrite (aliased "_lwrite")-Windows-API function
as described in the Microsoft Knowledge Base Article N. Q77317

But I couldn't get it work. Although the function doesn't return -1 which indicates an error
the file which is generated has zero bytes.

The code looks like that:

        Declare Function lWrite Lib "KERNEL" alias "_lwrite" (ByVal hFile, lpBuff as
Any, ByVal wBytes) as integer
        Dim a(10,10) as integer
        Dim ff as integer
        Dim ArraySize as long
        Dim i as integer

        ' now filling the array with values...

        ' get a free file number...
        ff = freefile()

        ' convert VB file handle to DOS file handle...
        DOSFileHandle = FileAttr(ff, 2)

        ' get the size of the array...
        ArraySize = UBound(a) - LBound(a) + 1
        ArraySize = ArraySize * len(a(LBound(a)))

        i = fWrite(DOSFileHandle, a(LBound(a)), ArraySize)      ' i = 0 !!!

Can anybody help me ?
Does anybody has got a solution ?
Please answer by Email.

Bye
        Olivier



Sat, 23 Jan 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. problems with _lwrite (Win-API-function)

2. Problem with Win API function GetPrivateProfileString.

3. Problem with Win API function GetPrivateProfileString.

4. Problem with the CheckMenuRadioItem WIN API function....

5. Problems with CreateDirectory WIN API function...

6. WIN 2k API vs WIN 98/WIN NT API - Help needed

7. Win API functions that don't seem to exist in Win32 API

8. Api lread & lwrite and Types

9. Api lread & lwrite with Types

10. Problem with win-32 api on win-95

11. Reproducing SendKeys function using WIN api....

12. network share connect with WNetAddConnection2A API function on Win 98 question

 

 
Powered by phpBB® Forum Software