SignaturePad on android webview cannot save image to server - signaturepad

I have made an application (classic asp on local IIS 7.5 server Win 7 Ultimate) and with webview on android i want to take signatures from clients.
Works perfect on PC and tablet with android 5.1.
But when i run the app on mobile with Android 7 or tablet with Android 4.4.2 creates error on line
function SaveToBase64 (base64String)
Set Doc = Server.CreateObject("MSXML2.DomDocument")
Set nodeB64 = Doc.CreateElement("b64")
nodeB64.DataType = "bin.base64"
nodeB64.Text = Mid(base64String, InStr(base64String, ",") + 1)
dim bStream
set bStream = server.CreateObject("ADODB.stream")
bStream.type = 1
bStream.Open()
--> bStream.Write( nodeB64.NodeTypedValue )
bStream.SaveToFile Server.Mappath("../Signatures/" & ImageFileName), 2
bStream.close()
set bStream = nothing
end function
P.S. Canvas and drawing on it works perfect.
P.S. 1 Looks like cannot load jquery libraries..
Thank you very much.

Related

Remove the footer from site?

I want to receive the site without footer but make the header exist by (I use "web view") . Can any one solve my problem in java language (Android studio)?
You can use loadDataWithBaseURL() method like below:
WebView mWebView = (WebView)this.findViewById(R.id.webview);
String mUrl=“<your website url>”;
Document document = Jsoup.connect(mUrl).get();
document.getElementsByClass("footer").remove();
WebSettings ws = mWebView.getSettings();
ws.setJavaScriptEnabled(true);
mWebView.loadDataWithBaseURL(mUrl,document.toString(),"text/html","utf-8","");

VBA program executing SAP RFCs works in Excel 2016 on-prem, but not in Office 365 (Run-time error 20080008...Bad Variant Type)

