How To Help Clipper & Foxpro Users Catch Harbour-HMG ASAP!

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

User avatar
Clip2Mania
Posts: 99
Joined: Fri Jun 13, 2014 7:16 am
Location: Belgium

Re: How To Help Clipper & Foxpro Users Catch Harbour-HMG ASA

Post by Clip2Mania »

2) How to avoid one app/EXE is double-run by users in the same computer? This problem never arise under DOS who own a single window. I noticed when execercising HMG-ID (executing IDE.EXE) to build project, the RUN (F5) function fails to detect the problem. that's way HMG-IDE made runtime error as if the mistake came from source program.
SET MULTIPLE ?
(or in this case: SET MULTIPLE OFF WARNING ... ?)
User avatar
Agil Abdullah
Posts: 204
Joined: Mon Aug 25, 2014 11:57 am
Location: Jakarta, Indonesia
Contact:

Re: How To Help Clipper & Foxpro Users Catch Harbour-HMG ASA

Post by Agil Abdullah »

Rathinagiri said:

Clipper programmers sometimes find it difficult to accommodate with HMG. The reason is the difference between TUI (Text User Interface) and GUI. In GUI, the program control is in the hands of the user and it is event driven. User can click on anything (say minimize button, maximize button, even another program running behind or any controls). So, it is our duty to design the whole window and wait for user's action and write procedures for each and every action of the user.

GUI offers many innovative controls like Grid, Combobox, Button, Spinner etc., as against only textbox in TUI. So, we have to eventually accommodate events for all these controls.

Now, coming to HMG as not only a GUI library but a bundle of all. Even though HMG is directly based on the latest Harbour versions, HMG comes as a bundle. You need not install any other software to build a windows application. Full stop. :) It contains the GUI library, PRG compiler, C Compiler and all the supporting software products to successfully build an application.

will continue...

...continuation to my previous post...

People (at least me) sometimes misunderstand GUI and OOP as one and the same. GUI and OOP are different and independent to each other. GUI can be made to work with or without OOP and vice versa. HMG is based on Win32 API system. Win32 API system works on handles and hooks. Every window/control in HMG is provided with a handle (like the file handle in clipper) and events are hooked on that particular handle. Once any hooked event is fired by the user (say a click of a button) immediately Win32 API searches for a CallBack function which is provided by the developer via HMG. The beauty of HMG would be, the developer is made free from handling all these internal affairs, handles, hooks and callback procedures. Instead he can concentrate on what is to be done if the event is fired.

You will be astonished to see how a 'define window' statement in HMG invokes 100s of lines of Harbour and C code. Please see the source folder of HMG if you want to know in detail.

Again, the advantage of HMG is, you need not include any dlls with your executable code as it is based on Win32 API. The application would run in XP to Windows version 8 (even in Windows 97 some cases).

... will continue.

Noted and highly appreciated.

Regards
Agil Abdullah Albatati (just call me Agil)
Programmer Never Surrender
User avatar
Agil Abdullah
Posts: 204
Joined: Mon Aug 25, 2014 11:57 am
Location: Jakarta, Indonesia
Contact:

Re: How To Help Clipper & Foxpro Users Catch Harbour-HMG ASA

Post by Agil Abdullah »

Rathinagiri said:

...continuation to my previous post...

Now coming to your questions.

1] You can start with Your HMG Directory\SAMPLES\Basics\TUTORIAL folder. It contains various tutorials for basic programmers. Then you can see basic and controls sub-folders of samples. I don't think that any advanced skill set is required to satisfy our existing DOS clients. Actually ther will be happy to update their programs to Windows version as it is user friendly and more flexible.

2] Yes, it is a valid point. In HMG-IDE previous version there was an error marking 'Is the program still running?'. I don't know what happened to that in the recent versions. I will request Claudio to look into this. Thanks for reporting.

3] Because they are entirely different projects. As I have discussed earlier, HMG is based on Harbour. But it is a bundle by itself. Some major implementations have been made after the versions HMG 3.0. Introducing Unicode in 3.1. Made it to a stable version in 3.2. And the latest and significant achievement is HMG in 64 Bits, which made it to 3.3 series.

HMG Extended is also developed and released parallelly and they have their own version numbering system.

IMHO, we can use the latest stable versions for the development.

4] Harbour compiler is the core. Habour MiniGUI is the Win32 wrapper library to access the GUI aspects of the programs. HMG IDE is a tool to develop and build our software in Harbour MiniGUI.

You can use simply Harbour if you need only console mode. If you want GUI support, you can use Harbour MiniGUI and its build.bat ( even without using HMG IDE at all).

If you need Forms Designer and an easy build system, you can use HMG IDE which can co-ordinate your forms, database, resources (icons, pictures etc) and linking other third party libraries.
**) Numbering intensionally added by me.

Noted and highly appreciated.

I learn a lot from your replies. And everything is even clear and clear.

Hopefully, your above quoted replies satisfy many peoples looking for explanation, not only me.

Regards.
Agil Abdullah Albatati (just call me Agil)
Programmer Never Surrender
User avatar
Agil Abdullah
Posts: 204
Joined: Mon Aug 25, 2014 11:57 am
Location: Jakarta, Indonesia
Contact:

