Page 1 of 2

An exception occurred: 'LoadBitmap'

Posted: Fri Oct 22, 2004 4:35 pm
by nec
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?

Posted: Fri Oct 22, 2004 4:59 pm
by nec
The call worked after a IISRESET, but its kinda scary that it came up at all...
Does anyone know what it was?

Posted: Sat Oct 23, 2004 3:44 pm
by xnview
nec wrote:The call worked after a IISRESET, but its kinda scary that it came up at all...
Does anyone know what it was?
Could you send me the picture that you load?

Posted: Thu Oct 28, 2004 8:38 am
by nec
It was a whole bunch of pictures,
All .jpg

They work now, but im still curious of why this happened.

Posted: Fri Oct 29, 2004 12:45 pm
by nec
Hmm, now it happened again.
I have no idea whu.
Works after a IISRESET.


Please help me out.

Posted: Fri Oct 29, 2004 2:10 pm
by xnview
nec wrote:Hmm, now it happened again.
I have no idea whu.
Works after a IISRESET.
Could you show me more about your script?

Posted: Sat Oct 30, 2004 12:28 am
by nec
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.

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
The error has accured once more since my last post. Again the IISRESET solved the problem temporary.

Please help!

Posted: Sat Oct 30, 2004 11:40 am
by xnview
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!
Strange, you have only a LoadBitmap??? Which version do you use? The error occurs after x .LoadBitmap?

Posted: Sat Oct 30, 2004 4:50 pm
by nec
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.

Posted: Tue Nov 02, 2004 8:36 am
by xnview
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.
Do you use the last version?

Posted: Wed Nov 03, 2004 2:17 pm
by nec
No, i had the 2.01 version installed.
I've updated it.

I'll be back if i run into further problems.

Thanks for the help.

Posted: Fri Nov 05, 2004 10:31 am
by Guest
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?

Posted: Fri Nov 05, 2004 10:32 am
by nec
that was nec of course.

Posted: Fri Nov 05, 2004 11:53 am
by xnview
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?
.Width is only a property, LoadBitmap occurs only one time. Do you use now the last v2.20?

Posted: Sat Nov 06, 2004 7:24 pm
by nec
Yes.
Now it hung again - with the errormessage above...