• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[vb.net] RPC Error - for each loop

Guest
Apr 21, 2011 Apr 21, 2011

Copy link to clipboard

Copied

Hi,

I am using CS5 Indesign Interop in vb.net to process.

In some cases, I am getting RPC Error. I tried with vs 2005 and vs 2008 with CS5 and result is the same.

On exploring it was found that, RPC error occurs while using the 'for each loop' instead of 'for loop'. This looks strange because it works for some cases and also fails in some cases.

I tried with different system, cleared the profile and the result is the same.

I have given the error below what I got:

The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)

   at System.Runtime.InteropServices.CustomMarshalers.EnumeratorViewOfEnumVariant.MoveNext()

Is there any way to solve/fix this problem?

Thanks.

TOPICS
Scripting

Views

2.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 21, 2011 Apr 21, 2011

Copy link to clipboard

Copied

I had the same error today using C#.  The workaround was to replace all foreach loops with For loops.

Hope this helps,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 23, 2014 Feb 23, 2014

Copy link to clipboard

Copied

@Hemachandiran and @amorinaj --

I know that this is an old thread, but I thought that it may be appropriate to update it with some new (not so great) news...

I am running VS2013, W7, InDesign CS6 on MSSQL2008R2. Beating myself up over the last day with this same error:

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in CustomMarshalers.dll

(Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))

As of the writing of this post, the only apparent workaround is what you have described above - to replace for/each loops with for/next loops.

Hope this continues to help someone...

Best regards,

-TT

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 26, 2016 Sep 26, 2016

Copy link to clipboard

Copied

LATEST

"As of the writing of this post, the only apparent workaround is what you have described above - to replace for/each loops with for/next loops.

Hope this continues to help someone..."

--> Change all [for/each loops] by [for/next loops] in Project?

Or only change [for/each loops]  of Objects of Indesign?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines