Activex Sample

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5477
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Activex Sample

Post by Rathinagiri »

Yes! Fantastic. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: Activex Sample

Post by luisvasquezcl »

Hi Esgici
do you have install openoffice?.
I Try to open a document .swx and i can not.
regards
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Activex Sample

Post 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
Viva INTERNATIONAL HMG :D
User avatar
Rathinagiri
Posts: 5477
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Activex Sample

Post by Rathinagiri »

I am using OpenOffice.org 2.4 version. I can open .ods .odt (open document spreadsheet/text) easily.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Rathinagiri
Posts: 5477
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Activex Sample

Post 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
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Post Reply