Page 2 of 2

Re: Activex Sample

Posted: Tue Sep 09, 2008 6:37 pm
by Rathinagiri
Yes! Fantastic. :)

Re: Activex Sample

Posted: Tue Sep 09, 2008 9:30 pm
by luisvasquezcl
Hi Esgici
do you have install openoffice?.
I Try to open a document .swx and i can not.
regards

Re: Activex Sample

Posted: Tue Sep 09, 2008 10:33 pm
by esgici
luisvasquezcl wrote:do you have install openoffice?.
Hola Luis

Of course !

Without proper program IE does can't anything.

f.e. if MS-Office not installed we also can't open word, excel... etc files with Activex control.

In fact IE too calls appropriate program for open files.

Saludos

--

esgici

Re: Activex Sample

Posted: Wed Sep 10, 2008 3:12 am
by Rathinagiri
I am using OpenOffice.org 2.4 version. I can open .ods .odt (open document spreadsheet/text) easily.

Re: Activex Sample

Posted: Wed Sep 10, 2008 7:46 am
by Rathinagiri
When in modal window, the above sample gives error and breaks in the middle if nothing is opened and just closed. For example, compile the following code and enter the modal window by clicking "click here" and just close the window by either clicking [x] or clicking menu 'test -> exit'

Code: Select all


/*
 * MINIGUI - Harbour Win32 GUI library Demo
 *
 * Copyright 2002-2008 Roberto Lopez <harbourminigui@gmail.com>
 * http://harbourminigui.googlepages.com/
 * Activex Sample: Inspired by Freewin Activex inplementation by
 * Oscar Joel Lira Lira (http://sourceforge.net/projects/freewin).
*/

#include "minigui.ch"

FUNCTION Main()
	Public lOpen := .F.
	define window win2 at 0,0 width 800 height 500 main
	   define button activex
	      row 10
	      col 10
	      width 80
	      caption "Click Here"
	      action modalactivex()
           end button
	end window
	win2.center
	win2.activate()
	return nil
	
function modalactivex

	DEFINE WINDOW Win1 ;
		AT 0,0 ;
		WIDTH 800 ;
		HEIGHT 500 ;
		TITLE 'HMG ActiveX Support Demo' ;
		modal ;
		ON PAINT ( 	Win1.Test.Width	:= Win1.Width - 28,;
					Win1.Test.Height:= Win1.Height- 95 )

		DEFINE MAIN MENU
			POPUP "Test"
				MENUITEM "Open file" ACTION Test()
				MENUITEM "Close file" ACTION Win1.Test.Object:Navigate("about:blank")
				SEPARATOR
				MENUITEM "Exit" ACTION Win1.Release
			END POPUP
		END MENU

		DEFINE LABEL LABEL_1
			ROW 0
			COL 10
			WIDTH 80
			HEIGHT 24
			VALUE "Http:"
		END LABEL
		
		DEFINE TEXTBOX TEXT_1
			ROW 0
			COL 100
			WIDTH 300
			HEIGHT 24
			VALUE ""
		END TEXTBOX
			
		DEFINE BUTTON BTN_1
			ROW 0
			COL 400
			WIDTH 24
			HEIGHT 24
			CAPTION "Go"
			ACTION Win1.Test.Object:Navigate( Win1.Text_1.Value )
		END BUTTON

		DEFINE ACTIVEX Test
			ROW 		30
			COL 		10
			WIDTH 		700  
			HEIGHT 		380
			PROGID 		"shell.explorer.2"
		END ACTIVEX

	END WINDOW

	Center Window Win1

	Activate Window Win1

RETURN NIL

Procedure Test()
	local cFile := GetFile({{'Excel','*.xls'},;
							{'Word','*.doc'},;
							{'PowerPoint','*.ppt'},;
							{'All files','*.*'}})
	
	if Len( cFile ) > 0
		Win1.Test.Object:Navigate( cFile )
		//Win1.Title := Win1.Test.Object:Document:Name
	else
		Win1.Test.Object:Navigate( "about:blank" )
	endif
Return