CLIPPER MAPISENDMAILC3( void ) { MapiRecipDesc orig ; MapiRecipDesc rcpt ; MapiFileDesc file ; MapiMessage mssg ; orig.ulReserved = 0 ; // Reserved orig.ulRecipClass = MAPI_ORIG ; // Reciepient Class MAPI_TO MAPI_CC MAPI_BCC orig.lpszName = _parc( 4 ) ; // Originator's Name orig.lpszAddress = _parc( 5 ) ; // Originators Address orig.ulEIDSize = 0 ; // Count in bytes of size of pEntryID orig.lpEntryID = NULL ; // System-specific Originator reference rcpt.ulReserved = 0 ; // Reserved rcpt.ulRecipClass = MAPI_TO ; // Reciepient Class MAPI_TO MAPI_CC MAPI_BCC rcpt.lpszName = _parc( 6 ) ; // Reciepient's Name, e.g., [email protected] rcpt.lpszAddress = _parc( 7 ) ; // Reciepient's Address rcpt.ulEIDSize = 0 ; // Count in bytes of size of pEntryID rcpt.lpEntryID = 0 ; // System-specific Recipient reference if( _parinfo(0) >= 8 ) { file.ulReserved = 0 ; // Reserved for future usage file.flFlags = 0 ; // Flags ? file.nPosition = -1 ; // Character of text to be replaced by attachment file.lpszPathName = _parc( 8 ) ; // Full Path Name with Extension of the attached file file.lpszPathName = NULL ; // Full Path Name with Extension of the attached file file.lpszFileName = NULL ; // Original File Name ( optional ) file.lpFileType = NULL ; // Attachment file type ( can be lpMapiFileTagExt ) } mssg.ulReserved = 0 ; // Reserved mssg.lpszSubject = _parc( 2 ) ; // Message Subject mssg.lpszNoteText = _parc( 3 ) ; // Message Text mssg.lpszMessageType = NULL ; // Message Class mssg.lpszDateReceived = NULL ; // in yyyy/mm/dd hh:mm format mssg.lpszConversationID = NULL ; // Conversation thread ID mssg.flFlags = 0 ; // unread, return receipt mssg.lpOriginator = &orig ; // Originator's descriptor mssg.nRecipCount = 1 ; // Number of receipients mssg.lpRecips = &rcpt ; // Recipient descriptors if( _parinfo(0) >= 8 ) { mssg.nFileCount = 1 ; // Number of file attachments mssg.lpFiles = &file ; // Attachment descriptors } else { mssg.nFileCount = 0 ; // Number of file attachments mssg.lpFiles = NULL ; // Attachment descriptors } // to send the mail direcly and without intervenstion //_retnl( (ULONG) MAPISendMail( 0, 0, &mssg, 0, 0 ) ) ; // to opem default mail client's dialog box _retnl( (ULONG) MAPISendMail( 0, 0, &mssg, 8, 0 ) ) ; }
CLIPPER GETSERVBYN( PARAMS ) // AME( cServerName ) --> nPort #endif { struct servent * pServer; pServer = getservbyname( _parc( 1 ), _parc( 2 ) ); _retnl( IF( pServer, pServer->s_port, 0 ) ); }
CLIPPER SCREENHORZRES( void ) { HDC hDC; long lPixelsPerInch; hDC = GetDC( NULL ); lPixelsPerInch = GetDeviceCaps( hDC, HORZRES ); ReleaseDC( NULL, hDC ); _retnl( lPixelsPerInch ); }
CLIPPER CONNECTTO( PARAMS ) // nSocket, nPort, cIPAddr --> lSuccess #endif { SOCKADDR_IN sa; // sockaddr_in sa; _bset( ( char * ) &sa, 0, sizeof( sa ) ); sa.sin_family = AF_INET; sa.sin_port = htons( _parni( 2 ) ); sa.sin_addr.s_addr = inet_addr( _parc( 3 ) ); _retnl( connect( _parni( 1 ), ( SOCKADDR * ) &sa, sizeof( sa ) ) ); }
CLIPPER FWDISPEND( PARAMS ) // { hWnd, hDC, hDC2, hBmp, hBmpOld } #endif { RECT rct; GetClientRect( (HWND) _parnl( 1, 1 ), &rct ); BitBlt( (HDC) _parnl( 1, 2 ), 0, 0, rct.right - rct.left, rct.bottom - rct.top, (HDC) _parnl( 1, 3 ), 0, 0, SRCCOPY ); SelectObject( (HDC) _parnl( 1, 3 ), (HBITMAP) _parnl( 1, 5 ) ); DeleteObject( (HBITMAP) _parnl( 1, 4 ) ); DeleteObject( (HBITMAP) _parnl( 1, 5 ) ); DeleteDC( (HDC) _parnl( 1, 3 ) ); _retnl( (LONG) _parnl( 1, 2 ) ) ; return ; }
CLIPPER MGETCREATE( PARAMS ) // ( cClassName, cTitle, nStyle, nLeft, nTop, // nWidth, nHeight, hWndOwner, hMenu, // cExtraData, nExStyle ) --> hWnd { DWORD dwStyle = ( DWORD ) _parnl( 3 ); DWORD dwExStyle = ( DWORD ) _parnl( 11 ); #ifndef __FLAT__ if( ! ghEditDS ) { if( ghEditDS = GlobalAlloc( GMEM_DDESHARE | GMEM_MOVEABLE | GMEM_ZEROINIT, SEGMENT ) ) { lpPtr = GlobalLock( ghEditDS ); LocalInit( HIWORD( (LONG) lpPtr ), 0, ( WORD )( GlobalSize( ghEditDS ) - 16 ) ); UnlockSegment( HIWORD( ( LONG ) lpPtr ) ); } } _stornl( ( LONG ) ( IF( ghEditDS, ghEditDS, 0 ) ), 10 ); // lpPtr #endif _retnl( ( LONG ) CreateWindowEx( dwExStyle, _parc( 1 ), // Class _parc( 2 ), // Title dwStyle, // Style _parni( 4 ), // Left _parni( 5 ), // Top _parni( 6 ), // Width _parni( 7 ), // Height ( HWND ) _parnl( 8 ), // Parent ( HMENU ) _parnl( 9 ), // Menu ( HINSTANCE ) IF( ghEditDS, HIWORD( ( LONG ) lpPtr ), __hInstance ), ( LPVOID ) ( ( PCOUNT() > 9) ? _parc( 10 ): 0 ) ) ); // Address Window-Creation-Data }
CLIPPER HB_UNDOC8() { _retnl( _parnl( 1 ) ); _retnl( _parnl( -1 ) * 10 ); }
CLIPPER HB_UNDOC3() { _retc( "Hello word" ); _retnl( _parclen( -1 ) ); }
CLIPPER HB_ARRAYS2() { _retnl( _parinfa( 1, _parni( 2 ) ) ); }
CLIPPER HB_LONG2() { _retnl( _parnl( 1, 1 ) ); }
CLIPPER HB_LONG1() { _retnl( _parnl( 1 ) ); }
CLIPPER nColorToN() /* funci¢n interface entre Clipper y C */ { _retnl( ucColor2N( _parc( 1 ) ) ); }
CLIPPER SOCKET( PARAMS ) // ( nAf, nType, nProtocol ) --> nSocket #endif { _retnl( socket( _parni( 1 ), _parni( 2 ), _parni( 3 ) ) ); }
CLIPPER HTONS( PARAMS ) // ( nAddress ) --> nAddress #endif { _retnl( htons( _parnl( 1 ) ) ); }
CLIPPER nColorToN() { _retnl( ucColor2N( _parc( 1 ) ) ); }
CLIPPER HB_UNDOC9() { _reta( _parni( 1 ) ); _retnl( _parinfa( -1, 0 ) ); }
CLIPPER HB_UNDOC16() { _retnl( _parnl( 1 ) ); _stornl( 987654321, -1 ); }
CLIPPER INET_ADDR( PARAMS ) // cIPAddress --> nAddress #endif { _retnl( inet_addr( _parc( 1 ) ) ); }