Jump to content
Software FX Community

Microsoft VBScript runtime error '800a01fb'


User (Legacy)

Recommended Posts

Hi I am getting this error:

An exception occurred: 'AddPicture'

/iroquois/utilization/test.asp, line 46

Here is the code:

<!-- Include these files so we can use all the ChartFX constants -->

<!-- #include virtual="/Include/CfxIE.inc" -->

<!-- #include virtual="/Include/CfxIECmds.inc" -->

<!-- #include virtual="/Include/CfxIEExtra.inc" -->

<SCRIPT LANGUAGE="VBScript">

<!--

Sub ChartFX1_UserCommand(wParam,lParam,nRes)

MsgBox "Custom Command"

End Sub

-->

</SCRIPT>

<%

Set chart = Server.CreateObject("ChartFX.WebServer.4")

' The samples look better in white

chart.RgbBk = RGB(255,255,255)

chart.Rgb2DBk = RGB(255,255,255)

' Open Communications channel for 1 series and 8 points

Chart.OpenDataEx COD_VALUES,1,8

Chart.ThisSerie=0

Chart.Value(0) = 10

Chart.Value(1) = 14

Chart.Value(2) = 12

Chart.Value(3) = 16

Chart.Value(4) = 8

Chart.Value(5) = 6

Chart.Value(6) = 32

Chart.Value(7) = 24

' Close the communications channel

Chart.CloseData COD_VALUES

'This code adds a predefined ChartFX button to the popup menu when the

user right clicks the background.

Chart.Commands(CFX_ID_CM_BACKGROUND).InsertSubCommands 1, 12

Chart.Commands(CFX_ID_CM_BACKGROUND).SubCommandID(12) =

CFX_ID_EXPORTBITMAP

'Load a 16x15 size bitmap to be used as a toolbar icon

'Please note that the image needs to have "Full Control" security for

IUser_MachineName

sPhysical = Server.MapPath("/Art/Samples/button.bmp")

Set Pict = Chart.LoadPicture(sPhysical)

'Create a New Command

Set NewCommand = Chart.Commands.AddCommand(100)

'Assing the bitmap icon to the new command

NewCommand.Picture = (Chart.Commands.AddPicture(Pict))

NewCommand.Text = "Custom Command"

' Add command to the toolbar and define it's position at the end

Chart.ToolBarObj.AddItems 1, 22

Chart.ToolBarObj(22).CommandID = 100

'Enable the chartfx toolbar

chart.toolbar = true

' Create Annotation Object to point to the new ToolBar Button

Set AnnotX = Server.CreateObject("AnnotationX.AnnList")

' Add Annotation List to ChartFX

Chart.AddExtension AnnotX

'Turn off the annotation toolbar

annotx.toolbar=false

Set r = AnnotX.Add(3)

r.Attach 1, cstr("9.15,32")

r.Width = 0

r.Height = -60

r.BkColor = RGB(255, 255, 0)

r.BorderWidth = 2

r.TailStyle = 0

r.HeadStyle = 1

%>

<%= chart.GetHtmlTag(500,350,"Auto","ChartFX1") %>

We are using CartFX ie2000 on win2K server

Link to comment
Share on other sites

We are unable to reproduce this problem using the latest SP.

The code you have produces the expected results when we run it here. We get

a button at the end of the toolbar with the custom image.

Please make sure that:

1) You are using the latest SP

2) The picture you are reading is the correct format. I tried with both

Bitmap 24-Bit color and Bitmap 256 colors and it worked fine

3) Make sure the picture is the correct size (Width = 16, Height = 15)

4) Make sure you have read permissions (as a web user) in the directory

where the picture file is.

--

FP

Software FX

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...