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
 2dfft runtime error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

chollinger

Germany
2 Posts

Posted - 06/05/2002 :  05:39:37 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I was trying to use the NAG-2dfft example. After some hours within wich it worked i now get a unknown error in the line:

int irows = matDataReal.GetNumRows();

with the additional line :

BOOL brt = matDataReal.Attach("Matrix1");
printf ("brt= %d",brt);

and declaring the matrix as:

Matrix(double) matDataReal;
(hm?! how can i put the other brackets in here ...?)

i can see that there seems to be no data attached to the matrix...

has anyone a clue what my problem is? i didn't made any other changes to the C-code (I think ...) and the 'Matrix1'-Window exists with the car-bmp in it wich is converted to gray and data...

maybe a problem with memory-allocation? but rebooting doesen't solve the problem...

Can anyone help me please ?!!!

easwar

USA
1965 Posts

Posted - 06/05/2002 :  10:19:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Did you make your change at the beginning of the file, by replacing the line:

Matrix matDataReal("Matrix1");

with the lines:

Matrix matDataReal;
bool brt = matDataReal.Attach("Matrix1");
printf ("brt= %d",brt);

If you did the change as above, that should work.

Did you change the Matrix1 data type to other than double (Menu item Matrix_>Set Properties)?

In any case, you should not have to reboot...try debugging the code by putting break points to see if the matrix attach statement works correctly...you should also see that with your print statement without debugging. If the print statement outputs a value different from 1, the attach statement did not succeed, and any reference to matDataReal after that can lead to a runtime error.

Easwar
OriginLab.


Edited by - easwar on 06/05/2002 10:21:45
Go to Top of Page

chollinger

Germany
2 Posts

Posted - 06/05/2002 :  11:14:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
i did it the way you described it and the output is brt=0!!
but.....
uups, while importing a new image the data type changed!!
Now it works!

Thanks for the help!!
Go to Top of Page

chollinger

Germany
2 Posts

Posted - 06/05/2002 :  11:17:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
you were right! the data type was changed and because of that the output of brt is 0!
now it works...

thanks for the help!!

christoph
Go to Top of Page

chollinger

Germany
2 Posts

Posted - 06/05/2002 :  11:19:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
you were right !
the data type was not set to double and because of that the output of brt was 0!!

now it works....

thanks for the help....

christoph
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