Results 1 to 2 of 2

Thread: int to ref object error

  1. #1

    Thread Starter
    Hyperactive Member Sneeden's Avatar
    Join Date
    Oct 2001
    Location
    Sneedville
    Posts
    258

    int to ref object error

    I am trying to call a function from an activex control that I have imported. It was written in VB6. When I am calling the function in c#, the signature shows as:

    Code:
    axBIBDisplay1(ref object xsockets, ref object ysockets)
    In VB, it just accepts int values. In c# I am calling it like this:
    Code:
    int x=12;
    int y=12;
    axBIBDisplay(ref (object) x, ref (object) y);
    I am still getting the error:
    "A ref or out arguement must be an lvalue"

    What do I need to do?
    balls deep in bad code

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    Re: int to ref object error

    a ref parameter indicate that the value may change
    with your code where is it going to put that change?
    Code:
    int x=12;
    int y=12;
    axBIBDisplay(ref (object) x, ref (object) y);
    try
    Code:
    int x = 12;
    int y = 12;
    object objX = (object)x;
    object objY = (object)y;
    
    axBIBDisplay(ref objX, ref objY);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width