How to translate "call" to C# ?

Slawek W

How to translate "call" to C# ?

Hi everyone,

I try to translate litte code from VBA to C#
Example line VBA code:


call oManufacturingOperation.SetPattern(oManufacturingPattern)


This is method SetPattern in ManufacturingOperation object.
How to translate "call" to C#  ?
I can not skip "call" becouse without it I get error in VBA and C#. It has to be there.

Little Cthulhu

RE: How to translate "call" to C# ?
(in response to Slawek W)

Yes, you absolutely can and should skip "call" statement in C#.

Post your c# code and error that you're getting.

Slawek W

RE: How to translate "call" to C# ?
(in response to Little Cthulhu)

Thanks for answer!

I can not skip Call.

If I skip "Call" in VBA I get Run-time error '438': Object doesn't support this property or method.

And oManufacturingPattern is not conected to oManufacturingOperation.
The expected effect is only with "Call".


If I skip "Call" in C# in Visual Studio the error look like:
System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.

After that in Catia I get:
Manufacturing Error
Critical error: NULL handler.
Contact your local support.

Attachments

  • Error.jpg (15.9k)

Little Cthulhu

RE: How to translate "call" to C# ?
(in response to Slawek W)

Error has nothing to do with "call" statement, it's about code logics, both VBA and C#.

Again, post your C# and VBA code.