Twain DataSourceManager - axapta

I added a twainScanner .dll reference to ax2009. And I have a problem with initiation. How to initiate DataSourceManager object with ax form? I tried a lot of tips, but everytime i got error The '1' argument is incompatible with the required type.
void openScannerForm()
{
Args args;
FormRun formRun;
TwainScanning.AppInfo app;
TwainScanning.DataSourceManager twainDSM;
;
app = new TwainScanning.AppInfo();
twainDSM = new TwainScanning.DataSourceManager(*HERE I HAVE A PROBLEM* , app); //this object require Form parameter, how to get it ?
}

Related

Xamarin Forms - Error in iOS Attempting to JIT compile

I have a xamarin forms app. When I compile and test on my Pixel3, everything seems to be working properly. When I load it up in my iOS device running iOS13.something, I get the following error when I try to make my second call to a web service in my app. The error is shown below.
Assertion at /Users/builder/jenkins/workspace/archive-mono/2019-08/ios/release/mono/mini/interp/interp.c:2160, condition `is_ok (error)' not met, function:do_jit_call, Attempting to JIT compile method '(wrapper other) void object:gsharedvt_out_sig (object&,single&,int&,intptr)' while running in aot-only mode. See https://learn.microsoft.com/xamarin/ios/internals/limitations for more information. assembly: type: member:(null)
The code is a bit of a mess, but has been working in the past.
var uri = String.Format("{0}//{1}/{2}?PlayerToken={3}", protocol, servername, tournamentsInClubUrl, userToken);
var httpC = new HttpClient();
HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Get, uri);
requestMessage.Headers.Add("AppKey", AppKey);
var body = await httpC.SendAsync(requestMessage); <-- Error happens here.
var str = await body.Content.ReadAsStringAsync();
var res = JsonConvert.DeserializeObject<List<PicVideoApp.Models.TournamentInfo>>(str);
httpC.Dispose();
httpC = null;
return res;
I assume that I am doing something wrong, but danged if I can see it. Any ideas are appreciated.
It runs properly in the iOS Simulator.
TIA.
From shared error info , you need to use C# delegate to call native functions .
To call a native function through a C# delegate, the delegate's declaration must be decorated with one of the following attributes:
UnmanagedFunctionPointerAttribute (preferred, since it is cross-platform and compatible with .NET Standard 1.1+)
MonoNativeFunctionWrapperAttribute
For example :
[MonoNativeFunctionWrapper]
delegate void SomeDelegate (int a, int b);
//
// the ptrToFunc points to an unmanaged C function with the signature (int a, int b)
void Callback (IntPtr ptrToFunc)
{
var del = (SomeDelegate) Marshal.GetDelegateForFunctionPointer (ptrToFunc, typeof (SomeDelegate));
// invoke it
del (1, 2);
A similar error was thrown at me in iOS when I used dynamic types in my code. I was able to solve it by enabling the 'Mono Interpreter' in iOS build settings. Hope that helps in your case.

cannot find symbol addActionListener()

I am a beginner in javafx.I have a function button_loop() that is supposed to dynamically generate a specified number of buttons and add an action listener for each button as it is generated.The buttons are then stored in an ArrayList and the ArrayList is then added to a HBox. The buttons are generating fine. However, when I attempt to add an action listener like so:
button.addActionListener(this)
And despite implementing the actionListener interface,I get the following error:
error: cannot find symbol
button.addActionListener(this);
symbol: method addActionListener(dummy_td)
location: variable button of type Button
The code for the function is:
void button_loop() throws SQLException, ClassNotFoundException {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection c = DriverManager.getConnection(connection, user_name, password);
PreparedStatement st = c.prepareStatement("select service_name from services");
ResultSet rs = st.executeQuery();
while (rs.next()) {
String service = rs.getString("service_name");
Button button = new Button(service);
button.addActionListener(this);
buttonlist.add(i,button);
}
hboxx.getChildren().addAll(buttonlist);
}
I've been trying to figure this out for 2 days..please help.
It's either
button.setOnAction(this);
(allows only for a single event handler added this way)
or
button.addEventHandler(ActionEvent.ACTION, this);
// event type ^^^^^^ | ^^^ handler
Note: if you get this error it may be worth checking the JavaDoc, if the member even exists.

DictTable CallObject

I am using the following code to dynamically execute calls to a table method that may or may not be present.
However, it always returns Error executing code: myTableName table does not have method 'myUpdateMethod'.
Dicttable dictTable;
Common common;
ExecutePermission perm;
perm = new ExecutePermission();
dictTable= new DictTable(tableName2Id('myTableName'));
if (dictTable != null)
{
common = dictTable.makeRecord();
// Grants permission to execute the
// DictTable.callObject method. DictTable.callObject runs
// under code access security.
perm.assert();
dictTable.callObject('myUpdateMethod', common);
}
// Close the code access permission scope.
CodeAccessPermission::revertAssert();
These objects are in different models, but just for kicks I tried making a reference between the two models to see if it made a difference. It did not fix the issue.
Thanks
Changed the method being called from static to non-static.
Started working, then found the callStatic() equivalent.
Here is the code I ended up using for the non-static method, which has no params.
Dicttable dictTable;
Common common;
ExecutePermission perm;
perm = new ExecutePermission();
dictTable= new DictTable(tableName2Id('MyTableName'));
if (dictTable != null)
{
common = dictTable.makeRecord();
// Grants permissions
perm.assert();
if (dictTable.doesMethodExist('myMethodName'))
{
dictTable.callObject('myMethodName', common);
}
}
// Close the code access permission scope.
CodeAccessPermission::revertAssert();

Qt Installer framework - Customizing the UNINSTALLER

I am not able to get a hold of customizing the un-installation process, though I could succeed to some extent customizing the installation process. When I register for the signals “installationFinished” my functions in the installscript.qs gets called, but surprisingly the signals “uninstallationStarted and uninstallationFinished” never gets called if I register some functions. Not sure why? Also in qinstaller.h we have the below code for identifying different state/stages of installation, but how can I get similar information for un-installation?
enum Status {
InstallerUnfinished,
InstallerCanceledByUser,
InstallerRunning,
InstallerFailed,
InstallerSucceeded,
};
int status() const;
enum WizardPage {
Introduction = 0x1000,
TargetDirectory = 0x2000,
ComponentSelection = 0x3000,
LicenseCheck = 0x4000,
StartMenuSelection = 0x5000,
ReadyForInstallation = 0x6000,
PerformInstallation = 0x7000,
InstallationFinished = 0x8000,
End = 0xffff
};
Did you try this?
function Controller()
{
installer.uninstallationStarted.connect(this, Controller.prototype.runMyFunc);
}
Controller.prototype.runMyFunc = function()
{
// your code here
}

Is it possible to find the function and/or line number that caused an error in ActionScript 3.0 without using debug mode?

I'm currently trying to implement an automated bug reporter for a Flex application, and would like to return error messages to a server along with the function/line number that caused the error. Essentially, I'm trying to get the getStackTrace() information without going into debug mode, because most users of the app aren't likely to have the debug version of flash player.
My current method is using the UncaughtErrorEvent handler to catch errors that occur within the app, but the error message only returns the type of error that has occurred, and not the location (which means it's useless). I have tried implementing getStackTrace() myself using a function name-grabber such as
private function getFunctionName (callee:Function, parent:Object):String {
for each ( var m:XML in describeType(parent)..method) {
if ( this[m.#name] == callee) return m.#name;
}
return "private function!";
}
but that will only work because of arguments.callee, and so won't go through multiple levels of function calls (it would never get above my error event listener).
So! Anyone have any ideas on how to get informative error messages through the global
error event handler?
EDIT: There seems to be some misunderstanding. I'm explicitly avoiding getStackTrace() because it returns 'null' when not in debug mode. Any solution that uses this function is what I'm specifically trying to avoid.
Just noticed the part about "I don't want to use debug." Well, that's not an option, as the non-debug version of Flash does not have any concept of a stack trace at all. Sucks, don't it?
Not relevant but still cool.
The rest is just for with the debug player.
This is part of my personal debug class (strangely enough, it is added to every single project I work on). It returns a String which represents the index in the stack passed -- class and method name. Once you have those, line number is trivial.
/**
* Returns the function name of whatever called this function (and whatever called that)...
*/
public static function getCaller( index:int = 0 ):String
{
try
{
throw new Error('pass');
}
catch (e:Error)
{
var arr:Array = String(e.getStackTrace()).split("\t");
var value:String = arr[3 + index];
// This pattern matches a standard function.
var re:RegExp = /^at (.*?)\/(.*?)\(\)/ ;
var owner:Array = re.exec(value);
try
{
var cref:Array = owner[1].split('::');
return cref[ 1 ] + "." + owner[2];
}
catch( e:Error )
{
try
{
re = /^at (.*?)\(\)/; // constructor.
owner = re.exec(value);
var tmp:Array = owner[1].split('::');
var cName:String = tmp.join('.');
return cName;
}
catch( error:Error )
{
}
}
}
return "No caller could be found.";
}
As a side note: this is not set up properly to handle an event model -- sometimes events present themselves as either not having callers or as some very weird alternate syntax.
You don't have to throw an error to get the stack trace.
var myError:Error = new Error();
var theStack:String = myError.getStackTrace();
good reference on the Error class
[EDIT]
Nope after reading my own reference getStackTrace() is only available in debug versions of the flash player.
So it looks like you are stuck with what you are doing now.

Resources