Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8087613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:50:03+00:00 2026-06-05T18:50:03+00:00

I know I should write this in Vb.net but for my own reasons I’m

  • 0

I know I should write this in Vb.net but for my own reasons I’m attempting late binding against a Com Object in C# .net framework 3.5. The error I’m getting is “DISP_E_BADCALLEE” and I’m only getting that based on when the copybacks I want are set to true. Am I dealing with a security issue? My research lead me to try dropping “[assembly: AllowPartiallyTrustedCallers()]” in the AssemblyInfo file but that didn’t do the trick. I dropped some details in a condensed version of the code below. It’s failing on the 4th step. I’d appreciate your help. Thanks.

                //step 1
        _atlDirectorObject = Activator.CreateInstance(Type.GetTypeFromProgID("atlDirectorObject.atlDirector"));
        //step 2
        object[] parms = { "3270", 1, true, true, 0, _atl3270Tool, _ErrMsg };
        Boolean[] CopyBack2 = new Boolean[7];
        CopyBack2[5] = true;  //atl3270Tool
        CopyBack2[6] = true;  //ErrMsg

        Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(_atlDirectorObject, _atlDirectorObject.GetType(), "CreateTool", parms, null, null, CopyBack2, false);
        _atl3270Tool = parms[5];


        //step 3
        // now using _atl3270Tool we navigate mainframe screens
        object[] parms3 = { Screen, SubScreen, _Number, _ErrMsg };
        Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(_atl3270Tool, _atl3270Tool.GetType(), "ShowScreen", parms3, null, null, null, false);

        //>>>>>>>>>>>>>>CODE FAILS ON THIS STEP<<<<<<<<<<<<
        //step 4
        Boolean[] CopyBack4 = new Boolean[5];
        CopyBack4[3] = true; //screentext
        CopyBack4[4] = true; //_errmsg
        object ScreenText = String.Empty;
        object[] parms4 = { Row, Col, Length, ScreenText, _ErrMsg};
        Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(_atl3270Tool, _atl3270Tool.GetType(), "ReadScreen", parms4, null, null, CopyBack4, false)

        // if it were working the code would read screen data into parms4[3] object
        // If CopyBack4[3 and/or 4] are set to true = error 
        // Is just CopyBack4[0,1,2] are true = no error but no result           
        //Errors out with "Invalid callee. (Exception from HRESULT: 0x80020010 (DISP_E_BADCALLEE))"


        return Convert.ToString(parms4[3]);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:50:05+00:00Added an answer on June 5, 2026 at 6:50 pm

    ScreenText should be set to null, not string.empty

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know how to use Quartz.dll in ASP.NET. Where should we write the
I know I should be able to solve this myself, but I've been banging
I know this should be a basic question but I am hitting a brick
I know I should do my homework on my own but I simply can't
I've recently started tinkering with ASP.NET MVC, but this question should apply to classic
This one should be simple, but I don't really know how to find a
I realize this is probably a fundamental thing I should know but I am
I know you should use a StringBuilder when concatenating strings but I was just
I know how to write a web-service but until now I used them with
I use asp.net 4 c# and ef4. I have this code, it should compile

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.