use Win32::API; use strict; use warnings "all"; # MessageBox API - Reference: http://msdn2.microsoft.com/en-us/library/ms712455.aspx # int MessageBox( # HWND hWnd, # LPCTSTR lpText, # LPCTSTR lpCaption, # UINT uType # ); my $hwndOwner = 0; my $LpszText = "Message Box Text"; my $LpszTitle = "Message Box Title"; my $uStyle = 0; #define MB_OKCANCEL 0x00000001L my $fnMessageBox = new Win32::API("user32", "MessageBox", 'NPPN', 'I'); my $call1ret = $fnMessageBox->Call($hwndOwner, $LpszText, $LpszTitle, $uStyle); print "MessageBox Return Code: ".$call1ret."\n"; # SQLAllocHandle API - Reference: http://msdn2.microsoft.com/en-us/library/ms712455.aspx # SQLRETURN SQLAllocHandle( # SQLSMALLINT HandleType, # SQLHANDLE InputHandle, # SQLHANDLE * OutputHandlePtr); my $HandleType = 1; my $InputHandle = 0; my $OutputHandlePtr = ''; my $fnSQLAllocHandle = new Win32::API("odbc32", "SQLAllocHandle", 'PPP', 'I'); my $call2ret = $fnSQLAllocHandle->Call($HandleType, $InputHandle, $OutputHandlePtr); print "?? ".$^E."\n\n"; print "SQLAllocHandle Return Code: ".$call2ret."\n";