Red Gate forums :: View topic - Visio program problems
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 5
SmartAssembly 5 forum

Visio program problems

Search in SmartAssembly 5 forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
Roger Billsdon



Joined: 31 Jul 2010
Posts: 9
Location: Cambs, UK

PostPosted: Sat Jul 31, 2010 8:14 am    Post subject: Visio program problems Reply with quote

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
Back to top
View user's profile Send private message
slaphead99



Joined: 10 Mar 2010
Posts: 93

PostPosted: Mon Aug 02, 2010 12:17 pm    Post subject: Reply with quote

Thanks for your comprehensive explanation- its very helpful to us in trying to track down possible causes. I'm not aware of any further problems with Visio or Access assemblies but I'll do a more comprehensive support database search and see if there is a pattern to all of this.
Back to top
View user's profile Send private message
Roger Billsdon



Joined: 31 Jul 2010
Posts: 9
Location: Cambs, UK

PostPosted: Tue Aug 03, 2010 10:21 am    Post subject: Reply with quote

Hi all
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
Back to top
View user's profile Send private message
slaphead99



Joined: 10 Mar 2010
Posts: 93

PostPosted: Wed Aug 04, 2010 2:09 pm    Post subject: Reply with quote

As I was saying in your other post- I think the root of all the issue found may be reflection (or any other technology based on serialisation). What I didn't say was that, in addition to controlling exclusions via the GUI, you can also use declarations within your code - more information is here:


http://www.red-gate.com/supportcenter/Content.aspx?p=SmartAssembly&c=SmartAssembly/help/5.0/SA_UsingCustomAttributes.htm&toc=SmartAssembly/help/5.0/toc1032253.htm
Back to top
View user's profile Send private message
Roger Billsdon



Joined: 31 Jul 2010
Posts: 9
Location: Cambs, UK

PostPosted: Wed Aug 04, 2010 6:28 pm    Post subject: Reply with quote

Hi Slaphead
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
Back to top
View user's profile Send private message
slaphead99



Joined: 10 Mar 2010
Posts: 93

PostPosted: Fri Aug 06, 2010 2:39 pm    Post subject: Reply with quote

I only get to hear what people are doing when they get a problem and there don't seem to be many issues of this kind at all. I searched again and found one issue and that was due to merging a 3rd party dll into their assembly. Can you clarify what options you are using- specifically, perhaps, which options that change any 3rd party assembly. (I would generally dissuade anyone from doing anything with a 3rd party assembly- except to say embedding is usually benign).
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group