Not valid win32 application when creating RDOSession - outlook-redemption

new to this outlook.
basically trying to edit a draft mail's property and save it as a sent mail so i'm testing out using redemption. used the following code snippet but encountered error when creating the redeption object.
RedemptionLoader.DllLocation64Bit = #"c:\SourceCode\Redemption\redemption64.dll";
RedemptionLoader.DllLocation32Bit = #"c:\SourceCode\Redemption\redemption.dll";
//Create a Redemption object and use it
RDOSession session = RedemptionLoader.new_RDOSession();
enter code here
//error encounted : not a valid win32 application
Im using win64 with Outlook 64bit

Turns out it was a corrupted dll.
i did a hash value check to verify it.
replaced the corrupted dll and it works perfectly.
Thanks all!

Related

iOS WebKit - DataCloneError: The object can not be cloned

When working with WKWebView of iOS WebKit, I encountered an error when I tried to postMessage back to my WKScriptMessageHandler in a code like
window.webkit.messageHandlers.thisHandler.postMessage(message);
where message is a Javascript object (or in iOS developer's eyes, a dictionary) and the error is:
WKJavaScriptExceptionMessage=DataCloneError: The object can not be cloned.
It was quite confusing what this is about and I couldn't google out any useful information.
After removing the key-values one by one from my message object, I eventually figured out this error is caused by my mistakenly including some Javascript DOM objects instead of their primitive values in the object. For example, I included some variable
const myVar = document.body.querySelector("div.someClassName")
in my message body, which cannot be cloned for the native Swift environment. Similarly window.location is a purely JS DOM object and not clone-able either. To fix, just get their primitive values and include that in the message, like
const myVar = document.body.querySelector("div.someClassName").innerText;
const myURL = window.location.href;
const message = {myVar, myURL};
window.webkit.messageHandlers.thisHandler.postMessage(message);
I had the same error for having a function in the message payload.

NativeScript: Get string from interop.reference

To start, here is my code:
var buffer = malloc(interop.sizeof(interop.types.UTF8CString));
var fillBuffer = mac.getBytes(buffer);
var bytes = new interop.Reference(interop.types.UTF8CString, buffer);
var hexMac = bytes[0];
The variable 'Mac' is an NSData objected retrieved from CoreBluetooth. It is the scan response from a BLE device, which contains the peripheral's MAC address (00:0b:57:a2:fb:a0).
This problem is linked to THIS question I had posted earlier.
The solution provided is great; however, I cannot seem to implement this in nativescript :
(instancetype)stringWithFormat:(NSString *)format, ...;
Intellisense tells me the method doesnt exist on type NSString.
Due to that issue, I decided to go another route (as you can tell). I am filling a buffer with the bytes of the MAC address. In the code above, bytes[0] equates to 0xb57a2fba0.
I am now trying to convert that (which is an interop.Reference) into a string that I can store on the back-end (preferably in the xx:xx:xx:xx:xx format).
I have been at this all weekend, and cannot seem to find a solution. I even broke down objc!foundation.d.ts to figure out if stringWithFormat was supported, to no avail.
The nativescript community slack was unable to provide a resolution as well.
Please help if you can!
I don't know anything about NativeScript at all, but given the other code you wrote, I assume you're calling +alloc first, and so mean to use -initWithFormat: (an instance method that initializes) rather than +stringWithFormat: (a class method which handles allocation and initialization).

Delphi and TApro - Sending character to modem with new version of delphi not working right

I make a program in delphi 2007 that send and receive data throught a modem. I never had a problem with it. Now i had to make a new version of the program and use delphi XE2 but now, some data are not transmit correctly.
Here is part of the data that i send :
Lecture : array [0..12] of string =
(Chr($68)+Chr($23)+Chr($23)+Chr($68)+**Chr($80)+Chr($80)+**Chr($6C)+Chr($31)+Chr($31)+Chr($51)+Chr($00)+Chr($00)+Chr($1A)+Chr($32)+Chr($07)+Chr($00)+Chr($00)+Chr($00)+Chr($00)+Chr($00)+Chr($0C)+Chr($00)+Chr($04)+Chr($00)+Chr($01)+Chr($12)+Chr($08)+Chr($12)+Chr($48)+Chr($15)+Chr($00)+Chr($00)+Chr($00)+Chr($00)+Chr($00)+Chr($0A)+Chr($00)+Chr($00)+Chr($00)+Chr($16)+Chr($16)+Chr($E6)+Chr($EC),
I use ACP1.PutString(Lecture[0]+Lecture[1]+Lecture[2]+Lecture[3]+Lecture[4]);
to send the data and when i check the log of Apro, most character seem ok except chr($80) and higher. The extended ascii dont seem to translate correctly.
When i check the log, the character $80 is replace by $3F.
I know it is most probably a conversion problem between ansistring and unicode but I am unable to resolve it.

Adobe air on iOS - FileReference Download Error

When I use the Download method of the FileReference class, everything works fine on Desktop and Android, but I get an error on iOS.
This is the code:
var req = new URLRequest(url);
var localRef:FileReference = new FileReference();
localRef.download(req);
On iOS I'm getting an Alert:
Download Error
File downloads not supported.
I already tried to NavigateToUrl() and it asks save the file in Dropbox or another App.
How can I fix this error?
You shouldn't use FileReference on mobile (or AIR, in general, though it does open the Load/Save dialog on desktop so there can be some use there). You should instead use File and FileStream, which give you far more control over the file system.
In this case, you could try to use File.download() and save it to File.applicationStorageDirectory, but I don't know if it will have any difference since it extends FileReference.
What I generally do is use URLStream instead of URLLoader. It gives you access to the raw bytes of the file you are downloading and then use File and FileStream
So something like (and this is untested off the top of my head, though I have used similar in the past):
var urlStream:URLStream = new URLStream();
urlStream.addEventListener(Event.COMPLETE, completeHandler);
urlStream.load(new URLLoader('url');
function completeHandler(e:Event):void {
var bytes:ByteArray = new ByteArray();
urlStream.readBytes(bytes);
var f:File = File.applicationStorageDirectory.resolvePath('filename');
var fs:FileStream = new FileStream();
fs.open(f, FileMode.WRITE);
fs.writeBytes(bytes);
fs.close();
}
Now, obviously, there is a lot more you want to account for (errors, progress, etc). That should be enough to point you in the right direction, however.
It's possible to create a full download manager using this method (something I did for an iOS project two years ago), since you can save as-you-go to the file system rather than waiting until Event.COMPLETE fires (using the ProgressEvent.PROGRESS event). That allows you to avoid having a 500MB file in memory, something most devices can't handle.

Recover a PDF on iOS from a web service

I have a strange problem with my iOS application that calls a .NET web service to recover a PDF.
The web service does some stuff, and returns a PDF document as a reference of the web service (via an out parameter)
The iOS application call the web service, receives an answer and deals with the XML received.
To begin, the web service just returned a "simple" pdf (created in Word). I test my application and all was running well.
I was happy :). Then, I used Microsoft Report Viewer to really generate the PDF...
So I really implement my web service for create the PDF with ReportViewer (http://msdn.microsoft.com/en-us/library/ms251671(v=vs.80).aspx). The pdf generated was correct, I can open it on my server when it was generated. But when I receive the answer in the iOS application, I can't open it because it was corrupt.
Here is the difference of the XML I receive from the web service :
When I return the pdf generated with Word : http://pastie.org/7982815
When I return the pdf generated with ReportViewer : http://pastie.org/7982811
So the main difference is the image parameter that is one-part with the simple PDF and split with the ReportViewer PDF.
Actually I have no idea why the byte array is split as it, and I don't know what I could do to receive a valid PDF.
Once again, the PDF generated with ReportViewer is good, I can open it on the server, and when I send it by e-mail I can open it on my iPad. The problem comes when the web service returns me the PDF as a byte array...
The "split" image is actually an artifact of the web service trying to parse the image for line separators (ie 0d0a == carriage return / new line). If you're lucky, you can reassemble the image by taking each one of the records, including the 0d0a, and just concatenating them. This may be easier than fixing the real problem, which is that your web service is not sending you a single blob, but trying to parse an image into "lines".
It's ok, I solved my problem by concat all the data contains in the image array.
So, considering the XML I receive from the web service (http://pastie.org/7982811), here is my objective-c code to build the correct NSData (the pdf) :
NSMutableData *concatData = [NSMutableData data];
NSArray *partsData = [result objectForKey:#"image"];
for(NSDictionary *dicPdfDataLine in partsData) { // Foreach parts of data
NSArray *arrayPdfDataLine = [dicPdfDataLine allValues];
NSData *dataLine = [arrayPdfDataLine objectAtIndex:0]; // Get the NSData of the current part part
[concatData appendData:dataLine]; // Concat the data
}

Resources