xsharp.eu • VO AnimationControl OpenResouce()
Page 1 of 2

VO AnimationControl OpenResouce()

Posted: Thu May 30, 2019 7:32 am
by leighproman
Hi

Does anyone have an example of using the VO AnimationControl in X# ?

In VO we used a modified version of the AnimateDialog class by John Marshall.
A cut-down bit of the code:

Code: Select all

PARTIAL CLASS AnimateDialog INHERIT DIALOGWINDOW 

	PROTECT oDCFixedText1 AS FIXEDTEXT
	PROTECT ocAnimate 	AS AnimationControl

METHOD PreInit 
	// Get instance handle of SHELL32.DLL
	SELF:hShell := LoadLibrary(String2PSZ("SHELL32.DLL"))


METHOD PostInit 

	SELF:oCAnimate := AnimationControl{SELF, ANIMATE_ANIMATE, SELF:oDCFixedText1:Origin,;
							SELF:oDCFixedText1:Size,, _OR(WS_CHILD,ACS_CENTER,ACS_TRANSPARENT,ACS_AUTOPLAY),;
							SELF:hShell}
	SELF:oDCFixedText1:Hide()

	// 161 == folder to folder (1 page)
	SELF:oCAnimate:OpenResource( 161 )
This generates a Runtime Data Type error (33) at the OpenResource() line - see screenshot.

How should OpenResouce() be called in X# ?

Thanks

Leigh

VO AnimationControl OpenResouce()

Posted: Thu May 30, 2019 7:58 am
by lumberjack
Hi Leigh,
leighproman wrote: Does anyone have an example of using the VO AnimationControl in X# ?
This generates a Runtime Data Type error (33) at the OpenResource() line - see screenshot.
How should OpenResouce() be called in X# ?
Your error message say Vulcan.NET. Are you actually compiling with X#?

VO AnimationControl OpenResouce()

Posted: Thu May 30, 2019 8:04 am
by leighproman
Using Vulcan runtime.

VO AnimationControl OpenResouce()

Posted: Thu May 30, 2019 8:14 am
by Chris
Hi Leigh,

It's very hard to say, without knowing how the control works, what params it takes etc. I assume you have the source code to it, so can you please create a small standalone sample in VO that uses it, will the full code needed, make sure it compiles and runs fine in VO, then export and send me the .aef to have a look/try to port it in X#?

VO AnimationControl OpenResouce()

Posted: Thu May 30, 2019 8:27 am
by leighproman
I don't have the source code for the control - its the VO AnimationControl class.
Can make an AEF though.

VO AnimationControl OpenResouce()

Posted: Thu May 30, 2019 11:10 am
by Karl-Heinz
Hi Chris,

the attached ( x# runtime ) viaef shows the "conversion Error from USUAL (LONGINT) to PSZ" when i try to open a AVI resource from a DLL.. The sample uses the AVI resource 16935 from the "ieframe.dll"

Code: Select all

oAnimation1:OpenResource(16935)  // <------- crash
regards
Karl-Heinz

VO AnimationControl OpenResouce()

Posted: Thu May 30, 2019 12:26 pm
by Chris
Guys,

Ah, the obvious answer is usually the correct one, I was for some reason thinking of an exotic 3rd party control :)
Karl-Heinz, thanks for the .viaef, but I would really like to have the VO version first, to make sure it works well in it, then run them side by side the VO/X# versions to be able to debug what and where fails.

TIA!

VO AnimationControl OpenResouce()

Posted: Thu May 30, 2019 12:59 pm
by Karl-Heinz
Chris wrote:Guys,

I would really like to have the VO version first, to make sure it works well in it, then run them side by side the VO/X# versions to be able to debug what and where fails.
Hi Chris,

beleave me, there are even things that work OOTB in VO ;-)

BTW I: . In newer win versions the shell32.dll doesn ´t contain avi resources any longer. That´s the reason why i selected the "ieframe.dll" and the resource no. 16935.

BTW II: attached is the aviApp.zip

BTW III: adding AEF to the allowed extension would be nice.

regards
Karl-Heinz

VO AnimationControl OpenResouce()

Posted: Thu May 30, 2019 1:07 pm
by Chris
Guys,

Thanks a lot for the help in tracking this down, well I am very surprised indeed, but this does work well in .Net just fine! Problem is in the VOGUI SDK code, where it casts the resource number to a PSZ, which of course does not make sense and we will fix it for the next build. For now, it should work (at least it does here) when you change the code from

SELF:ocAnimate:OpenResource( 161 )

to

Animate_Open(SELF:ocAnimate:Handle(), PTR(161))

hth!

VO AnimationControl OpenResouce()

Posted: Thu May 30, 2019 1:34 pm
by leighproman
Thanks Chris - that works for me.