在尝试在 C# 和 flash 对象 (swf) 之间进行通信时,我遇到了以下异常。我尝试使用 Flash64_13_0_0_214.ocx 生成 2 个程序集 AxShockwaveFlash.dll 和 ShockwaveFlashObject.dll,然后我在一个控制台应用程序中测试我的代码。我的代码一般是这样的:
AxShockwaveFlash player = new AxShockwaveFlash();
player.CreateControl();
player.WMode = "transparent";
player.AllowScriptAccess = "sameDomain";
player.Loop = false;
player.LoadMovie(0, @"encrypt.swf");
点击 LoadMovie 后,我收到以下错误:
System.AccessViolationException 未处理 HResult=-2147467261 消息=尝试读取或写入受保护的内存。这通常表明其他内存已损坏。
Source=ShockwaveFlashObjects StackTrace:在 ShockwaveFlashObjects.IShockwaveFlash.LoadMovie(Int32 layer, String url) at AxShockwaveFlashObjects.AxShockwaveFlash.LoadMovie(Int32 layer, String url) in c:\Windows\System32\AxShockwaveFlashObjects.cs:line 685 at TestActionScript2.Program。 Main(String[] args) in c:\Something\trunk\Src\TestActionScript2\Program.cs:line 41 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly () 在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state,Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
请帮帮我~~