Let me first say that I saw the other two threads that mentioned this issue here and here, but they didn't help me solve my problem.
I've been testing a program for several weeks in the on-prem Excel 2016 environment (32-bit) with no problems. My company is making the move to Office 365 soon, so I decided to test it over there as well. On that system, I'm getting a run-time error on the line Functions.Connection = objConnection
Option Explicit
Public Functions As SAPFunctionsOCX.SAPFunctions
Private LogonControl As SAPLogonCtrl.SAPLogonControl
Private objConnection As SAPLogonCtrl.Connection
Public Func As SAPFunctionsOCX.Function
Public Commit As SAPFunctionsOCX.Function
Public TableFactory As SAPTableFactory
Public silentLogon As Boolean
Public tblReadTableOptions, tblReadTableFields, tblReadTableData As SAPTableFactoryCtrl.Table
Sub ExtractProjectData()
If objConnection Is Nothing Then LogonToSAP
InitiateSAPVariables
Set Func = Functions.Add("BBP_RFC_READ_TABLE")
Set tblReadTableOptions = Func.Tables("OPTIONS")
Set tblReadTableFields = Func.Tables("FIELDS")
Set tblReadTableData = Func.Tables("DATA")
'extract/transform data from SAP tables
End Sub
Function InitiateSAPVariables()
Set Functions = Nothing
Set TableFactory = Nothing
Set Func = Nothing
Set Functions = CreateObject("SAP.Functions")
Set TableFactory = CreateObject("SAP.TableFactory.1")
Functions.Connection = objConnection 'run-time error here in Office 365 but not in on-prem
End Function
Function LogonToSAP()
Dim establishConnection As Boolean
silentLogon = false
Set LogonControl = CreateObject("SAP.LogonControl.1")
Set objConnection = LogonControl.NewConnection
objConnection.Client = "###"
objConnection.Language = "EN"
objConnection.SystemNumber = "##"
objConnection.User = ""
objConnection.Password = ""
objConnection.HostName = "###############"
objConnection.System = "###"
objConnection.ApplicationServer = "###.###.#.##"
establishConnection = objConnection.Logon(0, silentLogon)
End Function
A quick check of objConnection tells me that logon was successful...so I know that part is working on 365. For some reason though, it doesn't like assigning the Connection property of the Functions SAPFunctionsOCX.SAPFunctions object in the 365 environment (please feel free to correct my verbiage on that...I know it's not quite right).
Note that I'm not seeing any reference issues nor am I getting any compile errors in either environment. The first sign of trouble is on execution of Functions.Connection = objConnection
There's one more twist here and that is that I have another older VBA program that logs into SAP and runs remote function calls that doesn't use SAPFunctionsOCX.SAPFunctions, but rather declares variable R3 as Public R3 As Object and then sets R3 later in the logon code as Set R3 = CreateObject("SAP.Functions")...it does not use OCX. In other words, the old routine uses late binding. When the Functions object (R3 in this case) is set this way, I am able to run RFCs in both on prem and Office 365 environments.
Function LogonProdSAP(Optional SuppressLoginScreen As Boolean)
Application.ScreenUpdating = False
'**********************************************
'Create Server object and Setup the connection for DEV
'**********************************************
Set R3 = CreateObject("SAP.Functions")
If SuppressLoginScreen Then
R3.Connection.System = "###"
R3.Connection.HostName = "###################"
R3.Connection.SystemNumber = "##"
R3.Connection.Client = "###"
R3.Connection.User = "##########"
R3.Connection.Password = "#########"
R3.Connection.Language = "EN"
' Call Logger("LogonProdSAP> " & GetUserName)
End If
LogonProdSAP = R3.Connection.logon(0, SuppressLoginScreen)
If LogonProdSAP <> True Then MsgBox ("Logon error"): Exit Function
End Function
I could just go back to doing it this way, but I'd rather not have to reconfigure all of the code I just set up. In addition, I prefer binding early so Intellitype works to show all properties/methods available to that object. I'm sure there are other benefits as well.
What do I have to do to get the early-binding technique to work on Office 365?
It's due to the fact that your Office is in 64 bits version, and SAP GUI for Windows up to version 7.60 is in 32 bits (next SAP GUI version 7.70 should be in 64 bits, so it should work again).
You have a workaround to make VBA work with SAP GUI 32-bits DLL, by using DLL Surrogate, i.e. by editing the Windows Registry of all incompatible SAP GUI DLL. The original solution was proposed here at SAP Community.
To simplify the task, you may create my .REG file, execute it to update automatically the Windows Registry, and your VBA macro should then work.
I duplicate here my .REG file:
; ====================================================================================
; SAP Logon Unicode Control %ProgramFiles(x86)%\SAP\FrontEnd\SAPgui\wdtlogU.ocx {0AAF5A11-8C04-4385-A925-0B62F6632BEC}
; ====================================================================================
[HKEY_CLASSES_ROOT\WOW6432Node\AppID\{0AAF5A11-8C04-4385-A925-0B62F6632BEC}]
"DllSurrogate"=""
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{0AAF5A11-8C04-4385-A925-0B62F6632BEC}]
"AppID"="{0AAF5A11-8C04-4385-A925-0B62F6632BEC}"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{0AAF5A11-8C04-4385-A925-0B62F6632BEC}]
; ====================================================================================
; SAP Remote Function Call Unicode Control %ProgramFiles(x86)%\SAP\FrontEnd\SAPgui\wdtfuncu.ocx {0AF427E7-03B9-4673-8F21-F33A683BCE28}
; ====================================================================================
[HKEY_CLASSES_ROOT\WOW6432Node\AppID\{0AF427E7-03B9-4673-8F21-F33A683BCE28}]
"DllSurrogate"=""
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{0AF427E7-03B9-4673-8F21-F33A683BCE28}]
"AppID"="{0AF427E7-03B9-4673-8F21-F33A683BCE28}"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{0AF427E7-03B9-4673-8F21-F33A683BCE28}]
; ====================================================================================
; SAP Logon Control (not Unicode) %ProgramFiles(x86)%\SAP\FrontEnd\SAPgui\wdtlog.ocx {B24944D6-1501-11CF-8981-0000E8A49FA0}
; ====================================================================================
[HKEY_CLASSES_ROOT\WOW6432Node\AppID\{B24944D6-1501-11CF-8981-0000E8A49FA0}]
"DllSurrogate"=""
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{B24944D6-1501-11CF-8981-0000E8A49FA0}]
"AppID"="{B24944D6-1501-11CF-8981-0000E8A49FA0}"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{B24944D6-1501-11CF-8981-0000E8A49FA0}]
; ====================================================================================
; SAP Remote Function Call Control (not Unicode) %ProgramFiles(x86)%\SAP\FrontEnd\SAPgui\wdtfuncs.ocx {5B076C03-2F26-11CF-9AE5-0800096E19F4}
; ====================================================================================
[HKEY_CLASSES_ROOT\WOW6432Node\AppID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}]
"DllSurrogate"=""
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}]
"AppID"="{5B076C03-2F26-11CF-9AE5-0800096E19F4}"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}]

IQKeyboardManager is not working in Xcode 9 , next , prev & done buttons are not on Keyboard toolbar

