Why can't I compile this sample?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Why can't I compile this sample?

Post 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
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: Why can't I compile this sample?

Post 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 ":".
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Why can't I compile this sample?

Post by mol »

I've solved this problem.
I should write:

Code: Select all

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

Thanks, Ricci
Post Reply