The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 error message: failed to find object during method
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

saschia

Slovak Republic
Posts

Posted - 05/07/2010 :  09:17:19 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin):
Operating System: Origin 7,0 Pro, SR4

Hi,

I am having problem with this script:

void AdjustImage (string ImgWksName, int ColFirst = 0, int ColLast = 15, int Delay = 12)
{ // line 66
string EdImgName = "Ed" + ImgWksName;
Worksheet EdImage;
Worksheet wksSource(ImgWksName);

EdImage.CreateCopy(wksSource, CREATE_VISIBLE_SAME); // line 71
EdImage.GetPage().Rename(EdImgName);

double Blank = CalculateBlank(EdImgName, ColFirst, ColLast);
foreach(Column ImgCol in EdImage.Columns)
{
Dataset ImgDs;
ImgDs.Attach(ImgCol);
ImgDs = ImgDs - Blank;
double F0 = CalculateF0(ImgDs, Delay);
ImgDs = ImgDs / F0;
}
}

The function compiles fine, linking is done, but when I run it from the script window, I get this message:

AdjustImage ("Data1", 0, 26, 24);
failed to find object during method call
failed to find object during method call
#Command Error!

And the compiler shows this message:

E:\Origin Files\Spike - primary analysis\uprava_obrazku.c(71) :Origin C Function Runtime Error, failed to find object during method call
E:\Origin Files\Spike - primary analysis\uprava_obrazku.c(66) :Origin C Function Runtime Error, failed to find object during method call

So I know that line 71 generates this error, but I cannot find the reason and I cannot find any relevant topic for this error message.

Thanks for advice!

Sasha

saschia

Slovak Republic
Posts

Posted - 05/07/2010 :  09:19:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sorry, Origin Version 7.0 Pro, SR4
OS version Windows XP, SP2
Go to Top of Page

Penn

China
644 Posts

Posted - 05/09/2010 :  10:01:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Sasha,

From the error information, a nonexistent object was using during calling this method. The error is come from line 71 in your issue. So, please make sure that the variable wksSource stands for a valid object (a worksheet), that is the worksheet named ImgWksName must exist.

Penn
Go to Top of Page

saschia

Slovak Republic
Posts

Posted - 05/10/2010 :  06:28:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Found the problem. Obvious, but hart to spot on Friday evening ;o).

I called the function with the space between the function name and the parentheses...



Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000