IQKeyboardmanager toolbar works fine if i use Xcode8, but when i use Xcode 9 there is no next , prev & done buttons on Keyboard toolbar.Even other feature are not working in Xcode 9.
You can try this:
IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.enableAutoToolbar = true

Win 10 - CreateObject("X509Enrollment.CX509PrivateKey") throws Object does not support this property or method

Win 7 - IE 11 has 6.1.7600.16385 of this "X509 Enrollment WebClassFactory" ActiveX control.
Win 10 - IE 11 has 10.0.10240.16384 of this "X509 Enrollment WebClassFactory" ActiveX control.
The below call works well in Windows 7 but shows Object does not support this property or method in Windows 10
.CreateObject("X509Enrollment.CX509PrivateKey")
Below is the relevant part of the code used. Messagebox with the above noted error is shown only in Win 10, not in Win 7
<OBJECT id='factory' CLASSID='clsid:884e2049-217d-11da-b2a4-000e7bbb2b09'></OBJECT>
set objRequest = factory.CreateObject("X509Enrollment.CX509PrivateKey")
If ( err.number <> 0 ) then
MsgBox(err.Description)
End If
What has changed in Win 10 for this active X control?

Error in Hash Implementation in VBA - Runtime Error -2146232576 (80131700)

I have implemented the hash method as suggested on the post:
Does VBA has a Hash_HMAC
This is my implementation:
Public Function BASE64SHA1(ByVal sTextToHash As String)
Dim asc As Object
Dim enc As Object
Dim TextToHash() As Byte
Dim SharedSecretKey() As Byte
Dim bytes() As Byte
Set asc = CreateObject("System.Text.UTF8Encoding")
Set enc = CreateObject("System.Security.Cryptography.HMACSHA1")
TextToHash = asc.GetBytes_4(sTextToHash)
SharedSecretKey = asc.GetBytes_4(sTextToHash)
enc.Key = SharedSecretKey
bytes = enc.ComputeHash_2((TextToHash))
BASE64SHA1 = EncodeBase64(bytes)
Set asc = Nothing
Set enc = Nothing
End Function
Private Function EncodeBase64(ByRef arrData() As Byte) As String
Dim objXML As Object
Dim objNode As Object
Set objXML = CreateObject("MSXML2.DOMDocument")
Set objNode = objXML.createElement("b64")
objNode.DataType = "bin.base64"
objNode.nodeTypedValue = arrData
EncodeBase64 = objNode.TEXT
Set objNode = Nothing
Set objXML = Nothing
End Function
Everything was working great, running under Excel 2013 (Portuguese), Windows 8.1 (Portuguese) and Windows 7.
Although, when I start using another computer which uses the same Excel 2013 (Portuguese) but the Windows 8.1 (English), not sure why and if this is the reason, but it came up with the error and the debugger highlighted the first line in BASE64SHA1 function, after variables declaration:
Set asc = CreateObject("System.Text.UTF8Encoding")
Error:
Runtime Error -2146232576 (80131700)
I checked the error messages and came with the details below:
err.Source - VBAProject
err.HelpContext - 1000440
err.HelpFile - C:\Program Files (x86)\Common Files\Microsoft Shared\VBA\VBA7.1\1046\VbLR6.chm
err.LastDllError - 0
Can anyone help? Looks like I am missing a Reference or something... but I have declared as Object, and it worked fine on other PCs...
The error
Runtime Error -2146232576 (80131700)
on CreateObject in a VBA macro is probably due to the lack of a .NET2 framework, as suggested by ZygD.
I am answering to introduce a way to check if this is the problem.
You should follow thhese steps:
Open Windows => Run (or hit Windows + R)
Type "CMD"
Push Run
Paste the following register query to check what are the versions of the Framework .NET installed on your PC: reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP"
You will get something like
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\CDF
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4.0
The istruction CreateObject require a .NET2 version wich means that even if you have the v4.0, you will need NET Framework v3.5 in addition.
You can follow this tutorial to install it.
Now, if you follow the same steps listed above you should get
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\CDF
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4.0
At this point, if you open Microsoft Excel and you hit Alt + F11 and run the macro this should work.
There is an identical error number discussed and the problem solved on a post in MSDN (Excel 2010 VB Run-time Error '-2146232576 (80131700)' Automation Error on CreateObject("System.Collections.ArrayList") ???).
The problem there was solved by installing Microsoft .NET Framework 2.0 SP2 (which automatically also installed 3.5).

Resources