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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 error message: failed to find object during method

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
saschia Posted - 05/07/2010 : 09:17:19 AM
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
3   L A T E S T    R E P L I E S    (Newest First)
saschia Posted - 05/10/2010 : 06:28:50 AM
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...



Penn Posted - 05/09/2010 : 10:01:22 PM
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
saschia Posted - 05/07/2010 : 09:19:40 AM
Sorry, Origin Version 7.0 Pro, SR4
OS version Windows XP, SP2

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000