An exception occurred: 'LoadBitmap'
Moderators: helmut, XnTriq, xnview
An exception occurred: 'LoadBitmap'
Hi,
When i try to load a .jpg file in ASP with: .LoadBitmap sFile
I get this error message: An exception occurred: 'LoadBitmap'
The object is set with Set ctrl = server.createobject("GflAx.GflAx") and did work fine until recently.
I have no idea why, but i need it fixed.
Any suggestions?
When i try to load a .jpg file in ASP with: .LoadBitmap sFile
I get this error message: An exception occurred: 'LoadBitmap'
The object is set with Set ctrl = server.createobject("GflAx.GflAx") and did work fine until recently.
I have no idea why, but i need it fixed.
Any suggestions?
This is a function called AFTER a ranomization is done, with a global array called aBefore, and aUsers wich includes SID's (relevant to the path). The function returns x amount of linked pictures (with javascript calls) and checks that the picture isnt already loaded.
The error has accured once more since my last post. Again the IISRESET solved the problem temporary.
Please help!
Code: Select all
function getRandomizedPicture(nTime)
on error resume next
dim i
dim bBefore
dim fs
dim objFile
dim sFilePath
dim ctrl
Set ctrl = server.createobject("GflAx.GflAx")
Set fs=Server.CreateObject("Scripting.FileSystemObject")
bBefore = 0
nActiveSID = Int(Rnd*ubound(aUsers,2))
sPicture = aUsers(1,nActiveSID)
for i = 0 to ubound(aBefore)
if nActiveSID = aBefore(i) then
nTime = i
end if
next
if instr(lcase(sPicture), ".jpg") > 0 then
sPath = left(sPicture, instrrev(sPicture, "/"))
sPicture = right(sPicture, len(sPicture)-instrrev(sPicture, "/"))
sPicture = sPath & "_thumb_" & sPicture
sFilePath = replace(sPicture, "/", "\")
sFilePath = "C:\Inetpub\GenerationV\root" & sFilePath
if fs.FileExists(sFilePath) = true then
with ctrl
.LoadBitmap sFilePath
nWidth = nWidth + .Width + 4
if nWidth < 560 then
aBefore(nTime) = nActiveSID
getRandomizedPicture = "<a href=""javascript:parent.loadintoIframe('contens','" & sOthersLink & "&SID=" & aUsers(0,nActiveSID) & "')""><img src=""" & sPicture & """ height=""59"" border=""0"" class=""border"" hspace=""2"" vspace=""2""></a>"
else
exit function
end if
end with
else
getRandomizedPicture = getRandomizedPicture(nTime)
end if
else
getRandomizedPicture = getRandomizedPicture(nTime)
end if
Set fs= nothing
set ctrl=nothing
on error goto 0
end function
Please help!
Strange, you have only a LoadBitmap??? Which version do you use? The error occurs after x .LoadBitmap?nec wrote:This is a function called AFTER a ranomization is done, with a global array called aBefore, and aUsers wich includes SID's (relevant to the path). The function returns x amount of linked pictures (with javascript calls) and checks that the picture isnt already loaded.
The error has accured once more since my last post. Again the IISRESET solved the problem temporary.
Please help!
Pierre.
Do you use the last version?nec wrote:No, the error is called WHEN the .LoadBitmap sFilePath is executed.
The other call to the ctrl object is the nWidth = nWidth + .Width + 4 call. The function returns a HTML string of pictures that all together doesnt exeed 560px width. It also checks that the active picture isnt already included.
Pierre.
I'm still experiencing the same problem.
Once a day or something the component seems to crash the IIS aswell.
Maybe i should tell you that i use the code above on the start page of the web - and that the .width param is accessed 20 times each time a user logs on. Could there be some kinda memory problem?
Once a day or something the component seems to crash the IIS aswell.
Maybe i should tell you that i use the code above on the start page of the web - and that the .width param is accessed 20 times each time a user logs on. Could there be some kinda memory problem?
.Width is only a property, LoadBitmap occurs only one time. Do you use now the last v2.20?Anonymous wrote:I'm still experiencing the same problem.
Once a day or something the component seems to crash the IIS aswell.
Maybe i should tell you that i use the code above on the start page of the web - and that the .width param is accessed 20 times each time a user logs on. Could there be some kinda memory problem?
Pierre.