cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Component problem

RichardJ
19-Tanzanite

Component problem

I can't decide if I have a problem with my system or this is a bug in Mathcad, or something else.

Load the attached file, and point it to a bitmap. It should load OK. If you change the bitmap it will load the new one OK. But if I click on the component I get an error message "Failed to Connect. Link may be Broken". Do other people also see this problem?

Thanks
Richard
9 REPLIES 9
RichardJ
19-Tanzanite
(To:RichardJ)

Sorry about the size folks. I used a largish image as an example when I was playing with it, and forgot it would store it inside the component. Still, you get a nice picture of the Hong Kong skyline taken from a hotel room window 🙂

Richard
PhilipOakley
5-Regular Member
(To:RichardJ)

I see it in V11.2a.

Philip Oakley

Thanks. I see it in 11 and 14. I'm not sure if it's good news or bad that you see it. On the upside, I know my system isn't broken. On the downside, this throws a big wrench/spanner in the works of something I'm trying to do. If it's a Mathcad problem, I can't see a way round it 😞

FYI, the control is the MS Forms 2.0 Image viewer. It works fine when I use it in a small VBA app built in Excel.

Richard

It fails on my system. But then, that is somewhat expected as I don't have the file "c:\hong kong.jpg" on my system.
__________________
� � � � Tom Gutman
RichardJ
19-Tanzanite
(To:TomGutman)

On 7/28/2009 5:00:52 PM, Tom_Gutman wrote:
> But
>then, that is somewhat
>expected as I don't have the
>file "c:\hong kong.jpg" on my
>system.

That doesn't matter. Change the file to one you do have. Or even go into the script and delete all the code in the EventExec, so it does nothing. On my system it still fails.

Richard


dfehr
1-Newbie
(To:RichardJ)

Using Mathcad 14 M030

When I open your worksheet I get a the following error in a popup window:

"Microsoft VBScript runtime error. Line: 10 Error: 0 File name or class name not found during Automation operation: 'LoadPicture'"

Error due to the image file not being on my system???

Your picture appears to display OK.

If I try to change the image file via redefining MyPicture, I get "Error HRESULT E_FAIL has been returned from a call to a COM component.

If I click on the image I get a pop-up error message: "Failed to connect. Link my be broken"

DJF
PhilipOakley
5-Regular Member
(To:dfehr)

I'm guessing that the component keeps a copy of the original image, and a link to that original image.
Thus the sheet starts up OK with the stored copy,
but when you click on it it wants to go to the
original, which isn't where it thought, hence 'link
broken'.

Any other guesses?
Philip Oakley

On 7/29/2009 4:01:08 PM, philipoakley wrote:
>I'm guessing that the
>component keeps a copy of the
>original image,

Yes, it does

>and a link to
>that original image.

I'm not sure about that.

>Thus the sheet starts up OK
>with the stored copy,
>but when you click on it it
>wants to go to the
>original, which isn't where it
>thought, hence 'link
>broken'.

Sorry, but that's not it. I'm sure the error message is referring to a broken ODE link of some sort, not the "link" to the picture. Point it to an image you do have, save the worksheet, then close and reopen it. The image will load fine. Then click on the picture, and you will get the error.

FYI, The reason for my interest is this very nice graphing widget:

http://www.advsofteng.com/

It has a graphing component available that is an extension of the MS VB image control. I can't get the component to work properly though, and I am sure that's because the image control itself has this problem in Mathcad. I can get both the VB image control and the ChartDirector control to work fine in a VBA program in Excel.

It's a pity, because this looked like it was going to be a path to programmable (and even interactive) graphs (did I just hear Stuart turning over in his sleep?). There is a huge suite of highly customizable graphs available. Oh well.

Richard
RichardJ
19-Tanzanite
(To:dfehr)

On 7/29/2009 1:13:30 PM, djfehr wrote:
>Using Mathcad 14 M030
>
>When I open your worksheet I
>get a the following error in a
>popup window:
>
>"Microsoft VBScript runtime
>error. Line: 10 Error: 0 File
>name or class name not found
>during Automation operation:
>'LoadPicture'"
>
>Error due to the image file
>not being on my system???

I see the same thing if the file is not there. It's a strange error message, because if the file is there (just point it to an image you do have, save the worksheet, then close and reopen it) the image loads fine. So obviously it can find the class name for the LoadPicture operation.

>Your picture appears to
>display OK.
>
>If I try to change the image
>file via redefining MyPicture,
>I get "Error HRESULT E_FAIL
>has been returned from a call
>to a COM component.

That's an oddity of scripted components in general. Once they fail, you can continue to get this error even if you fix the problem.

>If I click on the image I get
>a pop-up error message:
>"Failed to connect. Link my be
>broken"

Right. Thanks. I always see this, even when the image loaded OK.

Richard
Top Tags