MCA Integration with Microsoft Office Applications?

MCA Integration with Microsoft Office Applications?

Morning,

I'm working on developing some Infopath 2007 forms that would require barcodes to be scanned to get values from a DB based on the ID of the barcode.. pretty simple stuff.

However, from what i can find on the web, through the documentation and otherwise, and forgive me if i seem a little new to this, but the application, after writing the code and going to test the application, will not allow me to activate the barcode scanner, and it complains about how the assembly cannot be run in partial trust, rather, the assembly does not accept calls from partially trusted sources. Is this error referencing Intel.Healthcare or my Office application? I'm unsure..

Are there any ActiveX objects that could be used in place of custom code? Are there any workarounds for this particular error? I've been searching for a while now and, Unfortunately, have been coming up short. In most cases, it's folks with asp.net custom assemblies, and I haven't yet seen someone try to use the MCA with office applications.

Thanks in advance for any help.

-L

8 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

Hi LandonGN,

The error message does not look familiar to me. Could you send us the exact error message text? Also, can you send us the MCA log file from when the error occurs? Here are the steps to capture it

1. Open the MCA configuration file (C:Program FilesIntelMCABinIntelHealthcare.cfg) in Notepad

2. Set the log file to debug mode by setting the following configuration parameter:

/Intel/HealthcareSDK/Logging/DefaultLevel = DEBUG

3. Save the MCA configuration file and exit from Notepad

4. Delete the existing MCA log file (C:TempMCA.log). A new log file will be created automatically on the next event.

5. Reproduce the failure

6. Save the MCA log file

7. Optional, but you may want to go back into the MCA configuration file now at set the logging level back to WARN.

Once you have the log file saved you can take a look at it an see if there is any info in there that will help you determine where the failure is occurring. If there is not anything that stands out to you, then please send me the log file and your code and our developers can take a look at it.

Thanks,

Steve

Steve,

Thanks for the reply. Here's the actual exception i'm getting.

System.Security.SecurityException
That assembly does not allow partially trusted callers.
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at NellisQC.FormCode.CTRL294_5_Clicked(Object sender, ClickedEventArgs e)
at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

Also, here are a few images of the actual method call (that creates the barcodereader object and the barcode object and starts the scan.. taken directly from the SDK examples) (unfortunately, there is some proprietary information within the form and the code that i can't share. )

http://caglink.com/images/securityexception1.png
http://caglink.com/images/securityexception2.png

The easiest way to test this would be to open a new infopath form, add a 'button' control, and have it's action be programmatic. That's literally all i've done.

Thanks for the help.

-L

Also, just in case, i've added the intel.healthcare.dll into the GAC, and i've tried signing the form, i've tried using a call such as

[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]

But to no avail.. it seems nobody has tried using the MCA with infopath before, because information on the web is rather scarce on the subject.

Thanks again.

-L

Hi LandonGN,

I am checking into this now. As far as I know, we have not tested this with InfoPath so I am not sure what interoperabilityconcerns there may be. I'llupdate you shortly.

Thanks,

Steve

Hi Langdon,

Unfortunately I am not going to be able to help you with this. We have not tested the MCA software with InfoPath, and nobody on our development team has any experience with it. Maybe some of the other developers on the forum will be able to offer you some suggestions.

-Steve

Steve,

Actually, i was able to figure it out.

Code actions in the office system require that full trust be in place if you are using any sort of custom code. Unfortunately, while my code was correct and the security on my application and assembly were strong-key signed, i had forgot to set the security level of the actual infopath form to full trust, so when i had published it, it was, obviously, incorrectly secured.

Silly, yes, but hey, it works!

Thanks.

-L

Thanks LandonGN for letting me know you got it working. Good job figuring it out on your own.

-Steve

Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied? Jetzt teilnehmen