Page 1 of 1

Why can't I compile this sample?

Posted: Wed Jan 20, 2010 9:43 pm
by mol
Hey guys, help me please!
I've modified a little activex.7 sample to try to use my activex control for programming elecronic cash.
But, error occurs during compilation.
I have no idea what's wrong...

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()

	DEFINE WINDOW WinMain ;
		AT 0,0 ;
		WIDTH 800 ;
		HEIGHT 500 ;
		TITLE 'HMG ActiveX Support Demo' ;
		MAIN 

		DEFINE MAIN MENU
			POPUP "Test"
				MENUITEM "Testuj activex" ACTION Test()
			END POPUP 			
		END MENU

		DEFINE ACTIVEX Kontrolka
			ROW 10
			COL 50
			WIDTH 700  
			HEIGHT 400  
			PROGID "OICECRLIB"  
		END ACTIVEX

	END WINDOW

	Center Window WinMain

	Activate Window WinMain

RETURN NIL

Procedure Test()

	WinMain.Kontrolka:ChangeDevice(ecrdtCommDevice)
	WinMain.Kontrolka.CommOptions:Port := 'COM1'
	WinMain.Kontrolka:CommOptions:Speed := 9600
	WinMain.Kontrolka:CommOptions:DataBits := 8
	WinMain.Kontrolka:CommOptions:StopBits := 1
	WinMain.Kontrolka:CommOptions:Parity := ecrptNone
	WinMain.Kontrolka:CommOptions:TimeOut := 20000
	WinMain.Kontrolka:CommOptions:WaitTimeOut := 300000
	WinMain.Kontrolka:CommOptions:FlowControl := ecrfcRTS_CTS
Return

Re: Why can't I compile this sample?

Posted: Thu Jan 21, 2010 8:28 am
by Ricci
mol wrote: WinMain.Kontrolka:ChangeDevice(ecrdtCommDevice)
WinMain.Kontrolka.CommOptions:Port := 'COM1'
WinMain.Kontrolka:CommOptions:Speed := 9600
Look at the 2nd row, there you use a "." instead of ":".

Re: Why can't I compile this sample?

Posted: Thu Jan 21, 2010 10:28 am
by mol
I've solved this problem.
I should write:

Code: Select all

WinMain.Kontrolka.Object:ChangeDevice(ecrdtCommDevice)
The difference is: Object

Thanks, Ricci