Welcome to Clarion Community Sign in | Join | Faq

General

Started by Tom Leech at 02-27-2008 12:22 PM. Topic has 1 replies.

Print Search
Sort Posts:    
   02-27-2008, 12:22 PM
Tom Leech is not online. Last active: 2/28/2008 12:15:02 AM Tom Leech

Top 500 Posts
Joined on 02-28-2008
Posts 1
How to get started from C5.5
Reply Quote

Having recently installed Clarion.Net, I find myself a little overwhelmed trying to get started converting some C5.5 code over.  I've gone through the tutorials, ClarionSharpExamples, etc and did a couple versions of "Hello World".  But now for the real world...

I'm starting with a low level class that I share in multiple projects.  This class has the following MAP:

    MAP
      MODULE('API')
        MoveMemory(long lpdest,long lpsource,long lnbytes),SHORT,pascal,proc,name('RTLMoveMemory')
      END
      MODULE('win32')
        FindFirstFile( *CSTRING lpFileName, *WIN32_FIND_DATA),HANDLE,RAW,PASCAL,DLL(dll_mode),NAME('FindFirstFileA')
        !FindNextFile( HANDLE hFindFile, *WIN32_FIND_DATA),BOOL,RAW,PASCAL,DLL(dll_mode),NAME('FindNextFileA')
        FindClose( HANDLE hFindFile),BOOL,RAW,PASCAL,dll(dll_mode),PROC
        CreateFile( *CSTRING lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LONG lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile), HANDLE,RAW,PASCAL,DLL(dll_mode),NAME('CreateFileA')
        ReadFile( HANDLE hFile, ULONG, DWORD nNumberOfBytesToRead, *DWORD lpNumberOfBytesRead, LONG lpOverlapped),BOOL,RAW,PASCAL,DLL(dll_mode)
        WriteFile( HANDLE hFile, ULONG, DWORD nNumberOfBytesToWrite, *DWORD lpNumberOfBytesWritten, LONG lpOverlapped),BOOL,RAW,PASCAL,DLL(dll_mode)
        CloseHandle( HANDLE hObject),BOOL,RAW,PASCAL,DLL(dll_mode),PROC
        GetLastError(),DWORD,PASCAL,RAW,DLL( dll_mode),DLL( dll_mode)

        SetFilePointer( HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod ), DWORD, PASCAL, RAW, NAME( 'SetFilePointer' )
        LockFile( HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh ), BOOL, PASCAL, RAW, NAME( 'LockFile' )
        UnlockFile( HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh ), BOOL, PASCAL, RAW, NAME( 'UnlockFile' )
      END
    END

The compiler right away doesn't like my module names 'api' & 'Win32', nor did it like the pascal attribute.  I have no idea if it is still possible to use these win api functions or if they all have to be migrated to something else. 

Can anyone shed some light on this?

Thanks,

Tom


   Report 
   03-01-2008, 2:21 AM
Wolfgang Orth is not online. Last active: 10/8/2008 6:35:00 PM Wolfgang Orth



Top 10 Posts
Joined on 10-25-2005
Rastede, NW-Germany
Posts 49
Re: How to get started from C5.5
Reply Quote
Hello Tom,

API is used in Win32, .NET is another world.

Dave Harms has an article about the differences at ClarionMagazine.

hth
Wolfgang   


Regards
Wolfgang Orth

   Report 
Clarion Communi... » Clarion.Net » General » How to get started from C5.5

Powered by Community Server, by Telligent Systems