#include "FiveWin.ch"
function Main()
local pString, cIID, pFactory
local pXml, pNodeList, pNode
RoInitialize( 1 )
pString = WinRTString( "Windows.UI.Notifications.ToastNotificationManager" )
// "50AC103F-D235-4598-BBEF-98FE4D1A3AD4"
cIID = Chr( 0x3F ) + Chr( 0x10 ) + Chr( 0xAC ) + Chr( 0x50 ) + ;
Chr( 0x35 ) + Chr( 0xD2 ) + Chr( 0x98 ) + Chr( 0x45 ) + ;
Chr( 0xBB ) + Chr( 0xEF ) + Chr( 0x98 ) + Chr( 0xFE ) + ;
Chr( 0x4D ) + Chr( 0x1A ) + Chr( 0x3A ) + Chr( 0xD4 )
RoGetActivationFactory( pString, cIID, @pFactory )
WindowsDeleteString( pString );
// pFactory->GetTemplateContent( ... )
WinRTMethod( pFactory, 9, 3, @pXml ) // 9: Ninth method, 3: fourth template
pString = WinRTString( "text" )
// pXML->GetElementsByTagName( ... )
WinRTMethod( pXml, 17, pString, @pNodeList )
WindowsDeleteString( pString )
// pNodeList->Item( ... )
WinRTMethod( pNodeList, 8, 0, @pNode )
MsgInfo( pNode )
RoUninitialize()
return nil
function WinRTString( cText )
local pString
WindowsCreateString( AnsiToWide( cText ), Len( cText ), @pString )
return pString
DLL FUNCTION RoInitialize( nType AS LONG ) AS LONG PASCAL LIB "combase.dll"
DLL FUNCTION RoUninitialize() AS VOID PASCAL LIB "combase.dll"
DLL FUNCTION WindowsCreateString( cWideText AS LPSTR, nLength AS LONG, @pString AS PTR ) ;
AS LONG PASCAL LIB "combase.dll"
DLL FUNCTION WindowsDeleteString( pString AS PTR ) AS LONG PASCAL LIB "combase.dll"
DLL FUNCTION RoGetActivationFactory( pString AS PTR, REFIID AS LPSTR, @pFactory AS PTR ) ;
AS LONG PASCAL LIB "combase.dll"
#pragma BEGINDUMP
#include <Windows.h>
#include <hbapi.h>
typedef void * ( __stdcall * PMETHOD0 )( void * );
typedef void * ( __stdcall * PMETHOD1 )( void *, void * );
typedef void * ( __stdcall * PMETHOD2 )( void *, void *, void * );
HB_FUNC( WINRTMETHOD ) // pInspectable, nMethod, params...
{
IUnknown * unknown = ( IUnknown * ) hb_parnll( 1 );
void * pMethod = ( ( void ** ) unknown->lpVtbl )[ hb_parnl( 2 ) - 1 ];
IUnknown * pReturn;
switch( hb_pcount() )
{
case 3:
hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD1 ) pMethod )( unknown, &pReturn ) );
break;
case 4:
hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD2 ) pMethod )( unknown, ( void * ) hb_parnll( 3 ), &pReturn ) );
break;
}
if( HB_ISBYREF( 3 ) )
hb_storvnll( ( HB_LONGLONG ) pReturn, 3 );
if( HB_ISBYREF( 4 ) )
hb_storvnll( ( HB_LONGLONG ) pReturn, 4 );
}
#pragma ENDDUMP
#include "FiveWin.ch"
function Main()
local pString, cIID, pToastFactory
local pXml, pNodeList, pNode
local pNotification, pNotificationFactory, pNotifier
RoInitialize( 1 )
pString = WinRTString( "Windows.UI.Notifications.ToastNotificationManager" )
// "50AC103F-D235-4598-BBEF-98FE4D1A3AD4"
cIID = Chr( 0x3F ) + Chr( 0x10 ) + Chr( 0xAC ) + Chr( 0x50 ) + ;
Chr( 0x35 ) + Chr( 0xD2 ) + Chr( 0x98 ) + Chr( 0x45 ) + ;
Chr( 0xBB ) + Chr( 0xEF ) + Chr( 0x98 ) + Chr( 0xFE ) + ;
Chr( 0x4D ) + Chr( 0x1A ) + Chr( 0x3A ) + Chr( 0xD4 )
RoGetActivationFactory( pString, cIID, @pToastFactory )
WindowsDeleteString( pString );
// pFactory->GetTemplateContent( ... )
WinRTMethod( pToastFactory, 9, 3, @pXml ) // 9: Ninth method, 3: fourth template
pString = WinRTString( "text" )
// pXML->GetElementsByTagName( ... )
WinRTMethod( pXml, 17, pString, @pNodeList )
WindowsDeleteString( pString )
// pNodeList->Item( ... )
WinRTMethod( pNodeList, 8, 0, @pNode )
// 04124B20-82C6-4229-B109-FD9ED4662B53
cIID = Chr( 0x20 ) + Chr( 0x4B ) + Chr( 0x12 ) + Chr( 0x04 ) + ;
Chr( 0xC6 ) + Chr( 0x82 ) + Chr( 0x29 ) + Chr( 0x42 ) + ;
Chr( 0xB1 ) + Chr( 0x09 ) + Chr( 0xFD ) + Chr( 0x9E ) + ;
Chr( 0xD4 ) + Chr( 0x66 ) + Chr( 0x2B ) + Chr( 0x53 )
pString = WinRTString( "Windows.UI.Notifications.ToastNotification" )
RoGetActivationFactory( pString, cIID, @pNotificationFactory )
WindowsDeleteString( pString )
// factory->CreateToastNotification( ... );
WinRTMethod( pNotificationFactory, 7, pXML, @pNotification )
pString = WinRTString( "FiveTech" )
// toastStatics->CreateToastNotifierWithId( ... );
WinRTMethod( pToastFactory, 8, pString, @pNotifier )
WindowsDeleteString( pString )
// notifier->Show( ... );
WinRTMethod( pNotifier, 7, pNotification )
RoUninitialize()
return nil
function WinRTString( cText )
local pString
WindowsCreateString( AnsiToWide( cText ), Len( cText ), @pString )
return pString
DLL FUNCTION RoInitialize( nType AS LONG ) AS LONG PASCAL LIB "combase.dll"
DLL FUNCTION RoUninitialize() AS VOID PASCAL LIB "combase.dll"
DLL FUNCTION WindowsCreateString( cWideText AS LPSTR, nLength AS LONG, @pString AS PTR ) ;
AS LONG PASCAL LIB "combase.dll"
DLL FUNCTION WindowsDeleteString( pString AS PTR ) AS LONG PASCAL LIB "combase.dll"
DLL FUNCTION RoGetActivationFactory( pString AS PTR, REFIID AS LPSTR, @pFactory AS PTR ) ;
AS LONG PASCAL LIB "combase.dll"
#pragma BEGINDUMP
#include <Windows.h>
#include <hbapi.h>
typedef void * ( __stdcall * PMETHOD0 )( void * );
typedef void * ( __stdcall * PMETHOD1 )( void *, void * );
typedef void * ( __stdcall * PMETHOD2 )( void *, void *, void * );
HB_FUNC( WINRTMETHOD ) // pInspectable, nMethod, params...
{
IUnknown * unknown = ( IUnknown * ) hb_parnll( 1 );
void * pMethod = ( ( void ** ) unknown->lpVtbl )[ hb_parnl( 2 ) - 1 ];
IUnknown * pReturn;
switch( hb_pcount() )
{
case 3:
if( HB_ISBYREF( 3 ) )
hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD1 ) pMethod )( unknown, &pReturn ) );
else
hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD1 ) pMethod )( unknown, ( IUnknown * ) hb_parnll( 3 ) ) );
break;
case 4:
if( HB_ISBYREF( 4 ) )
hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD2 ) pMethod )( unknown, ( void * ) hb_parnll( 3 ), &pReturn ) );
else
hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD2 ) pMethod )( unknown, ( void * ) hb_parnll( 3 ), ( IUnknown * ) hb_parnll( 4 ) ) );
break;
}
if( HB_ISBYREF( 3 ) )
hb_storvnll( ( HB_LONGLONG ) pReturn, 3 );
if( HB_ISBYREF( 4 ) )
hb_storvnll( ( HB_LONGLONG ) pReturn, 4 );
}
#pragma ENDDUMP
Generating C source output to 'Toasts1.c'...
Done.
Lines 91, Functions/Procedures 7, pCodes 567
The system cannot find the file specified.
Embarcadero C++ 7.00 for Win32 Copyright (c) 1993-2015 Embarcadero Technologies, Inc.
Toasts1.c:
Error E2451 Toasts1.prg 110: Undefined symbol 'HB_LONGLONG' in function HB_FUN_WINRTMETHOD
Error E2451 Toasts1.prg 124: Undefined symbol 'HB_LONGLONG' in function HB_FUN_WINRTMETHOD
Error E2121 Toasts1.prg 124: Function call missing ) in function HB_FUN_WINRTMETHOD
Error E2121 Toasts1.prg 127: Function call missing ) in function HB_FUN_WINRTMETHOD
Warning W8004 Toasts1.prg 128: 'pMethod' is assigned a value that is never used in function HB_FUN_WINRTMETHOD
*** 4 errors in Compile ***
* Linking errors *
Process completed, Exit Code 0.
Execution time: 00:03.389
#include "FiveWin.ch"
function Main()
local pString, cIID, pToastFactory
local pXml, pNodeList, pNode
local pNotification, pNotificationFactory, pNotifier
RoInitialize( 1 )
pString = WinRTString( "Windows.UI.Notifications.ToastNotificationManager" )
// "50AC103F-D235-4598-BBEF-98FE4D1A3AD4"
cIID = Chr( 0x3F ) + Chr( 0x10 ) + Chr( 0xAC ) + Chr( 0x50 ) + ;
Chr( 0x35 ) + Chr( 0xD2 ) + Chr( 0x98 ) + Chr( 0x45 ) + ;
Chr( 0xBB ) + Chr( 0xEF ) + Chr( 0x98 ) + Chr( 0xFE ) + ;
Chr( 0x4D ) + Chr( 0x1A ) + Chr( 0x3A ) + Chr( 0xD4 )
RoGetActivationFactory( pString, cIID, @pToastFactory )
WindowsDeleteString( pString );
// pFactory->GetTemplateContent( ... )
WinRTMethod( pToastFactory, 9, 3, @pXml ) // 9: Ninth method, 3: fourth template
pString = WinRTString( "text" )
// pXML->GetElementsByTagName( ... )
WinRTMethod( pXml, 17, pString, @pNodeList )
WindowsDeleteString( pString )
// pNodeList->Item( ... )
WinRTMethod( pNodeList, 8, 0, @pNode )
// 04124B20-82C6-4229-B109-FD9ED4662B53
cIID = Chr( 0x20 ) + Chr( 0x4B ) + Chr( 0x12 ) + Chr( 0x04 ) + ;
Chr( 0xC6 ) + Chr( 0x82 ) + Chr( 0x29 ) + Chr( 0x42 ) + ;
Chr( 0xB1 ) + Chr( 0x09 ) + Chr( 0xFD ) + Chr( 0x9E ) + ;
Chr( 0xD4 ) + Chr( 0x66 ) + Chr( 0x2B ) + Chr( 0x53 )
pString = WinRTString( "Windows.UI.Notifications.ToastNotification" )
RoGetActivationFactory( pString, cIID, @pNotificationFactory )
WindowsDeleteString( pString )
// factory->CreateToastNotification( ... );
WinRTMethod( pNotificationFactory, 7, pXML, @pNotification )
pString = WinRTString( "FiveTech" )
// toastStatics->CreateToastNotifierWithId( ... );
WinRTMethod( pToastFactory, 8, pString, @pNotifier )
WindowsDeleteString( pString )
// notifier->Show( ... );
WinRTMethod( pNotifier, 7, pNotification )
RoUninitialize()
return nil
function WinRTString( cText )
local pString
WindowsCreateString( AnsiToWide( cText ), Len( cText ), @pString )
return pString
DLL FUNCTION RoInitialize( nType AS LONG ) AS LONG PASCAL LIB "combase.dll"
DLL FUNCTION RoUninitialize() AS VOID PASCAL LIB "combase.dll"
DLL FUNCTION WindowsCreateString( cWideText AS LPSTR, nLength AS LONG, @pString AS PTR ) ;
AS LONG PASCAL LIB "combase.dll"
DLL FUNCTION WindowsDeleteString( pString AS PTR ) AS LONG PASCAL LIB "combase.dll"
DLL FUNCTION RoGetActivationFactory( pString AS PTR, REFIID AS LPSTR, @pFactory AS PTR ) ;
AS LONG PASCAL LIB "combase.dll"
#pragma BEGINDUMP
#include <Windows.h>
#include <hbapi.h>
#ifndef HB_LONGLONG
#define HB_LONGLONG long
#define hb_storvnll hb_stornl
#endif
typedef void * ( __stdcall * PMETHOD0 )( void * );
typedef void * ( __stdcall * PMETHOD1 )( void *, void * );
typedef void * ( __stdcall * PMETHOD2 )( void *, void *, void * );
HB_FUNC( WINRTMETHOD ) // pInspectable, nMethod, params...
{
IUnknown * unknown = ( IUnknown * ) hb_parnll( 1 );
void * pMethod = ( ( void ** ) unknown->lpVtbl )[ hb_parnl( 2 ) - 1 ];
IUnknown * pReturn;
switch( hb_pcount() )
{
case 3:
if( HB_ISBYREF( 3 ) )
hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD1 ) pMethod )( unknown, &pReturn ) );
else
hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD1 ) pMethod )( unknown, ( IUnknown * ) hb_parnll( 3 ) ) );
break;
case 4:
if( HB_ISBYREF( 4 ) )
hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD2 ) pMethod )( unknown, ( void * ) hb_parnll( 3 ), &pReturn ) );
else
hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD2 ) pMethod )( unknown, ( void * ) hb_parnll( 3 ), ( IUnknown * ) hb_parnll( 4 ) ) );
break;
}
if( HB_ISBYREF( 3 ) )
hb_storvnll( ( HB_LONGLONG ) pReturn, 3 );
if( HB_ISBYREF( 4 ) )
hb_storvnll( ( HB_LONGLONG ) pReturn, 4 );
}
#pragma ENDDUMP
#include "FiveWin.ch"
#define Show 7
#define CreateToastNotification 7
#define CreateToastNotifierWithId 8
#define Item 8
#define GetTemplateContent 9
#define CreateTextNode 12
#define GetElementsByTagName 17
#define AppendChild 23
function Main()
Toast( "Hello world" )
return nil
function Toast( cFirstLine )
local pString, cIID, pToastFactory
local pXml, pNodeList, pXmlNode, pXmlText, pXmlNodeChild
local pNotification, pNotificationFactory, pNotifier
RoInitialize( 1 )
pString = WinRTString( "Windows.UI.Notifications.ToastNotificationManager" )
// "50AC103F-D235-4598-BBEF-98FE4D1A3AD4"
cIID = Chr( 0x3F ) + Chr( 0x10 ) + Chr( 0xAC ) + Chr( 0x50 ) + ;
Chr( 0x35 ) + Chr( 0xD2 ) + Chr( 0x98 ) + Chr( 0x45 ) + ;
Chr( 0xBB ) + Chr( 0xEF ) + Chr( 0x98 ) + Chr( 0xFE ) + ;
Chr( 0x4D ) + Chr( 0x1A ) + Chr( 0x3A ) + Chr( 0xD4 )
RoGetActivationFactory( pString, cIID, @pToastFactory )
WindowsDeleteString( pString );
WinRTMethod( pToastFactory, GetTemplateContent, 3, @pXml ) // 3: fourth template
pString = WinRTString( "text" )
WinRTMethod( pXml, GetElementsByTagName, pString, @pNodeList )
WindowsDeleteString( pString )
WinRTMethod( pNodeList, Item, 0, @pXmlNode )
pString = WinRTString( "First line" )
WinRTMethod( pXml, CreateTextNode, pString, @pXmlText )
// pXmlText.As( ... );
// WinRTMethod( pXmlText, 8, @pXmlNode )
WinRTMethod( pXmlNode, AppendChild, pXmlText, @pXmlNodeChild )
// 04124B20-82C6-4229-B109-FD9ED4662B53
cIID = Chr( 0x20 ) + Chr( 0x4B ) + Chr( 0x12 ) + Chr( 0x04 ) + ;
Chr( 0xC6 ) + Chr( 0x82 ) + Chr( 0x29 ) + Chr( 0x42 ) + ;
Chr( 0xB1 ) + Chr( 0x09 ) + Chr( 0xFD ) + Chr( 0x9E ) + ;
Chr( 0xD4 ) + Chr( 0x66 ) + Chr( 0x2B ) + Chr( 0x53 )
pString = WinRTString( "Windows.UI.Notifications.ToastNotification" )
RoGetActivationFactory( pString, cIID, @pNotificationFactory )
WindowsDeleteString( pString )
WinRTMethod( pNotificationFactory, CreateToastNotification, pXML, @pNotification )
pString = WinRTString( cFirstLine )
WinRTMethod( pToastFactory, CreateToastNotifierWithId, pString, @pNotifier )
WindowsDeleteString( pString )
WinRTMethod( pNotifier, Show, pNotification )
RoUninitialize()
return nil
function WinRTString( cText )
local pString
WindowsCreateString( AnsiToWide( cText ), Len( cText ), @pString )
return pString
DLL FUNCTION RoInitialize( nType AS LONG ) AS LONG PASCAL LIB "combase.dll"
DLL FUNCTION RoUninitialize() AS VOID PASCAL LIB "combase.dll"
DLL FUNCTION WindowsCreateString( cWideText AS LPSTR, nLength AS LONG, @pString AS PTR ) ;
AS LONG PASCAL LIB "combase.dll"
DLL FUNCTION WindowsDeleteString( pString AS PTR ) AS LONG PASCAL LIB "combase.dll"
DLL FUNCTION RoGetActivationFactory( pString AS PTR, REFIID AS LPSTR, @pFactory AS PTR ) ;
AS LONG PASCAL LIB "combase.dll"
#pragma BEGINDUMP
#include <Windows.h>
#include <hbapi.h>
#ifndef HB_LONGLONG
#define HB_LONGLONG long
#define hb_storvnll hb_stornl
#endif
typedef void * ( __stdcall * PMETHOD0 )( void * );
typedef void * ( __stdcall * PMETHOD1 )( void *, void * );
typedef void * ( __stdcall * PMETHOD2 )( void *, void *, void * );
HB_FUNC( WINRTMETHOD ) // pInspectable, nMethod, params...
{
IUnknown * unknown = ( IUnknown * ) hb_parnll( 1 );
void * pMethod = ( ( void ** ) unknown->lpVtbl )[ hb_parnl( 2 ) - 1 ];
IUnknown * pReturn;
switch( hb_pcount() )
{
case 3:
if( HB_ISBYREF( 3 ) )
hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD1 ) pMethod )( unknown, &pReturn ) );
else
hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD1 ) pMethod )( unknown, ( IUnknown * ) hb_parnll( 3 ) ) );
break;
case 4:
if( HB_ISBYREF( 4 ) )
hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD2 ) pMethod )( unknown, ( void * ) hb_parnll( 3 ), &pReturn ) );
else
hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD2 ) pMethod )( unknown, ( void * ) hb_parnll( 3 ), ( IUnknown * ) hb_parnll( 4 ) ) );
break;
}
if( HB_ISBYREF( 3 ) )
hb_storvnll( ( HB_LONGLONG ) pReturn, 3 );
if( HB_ISBYREF( 4 ) )
hb_storvnll( ( HB_LONGLONG ) pReturn, 4 );
}
#pragma ENDDUMP
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Willi Quintana, wilsongamboa and 28 guests