Re: How To Help Clipper & Foxpro Users Catch Harbour-HMG ASA

Post by Agil Abdullah »

Esgici said:

Congrats !

Your are achieved in very short time 8-)

I wish many more successive continuations :arrow:

Thanks to you for adding a link to my humble blog :oops:

Happy HMG'in to you and all Indonesian xBase programmers :D

1) Frankly speaking, what've I achieved till today not quite well ( nor in a "stable state of knowledge"), but sufficient to become confident working with HMG. I am in a process to "grab" the power of HMG. :)

2) Your blog (Viva Clipper) deserves linking to.

Many thanks for your help and support.

Regards
Agil Abdullah Albatati (just call me Agil)
Programmer Never Surrender
User avatar
Agil Abdullah
Posts: 204
Joined: Mon Aug 25, 2014 11:57 am
Location: Jakarta, Indonesia
Contact:

Re: How To Help Clipper & Foxpro Users Catch Harbour-HMG ASA

Post by Agil Abdullah »

Clip2mania said:
Quote:
2) How to avoid one app/EXE is double-run by users in the same computer? This problem never arise under DOS who own a single window. I noticed when execercising HMG-ID (executing IDE.EXE) to build project, the RUN (F5) function fails to detect the problem. that's way HMG-IDE made runtime error as if the mistake came from source program.



SET MULTIPLE ?
(or in this case: SET MULTIPLE OFF WARNING ... ?)
Thanks for your help. :)
Agil Abdullah Albatati (just call me Agil)
Programmer Never Surrender
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: How To Help Clipper & Foxpro Users Catch Harbour-HMG ASA

Post by esgici »

Clip2Mania wrote:
2) How to avoid one app/EXE is double-run by users in the same computer? This problem never arise under DOS who own a single window. I noticed when execercising HMG-ID (executing IDE.EXE) to build project, the RUN (F5) function fails to detect the problem. that's way HMG-IDE made runtime error as if the mistake came from source program.
SET MULTIPLE ?
(or in this case: SET MULTIPLE OFF WARNING ... ?)
Thanks for your remembering :) ( old man forgets quickly :oops: )

IMO this is the best way to check / avoid one app/EXE is double(multiple)-run.

Because this is a high-level system (HMG) feature and not required extra ( especially low-level ) inventions.

More, it include a useful extension : WARNING :arrow:

If question is about "Permission Denied" situation, hope that is responded in another topic.

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
User avatar
Agil Abdullah
Posts: 204
Joined: Mon Aug 25, 2014 11:57 am
Location: Jakarta, Indonesia
Contact:

Re: How To Help Clipper & Foxpro Users Catch Harbour-HMG ASA

Post by Agil Abdullah »

Hi all,

Sorry for being late to reply your posts. I am very busy rebuilding apps with HMG331.

BTW. Could you tell me how to put formula within excel cells when using OLE-Hmg. LET to put sum(a1:a99) in cell a100. THIS is to enable my apps to export data to XLS files.

TTT
Agil Abdullah Albatati (just call me Agil)
Programmer Never Surrender
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How To Help Clipper & Foxpro Users Catch Harbour-HMG ASA

Post by Rathinagiri »

Code: Select all

function ExcelSum
   local oExcel, oH
   local row := 5
   oExcel := TOleAuto():new( "Excel.Application" )
   if Ole2TxtError() != "S_OK"
      MsgStop("Excel is not available.", "Error")
      return nil
   endif
   oExcel:WorkBooks:add()
   oH := oExcel:Get( "ActiveSheet" )
   oH:cells(row,1):value := "Just a sum :"
   row := row + 1
   frow := row
   for i := 1 to 100
         oH:cells(row,1):value := i
         oH:cells(row,3):set ("NumberFormat","##########0.00")
         row := row + 1
   next i
   oH:cells(row,3):value := "=sum(a"+alltrim(str(frow,5,0))+":a"+alltrim(str(row-1,5,0))
   oH:cells(row,3):set ("NumberFormat","##########0.00")
   oH:cells(1,1):select()
   oExcel:visible := .T.
   oH:end()
   oExcel:end()
return nil
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Clip2Mania
Posts: 99
Joined: Fri Jun 13, 2014 7:16 am
Location: Belgium

Re: How To Help Clipper & Foxpro Users Catch Harbour-HMG ASA

Post by Clip2Mania »

Using HMG 3.3.1, I get a "WinOle/1009 error - no export method GET"
on line

Code: Select all

oH := oExcel:Get( "ActiveSheet" )
:?:
jayadevu
Posts: 238
Joined: Tue May 19, 2009 7:10 am

Re: How To Help Clipper & Foxpro Users Catch Harbour-HMG ASA

Post by jayadevu »

Hi,

use:

#ifdef __XHARBOUR__
oSheet := oExcel:Get( "ActiveSheet" )
#ELSE
oSheet := oExcel:ActiveSheet()
#ENDIF

there are small differences in OLE between xHarbour and Harbour. You may alternatively include library xHB.

HTH,

Warm regards,

Jayadev
Post Reply