Visio program problems
Roger Billsdon
Posts: 14
There seems to be some problems with Smart Assembly and certain aspects of Microsoft Visio and Access interop. I’m programming using VB2010 and Visio 2007 and at present I’m testing on Windows XP 32 bit.
If the program is protected using the SmartAssembly defaults all is well. However, I need to be able to decode StackTraces and when the SmartAssembly check box that allows access to the “obfuscate using ASCII characters†is checked, the obfuscated program crashes with the error “could not load type Microsoft.Office.Interop.Visio.EApplication_Event from assemblyâ€. (A similar error occurs when using Microsoft Access interop.)
I’ve found this error can be worked around by adding Microsoft.Office.Interop.Visio to the SmartAssembly exclusion list.
I’ve also found that the Visio select shape method fails in certain circumstances. It throws an error: "Specified cast is not valid" and fails to select a shape. Unfortunately I haven’t been able to reproduce this problem in a small test program, but in the main program I’m currently testing I’ve found that setting the Visio ShowChanges property to false, cures the problem.
I obtained SmartAssembly earlier this week and have only just started testing. While I’m happy to use these work-arounds I’m a little concerned that other similar problems might emerge with more testing. Therefore, I was wondering if anyone could shed any light on what might be causing these problems and if there were any useful pointers that might help guide me.
Sorry for the long-winded explanation, but any help would be much appreciated.
Best regards
Roger
If the program is protected using the SmartAssembly defaults all is well. However, I need to be able to decode StackTraces and when the SmartAssembly check box that allows access to the “obfuscate using ASCII characters†is checked, the obfuscated program crashes with the error “could not load type Microsoft.Office.Interop.Visio.EApplication_Event from assemblyâ€. (A similar error occurs when using Microsoft Access interop.)
I’ve found this error can be worked around by adding Microsoft.Office.Interop.Visio to the SmartAssembly exclusion list.
I’ve also found that the Visio select shape method fails in certain circumstances. It throws an error: "Specified cast is not valid" and fails to select a shape. Unfortunately I haven’t been able to reproduce this problem in a small test program, but in the main program I’m currently testing I’ve found that setting the Visio ShowChanges property to false, cures the problem.
I obtained SmartAssembly earlier this week and have only just started testing. While I’m happy to use these work-arounds I’m a little concerned that other similar problems might emerge with more testing. Therefore, I was wondering if anyone could shed any light on what might be causing these problems and if there were any useful pointers that might help guide me.
Sorry for the long-winded explanation, but any help would be much appreciated.
Best regards
Roger
Comments
Having done some more testing it now seems that simply setting the Visio ShowChanges property to false doesn't always cure the problem with the Select method. Something curious is clearly going on.
Slaphead99: Did you find anything in your support database in relation to this specific type of problem or more generally with SmartAssembly obfuscation of programs that use interop to work with any of the Microsoft Office programs or, indeed, any program that use any COM interop?
Many thanks
Roger
http://www.red-gate.com/supportcenter/C ... 032253.htm
As far as I'm aware the program I’m testing doesn't use reflection or serialisation.
It does use Microsoft.Office.Interop.Visio which I believe is basically the same COM interop technology as is used to program against the other Microsoft Office products including Access, Word, Excel, etc. Does this Microsoft Office or COM interop technology use reflection or serialisation?
As I've excluded Microsoft.Office.Interop.Visio from both obfuscation and pruning I thought that would have excluded all the Visio methods and have obviated the need for adding attributes anywhere else in the program where the Visio methods are called? Because calls to the Visio API are littered throughout this program I can’t believe that would be necessary because the problems seem to be limited to only a few Visio methods like Select and Layer.Add.
Does anyone use SmartAssembly to obfuscate programs that use interop for Visio or for any of the other Microsoft Office programs or, failing that, any COM interop? If so, are there any guidelines that would help me narrow down the Visio methods that I need to test for problems and do they have any helpful hints or pointers for solutions, etc?
Many thanks
Roger