<![CDATA[HMGforum.com]]> https://hmgforum.com Thu, 17 Jul 2025 17:36:58 +0000 Smartfeed extension for phpBB https://hmgforum.com/styles/prosilver/theme/images/site_logo.svg <![CDATA[HMGforum.com]]> https://hmgforum.com en-gb Thu, 17 Jul 2025 17:36:58 +0000 60 <![CDATA[HMG 64 Bits :: Help :: Author srmitra]]> https://hmgforum.com/viewtopic.php?f=46&t=7678&p=71813#p71813
error

_temp.rc:82: fatal error: when writing output to : Invalid argument
compilation terminated.
windres: can't open file `page:': Invalid argument
windres: preprocessing failed.
hbmk2: Processing local make script: hbmk.hbm
hbmk2[apl]: Warning: Cannot find C:/HMG.4/SVN/hmg.hbc (referenced from
hbmk.hbm)
hbmk2: Compiling...

Solve please

Srdjan Mitrovic]]>
no_email@example.com (srmitra) https://hmgforum.com/viewtopic.php?f=46&t=7678&p=71813#p71813 Tue, 15 Jul 2025 12:51:14 +0000 https://hmgforum.com/viewtopic.php?f=46&t=7678&p=71813#p71813
<![CDATA[HMG 64 Bits :: Re: Help :: Reply by AUGE_OHR]]> https://hmgforum.com/viewtopic.php?f=46&t=7678&p=71814#p71814
srmitra wrote: Tue Jul 15, 2025 12:51 pm _temp.rc:82: fatal error: when writing output to : Invalid argument
compilation terminated.
windres: can't open file `page:': Invalid argument
windres: preprocessing failed.
as i understand it point to a missing Resource File "page" in your *.RC]]>
no_email@example.com (AUGE_OHR) https://hmgforum.com/viewtopic.php?f=46&t=7678&p=71814#p71814 Tue, 15 Jul 2025 14:39:21 +0000 https://hmgforum.com/viewtopic.php?f=46&t=7678&p=71814#p71814
<![CDATA[HMG 64 Bits :: Re: Help :: Reply by srmitra]]> https://hmgforum.com/viewtopic.php?f=46&t=7678&p=71816#p71816
_temp.rc:82: fatal error: when writing output to : Invalid argument
compilation terminated.
windres: can't open file `page:': Invalid argument
windres: preprocessing failed.
Harbour 3.2.0dev (r2304211101)
Copyright (c) 1999-2023, https://harbour.github.io/
C:/hmg.3.6/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find C:/hmg.3.6/SOURCE/Edit/_temp.o: No such file or directory
collect2.exe: error: ld returned 1 exit status
hbmk2[edit-64]: Error: Running linker. 1
gcc.exe C:/Users/GAS/AppData/Local/Temp/hbmk_t6tdg0.dir/h_edit.o C:/Users/GAS/AppData/Local/Temp/hbmk_t6tdg0.dir/hbmk_u7qnlx.o C:/hmg.3.6/SOURCE/Edit/_temp.o -pthread -static-libgcc -static-libstdc++ -static -lpthread -mwindows -Wl,--start-group -l"hmg-64" -l"crypt-64" -l"edit-64" -l"editex-64" -l"graph-64" -l"ini-64" -l"report-64" -l"hfcl-64" -lmsvfw32 -lvfw32 -l"hbvpdf-64" -lhbct -lhbwin -lhbmzip -lminizip -lhbmemio -lhbmisc -lhbtip -lsqlite3 -lhbsqlit3 -lsddodbc -lrddsql -lhbodbc -lodbc32 -lhbhpdf -lhbnetio -lxhb -lpng -llibhpdf -lhbzebra -lhbextern -lhbdebug -lhbvmmt -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lhbmainwin -lwinmm -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -liphlpapi -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lmapi32 -limm32 -lmsimg32 -lwininet -lhbpcre -lhbzlib -Wl,--end-group -o"edit-64.exe" -LC:/hmg.3.6/harbour64/lib/win/mingw64 -L"C:/hmg.3.6/lib-64"]]>
no_email@example.com (srmitra) https://hmgforum.com/viewtopic.php?f=46&t=7678&p=71816#p71816 Wed, 16 Jul 2025 12:06:28 +0000 https://hmgforum.com/viewtopic.php?f=46&t=7678&p=71816#p71816
<![CDATA[HMG General Help :: How to remove CRLF from a string :: Author Tiger]]> https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71788#p71788

G_VISITOR := ALLTRIM(Cell2CHR(aExcel[i,2]))
IF AT(CHR(13)+CHR(10), G_VISITOR) > 0
STRTRAN(G_VISITOR,CHR(13)=cHR(10),"")
ENDIF

Thanks for any help.]]>
no_email@example.com (Tiger) https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71788#p71788 Tue, 01 Jul 2025 10:39:10 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71788#p71788
<![CDATA[HMG General Help :: Re: How to remove CRLF from a string :: Reply by Tiger]]> https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71789#p71789 +cHR(10),"")]]> no_email@example.com (Tiger) https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71789#p71789 Tue, 01 Jul 2025 10:42:18 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71789#p71789 <![CDATA[HMG General Help :: Re: How to remove CRLF from a string :: Reply by ASESORMIX]]> https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71790#p71790 no_email@example.com (ASESORMIX) https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71790#p71790 Tue, 01 Jul 2025 15:15:34 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71790#p71790 <![CDATA[HMG General Help :: Re: How to remove CRLF from a string :: Reply by Tiger]]> https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71791#p71791
what I want is to convert following string to single line.

From

AA、
BB、
CC、
DD、
EE、
FF、
GG

To

AA、BB、CC、DD、EE、FF、GG

Thanks.]]>
no_email@example.com (Tiger) https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71791#p71791 Wed, 02 Jul 2025 11:24:56 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71791#p71791
<![CDATA[HMG General Help :: Re: How to remove CRLF from a string :: Reply by ASESORMIX]]> https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71792#p71792

Code: Select all


SALTO := CHR(13)+CHR(10)

G_VISITOR := "AA,"+SALTO+"BB,"+SALTO+"CC,"+SALTO+"DD,"+SALTO+"EE,"+SALTO
MSGDEBUG( G_VISITOR  )
MSGINFO( G_VISITOR  )

G_VISITOR := STRTRAN( G_VISITOR, SALTO ,"")    
MSGDEBUG( G_VISITOR  )
MSGINFO( G_VISITOR  )

]]>
no_email@example.com (ASESORMIX) https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71792#p71792 Wed, 02 Jul 2025 14:33:44 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71792#p71792
<![CDATA[HMG General Help :: Re: How to remove CRLF from a string :: Reply by ASESORMIX]]> https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71793#p71793 no_email@example.com (ASESORMIX) https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71793#p71793 Wed, 02 Jul 2025 14:38:44 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71793#p71793 <![CDATA[HMG General Help :: Re: How to remove CRLF from a string :: Reply by edk]]> https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71794#p71794 This function will remove all CR and/or LF]]> no_email@example.com (edk) https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71794#p71794 Wed, 02 Jul 2025 18:37:26 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71794#p71794 <![CDATA[HMG General Help :: Re: How to remove CRLF from a string :: Reply by Tiger]]> https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71795#p71795 hb_StrReplace( G_VISITOR, CRLF, "")]]> no_email@example.com (Tiger) https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71795#p71795 Thu, 03 Jul 2025 01:07:54 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7674&p=71795#p71795 <![CDATA[HMG General Help :: IsControlDefined not working :: Author serge_girard]]> https://hmgforum.com/viewtopic.php?f=5&t=7675&p=71796#p71796
I found some strange behaviour cause general error...:
See line 2764

Code: Select all

....
0002763 IF IsControlDefined ('TB_DL_NAME' , 'Form_VW_or_DL' )  
0002764    cF := GETPROPERTY('TB_DL_NAME' , 'Form_VW_or_DL' , 'VALUE')  
0002765 ENDIF
....

Date:04/07/2025 Time: 09:18:21
Error: HMG 3.6.1 Stable (64 bits)
Control: Form_VW_or_DL Of TB_DL_NAME Not defined. Program Terminated
Called from GETPROPERTY(8514)
Called from VIEW_BLOB_PDF(2764)
...
How to avoid?

Serge]]>
no_email@example.com (serge_girard) https://hmgforum.com/viewtopic.php?f=5&t=7675&p=71796#p71796 Fri, 04 Jul 2025 08:31:59 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7675&p=71796#p71796
<![CDATA[HMG General Help :: Re: IsControlDefined not working :: Reply by edk]]> https://hmgforum.com/viewtopic.php?f=5&t=7675&p=71797#p71797
serge_girard wrote: Fri Jul 04, 2025 8:31 am [/code]
Date:04/07/2025 Time: 09:18:21
Error: HMG 3.6.1 Stable (64 bits)
Control: Form_VW_or_DL Of TB_DL_NAME Not defined. Program Terminated
Called from GETPROPERTY(8514)
Called from VIEW_BLOB_PDF(2764)
...
[/code]
Serge, IsControlDefined is fine, only GetProperty you have wrong. First you give the name of the form, the second parameter is the name of the control, the third is the property.

Code: Select all

cF := GETPROPERTY( 'Form_VW_or_DL' /* FormName */, 'TB_DL_NAME'  /* ControlName */ , 'VALUE')
]]>
no_email@example.com (edk) https://hmgforum.com/viewtopic.php?f=5&t=7675&p=71797#p71797 Fri, 04 Jul 2025 12:45:29 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7675&p=71797#p71797
<![CDATA[HMG General Help :: Re: IsControlDefined not working :: Reply by serge_girard]]> https://hmgforum.com/viewtopic.php?f=5&t=7675&p=71804#p71804
Such a stupid look-over mistype....

Serge]]>
no_email@example.com (serge_girard) https://hmgforum.com/viewtopic.php?f=5&t=7675&p=71804#p71804 Sat, 12 Jul 2025 12:41:35 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7675&p=71804#p71804
<![CDATA[HMG General Help :: cannot reach www.hmgforum.com :: Author trmpluym]]> https://hmgforum.com/viewtopic.php?f=5&t=7676&p=71800#p71800
I live in the Netherlands but I cannot open the website anymore without a VPN solution (NorthVPN).

When I use tool like https://www.uptrends.com/tools/uptime and I check www.hmgforum.com this is confirmed.

I tried different ISP providers (Delta, KPN etc.) but they all have the same issue.

Maybe something to ask the hoster of the website ?

Best regards,

Theo]]>
no_email@example.com (trmpluym) https://hmgforum.com/viewtopic.php?f=5&t=7676&p=71800#p71800 Wed, 09 Jul 2025 13:20:22 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7676&p=71800#p71800
<![CDATA[HMG General Help :: Re: cannot reach www.hmgforum.com :: Reply by AUGE_OHR]]> https://hmgforum.com/viewtopic.php?f=5&t=7676&p=71806#p71806
try to Use a proxy, as example, proxysite.com]]>
no_email@example.com (AUGE_OHR) https://hmgforum.com/viewtopic.php?f=5&t=7676&p=71806#p71806 Sat, 12 Jul 2025 15:24:58 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7676&p=71806#p71806
<![CDATA[HMG General Help :: help with Postgresql - users and privileges :: Author mol]]> https://hmgforum.com/viewtopic.php?f=5&t=7677&p=71805#p71805 I'm building an app, where I have a client registry in dbf file, but I need to create for everyone postgresql database.
I have to add users of application as users of postgresql.
It's simple, but my new created postgresql user has no rights to create tables in previously created db.
I granted privileges, but it still doesn't work.
I'm getting info about access denied to public schema]]>
no_email@example.com (mol) https://hmgforum.com/viewtopic.php?f=5&t=7677&p=71805#p71805 Sat, 12 Jul 2025 13:11:16 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7677&p=71805#p71805
<![CDATA[HMG General Help :: Re: help with Postgresql - users and privileges :: Reply by serge_girard]]> https://hmgforum.com/viewtopic.php?f=5&t=7677&p=71807#p71807
Why should end-user have rights to create tables? Do you get some SQL errors?

Serge]]>
no_email@example.com (serge_girard) https://hmgforum.com/viewtopic.php?f=5&t=7677&p=71807#p71807 Sat, 12 Jul 2025 19:44:19 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7677&p=71807#p71807
<![CDATA[HMG General Help :: Re: help with Postgresql - users and privileges :: Reply by mol]]> https://hmgforum.com/viewtopic.php?f=5&t=7677&p=71808#p71808 My principal wants to log every steps done by his workers, but maybe my strategy was wrong?]]> no_email@example.com (mol) https://hmgforum.com/viewtopic.php?f=5&t=7677&p=71808#p71808 Sat, 12 Jul 2025 19:49:46 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7677&p=71808#p71808 <![CDATA[HMG General Help :: Re: help with Postgresql - users and privileges :: Reply by serge_girard]]> https://hmgforum.com/viewtopic.php?f=5&t=7677&p=71809#p71809 Maybe consider changing strategy.
But again, why should end-users create tables? Consider users with grant to create tables and then inserts lots of duplicates and data redundancy...]]>
no_email@example.com (serge_girard) https://hmgforum.com/viewtopic.php?f=5&t=7677&p=71809#p71809 Sat, 12 Jul 2025 20:03:21 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7677&p=71809#p71809
<![CDATA[HMG General Help :: Re: help with Postgresql - users and privileges :: Reply by franco]]> https://hmgforum.com/viewtopic.php?f=5&t=7677&p=71811#p71811 I have a large program designed by user. At the end of very entry line there is a pick box which runs a last emloyee listbox pick.
This setidn procedure has every employee in it. This is how he can keep track of emloyee entrys and create reports.

Code: Select all

@362, 10 something
@362,60  something
 @ 362,435 BUTTON BUTTON_32C CAPTION "V" WIDTH 20 HEIGHT 20 action {{setidn('TEXT_32I')},{WIN_AC.TEXT_32I.SAVE}}   tooltip 'Click to Change Initial'   
There are some lines in the program that do not have emplyee picks.
Maybe something like this could work.]]>
no_email@example.com (franco) https://hmgforum.com/viewtopic.php?f=5&t=7677&p=71811#p71811 Sun, 13 Jul 2025 15:39:55 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7677&p=71811#p71811
<![CDATA[HMG General Help :: Re: eFakture, serbian only :: Reply by srmitra]]> https://hmgforum.com/viewtopic.php?f=5&t=7527&p=71803#p71803
ako nije tajna koje parametre šalješ programi CURL.exe za SEF i UF

Srđan Mitrović]]>
no_email@example.com (srmitra) https://hmgforum.com/viewtopic.php?f=5&t=7527&p=71803#p71803 Fri, 11 Jul 2025 10:43:31 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7527&p=71803#p71803
<![CDATA[HMG General Help :: Re: eFakture, serbian only :: Reply by nekbmm]]> https://hmgforum.com/viewtopic.php?f=5&t=7527&p=71810#p71810
srmitra wrote: Fri Jul 11, 2025 10:43 am Pozdrav Dragane

ako nije tajna koje parametre šalješ programi CURL.exe za SEF i UF

Srđan Mitrović
Imaš u tehničkom uputstvu sve API pozive !

Ovo je prvi primer:

curl -k -X GET "https://efaktura.mfin.gov.rs/api/public ... t-measures" -H "accept: */*" -H "ApiKey:462d9282-22cf-4d0b-afbe-17411d375a18" >jmere.txt
Pozdav NEX.]]>
no_email@example.com (nekbmm) https://hmgforum.com/viewtopic.php?f=5&t=7527&p=71810#p71810 Sun, 13 Jul 2025 06:14:15 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7527&p=71810#p71810
<![CDATA[HMG General Help :: Re: eFakture, serbian only :: Reply by srmitra]]> https://hmgforum.com/viewtopic.php?f=5&t=7527&p=71812#p71812
Pozdrav]]>
no_email@example.com (srmitra) https://hmgforum.com/viewtopic.php?f=5&t=7527&p=71812#p71812 Tue, 15 Jul 2025 11:46:54 +0000 https://hmgforum.com/viewtopic.php?f=5&t=7527&p=71812#p71812
<![CDATA[PDF Generation :: Re: PDF Viewer DLL? :: Reply by mlnr]]> https://hmgforum.com/viewtopic.php?f=40&t=5112&p=71799#p71799
I have an application that uses Sumatra PDFView, which works fine with HMG versions 3.44 and 3.6 (64-bit). I would also like to use the WEBVIEW library in this application. https://www.hmgforum.com/viewtopic.php?t=7659 This requires using the -cpp flag.
call c:\hmg.3.6\build64.bat demo %* hbcurl.hbc hbmxml.hbc hbziparc.hbc -lhblibxlsxwriter -cpp -lshlwapi
When I use this flag, I get the following message in the build.log.
PdfView_C.prg: In function 'void HB_FUN_GETCOPYDATASTRING()':
PdfView_C.prg:178:19: error: invalid conversion from 'PVOID' {aka 'void*'} to 'const char*' [-fpermissive]
In file included from PdfView_C.prg:10:
c:/hmg.3.6/harbour64/include/hbapi.h:687:47: note: initializing argument 1 of 'void hb_retc(const char*)'
687 | extern HB_EXPORT void hb_retc( const char * szText ); /* returns a string */
| ~~~~~~~~~~~~~^~~~~~
In file included from PdfView_C.prg:4:
PdfView_C.prg:180:20: error: invalid conversion from 'PVOID' {aka 'void*'} to 'const HB_WCHAR*' {aka 'const wchar_t*'} [-fpermissive]
c:/hmg.3.6/include/HMG_UNICODE.h:77:56: note: in definition of macro 'HMG_WCHAR_TO_CHAR'
77 | #define HMG_WCHAR_TO_CHAR(c) hb_osStrU16Decode(c) // return CHAR
| ^
PdfView_C.prg:180:5: note: in expansion of macro 'HMG_retc'
c:/hmg.3.6/harbour64/include/hbapi.h:1236:67: note: initializing argument 1 of 'char* hb_osStrU16Decode(const HB_WCHAR*)'
1236 | extern HB_EXPORT char * hb_osStrU16Decode( const HB_WCHAR * pszNameW );
| ~~~~~~~~~~~~~~~~~^~~~~~~~
hbmk2[demo]: Error: Running C/C++ compiler. 1
PdfView_C.prg:

Code: Select all

#pragma BEGINDUMP

#include "SET_COMPILE_HMG_UNICODE.ch"
#include "HMG_UNICODE.h"

#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <shlobj.h>
#include "hbapi.h"
#include "hbapierr.h"


       //SetCapture(nHWnd)
HB_FUNC( SETCAPTURE )
{
  HMG_retnl((LONG_PTR) SetCapture((HWND) HMG_parnl(1)));
}


HB_FUNC( RELEASECAPTURE )
{
  hb_retl(ReleaseCapture());
}


       //SetCursorShape(cCursor|nCursor)
HB_FUNC( SETCURSORSHAPE )
{
  HCURSOR hCursor;

  if (HB_ISCHAR(1))
    hCursor = LoadCursor(GetModuleHandle(NULL), HMG_parc(1));
  else
    hCursor = LoadCursor(NULL, MAKEINTRESOURCE(hb_parni(1)));

  HMG_retnl((LONG_PTR) SetCursor(hCursor));
}


       //GetWindowNormalPos(hWnd)
HB_FUNC( GETWINDOWNORMALPOS )
{
  WINDOWPLACEMENT wp;
  wp.length = sizeof(WINDOWPLACEMENT);

  GetWindowPlacement((HWND) HMG_parnl(1), &wp);

  hb_reta(4);
  hb_storvni(wp.rcNormalPosition.left,   -1, 1);
  hb_storvni(wp.rcNormalPosition.top,    -1, 2);
  hb_storvni(wp.rcNormalPosition.right,  -1, 3);
  hb_storvni(wp.rcNormalPosition.bottom, -1, 4);
}


       //SetMinMaxTrackSize(lParam, nMinX, nMinY, nMaxX, nMaxY)
HB_FUNC( SETMINMAXTRACKSIZE )
{
  MINMAXINFO *MinMax = (MINMAXINFO *) HMG_parnl(1);

  if (hb_parni(2) > 0)
    MinMax->ptMinTrackSize.x = hb_parni(2);
  if (hb_parni(3) > 0)
    MinMax->ptMinTrackSize.y = hb_parni(3);
  if (hb_parni(4) > 0)
    MinMax->ptMaxTrackSize.x = hb_parni(4);
  if (hb_parni(5) > 0)
    MinMax->ptMaxTrackSize.y = hb_parni(5);
}


        //GetRectArray(pRect, aRect)
HB_FUNC ( GETRECTARRAY )
{
  RECT *rc = (RECT *) HMG_parnl(1);

  hb_storvni(rc->left,   2, 1);
  hb_storvni(rc->top,    2, 2);
  hb_storvni(rc->right,  2, 3);
  hb_storvni(rc->bottom, 2, 4);
}


        //SetRectArray(pRect, aRect)
HB_FUNC ( SETRECTARRAY )
{
  RECT *rc = (RECT *) HMG_parnl(1);

  rc->left   = hb_parvni(2, 1);
  rc->top    = hb_parvni(2, 2);
  rc->right  = hb_parvni(2, 3);
  rc->bottom = hb_parvni(2, 4);
}


       //lParam form WM_LBUTTON*, WM_MBUTTON*, WM_RBUTTON* messages
       //Tab_HitTest(hWnd, lParam)
HB_FUNC( TAB_HITTEST )
{
  LPARAM lParam = HMG_parnl(2);
  TCHITTESTINFO tchti;

  tchti.pt.x  = (LONG) GET_X_LPARAM(lParam);
  tchti.pt.y  = (LONG) GET_Y_LPARAM(lParam);
  tchti.flags = TCHT_ONITEM;

  hb_retni(TabCtrl_HitTest((HWND) HMG_parnl(1), &tchti) + 1);
}


       //TrackPopupMenu2(nHMenu, nFlags, nRow, nCol, nHWnd)
HB_FUNC( TRACKPOPUPMENU2 )
{
  hb_retni(TrackPopupMenu((HMENU) HMG_parnl(1),
                          (UINT)  hb_parni (2),
                          (INT)   hb_parni (4),
                          (INT)   hb_parni (3),
                          0,
                          (HWND)  HMG_parnl(5),
                          NULL));
}


       //PaintSizeGrip(nHWnd)
HB_FUNC( PAINTSIZEGRIP )
{
  HWND        hWnd;
  PAINTSTRUCT ps;
  RECT        rc;
  HDC         hdc;

  hWnd = (HWND) HMG_parnl(1);
  hdc  = BeginPaint(hWnd, &ps);

  if (hdc)
  {
    GetClientRect(hWnd, &rc);

    rc.left = rc.right  - GetSystemMetrics(SM_CXVSCROLL);
    rc.top  = rc.bottom - GetSystemMetrics(SM_CYVSCROLL);

    DrawFrameControl(hdc, &rc, DFC_SCROLL, DFCS_SCROLLSIZEGRIP);
    EndPaint(hWnd, &ps);
  }
}


       //Send_WM_COPYDATA(nHWnd, nAction, cText)
HB_FUNC( SEND_WM_COPYDATA )
{
  LPTSTR         Text = (LPTSTR) HMG_parc(3);
  COPYDATASTRUCT cds;

  cds.dwData = HMG_parnl(2);
  cds.cbData = (_tcslen(Text) + 1) * sizeof(TCHAR);
  cds.lpData = Text;

  SendMessageTimeout((HWND) HMG_parnl(1), WM_COPYDATA, (WPARAM) NULL, (LPARAM) &cds, 0, 5000, NULL);
}


       //GetCopyDataAction(pCDS)
HB_FUNC( GETCOPYDATAACTION )
{
  PCOPYDATASTRUCT pCDS = (PCOPYDATASTRUCT) HMG_parnl(1);

  HMG_retnl(pCDS->dwData);
}


       //GetCopyDataString(pCDS, [lIsUTF8])
HB_FUNC( GETCOPYDATASTRING )
{
  PCOPYDATASTRUCT pCDS = (PCOPYDATASTRUCT) HMG_parnl(1);

  if (hb_parl(2))
    hb_retc(pCDS->lpData);
  else
    HMG_retc(pCDS->lpData);
}


/*
  Based on code of Dr.Claudio Soto (c_dialogs.c):
    C_GetFolder()
    BrowseCallbackProc()

  Added ability to set dialog position
*/

typedef struct
{
  TCHAR *cInitPath;
  TCHAR *cInvalidDataMsg;
  BOOL  bSetPos;
  INT   nX;
  INT   nY;
} BFFDATA;


INT CALLBACK BrowseForFolderCallback(HWND hWnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
{
  // Msg :
  // BFFM_INITIALIZED   : The dialog box has finished initializing.
  // BFFM_IUNKNOWN      : An IUnknown interface is available to the dialog box.
  // BFFM_SELCHANGED    : The selection has changed in the dialog box.
  // BFFM_VALIDATEFAILED: The user typed an invalid name into the dialog's edit box. A nonexistent folder is considered an invalid name.
  //
  // SendMessage ()
  // BFFM_SETSELECTION  : Specifies the path of a folder to select. The path can be specified as a string or a PIDL.
  // BFFM_ENABLEOK      : Enables or disables the dialog box's OK button. 
  // BFFM_SETOKTEXT     : Sets the text that is displayed on the dialog box's OK button.
  // BFFM_SETEXPANDED   : Specifies the path of a folder to expand in the Browse dialog box. The path can be specified as a Unicode string or a PIDL.
  // BFFM_SETSTATUSTEXT : Sets the status text. Set the BrowseForFolderCallback lpData parameter to point to a null-terminated string with the desired text.

  TCHAR cTitle[GetWindowTextLength(hWnd) + 1];
  
  GetWindowText(hWnd, cTitle, sizeof(cTitle) / sizeof(TCHAR));

  UNREFERENCED_PARAMETER(lParam); //avoid warning message: "lParam defined but not used"

  BFFDATA *BrowseForFolderData = (BFFDATA *) lpData;

  HWND hWndNS;
  HWND hWndTV;

  switch (uMsg)
  {
    case BFFM_INITIALIZED:
      if (BrowseForFolderData->cInitPath)
        SendMessage(hWnd, BFFM_SETSELECTION, (WPARAM) TRUE, (LPARAM) BrowseForFolderData->cInitPath); 

      if (BrowseForFolderData->bSetPos)
        SetWindowPos(hWnd, NULL, BrowseForFolderData->nX, BrowseForFolderData->nY, 0, 0, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE);

      //set focus to TreeView (Win-XP)
      //set ENSUREVISIBLE (Win-7)
      hWndNS = FindWindowEx(hWnd, NULL, _TEXT("SHBrowseForFolder ShellNameSpace Control"), NULL);

      if (hWndNS)
      {
        hWndTV = FindWindowEx(hWndNS, NULL, _TEXT("SysTreeView32"), NULL);

        if (hWndTV)
        {
          PostMessage(hWnd, WM_NEXTDLGCTL, (WPARAM) hWndTV, TRUE);
          PostMessage(hWndTV, TVM_ENSUREVISIBLE, 0, SendMessage(hWndTV, TVM_GETNEXTITEM, TVGN_CARET, 0));
        }
      }

      break;

    case BFFM_VALIDATEFAILED:
      if (BrowseForFolderData->cInvalidDataMsg)
        MessageBox(hWnd, BrowseForFolderData->cInvalidDataMsg, cTitle, MB_ICONHAND | MB_OK | MB_SYSTEMMODAL); //(TCHAR *)lParam ---> cFolderName
      else
        MessageBeep(MB_ICONHAND);           

      return 1;
  }

  return 0;
}


       //                 1         2         3                    4                    5            6       7
       //BrowseForFolder([cTitle], [nFlags], [nCSIDL_FolderType], [cInvalidDataTitle], [cInitPath], [nRow], [nCol])
HB_FUNC( BROWSEFORFOLDER )
{
  HWND         hWnd = GetActiveWindow();
  BROWSEINFO   BrowseInfo;
  TCHAR        cBuffer[MAX_PATH];
  LPITEMIDLIST ItemIDList;

  SHGetSpecialFolderLocation(hWnd, HB_ISNIL(3) ? CSIDL_DRIVES : hb_parnl(3), &ItemIDList);

  // BrowseInfo.ulFlags
  // ------------------
  // BIF_RETURNONLYFSDIRS   : Only return file system directories.
  // BIF_DONTGOBELOWDOMAIN  : Do not include network folders below the domain level in the dialog box's tree view control.
  // BIF_STATUSTEXT         : Include a status area in the dialog box ( not supported when BIF_NEWDIALOGSTYLE )
  // BIF_RETURNFSANCESTORS  : Only return file system ancestors. An ancestor is a subfolder that is beneath the root folder in the namespace hierarchy.
  // BIF_EDITBOX            : Include an edit control in the browse dialog box that allows the user to type the name of an item.
  // BIF_VALIDATE           : If the user types an invalid name into the edit box, the browse dialog box calls the application's BrowseForFolderCallback 
  //                          with the BFFM_VALIDATEFAILED message ( ignored if BIF_EDITBOX is not specified)
  // BIF_NEWDIALOGSTYLE     : Use the new user interface. Setting this flag provides the user with a larger dialog box that can be resized. 
  //                          The dialog box has several new capabilities, including: drag-and-drop capability within the dialog box, 
  //                          reordering, shortcut menus, new folders, delete, and other shortcut menu commands.
  // BIF_BROWSEINCLUDEURLS  : The browse dialog box can display URLs. The BIF_USENEWUI and BIF_BROWSEINCLUDEFILES flags must also be set.
  // BIF_USENEWUI           : equivalent to BIF_EDITBOX + BIF_NEWDIALOGSTYLE.
  // BIF_UAHINT             : When combined with BIF_NEWDIALOGSTYLE, adds a usage hint to the dialog box, in place of the edit box (BIF_EDITBOX overrides this flag)
  // BIF_NONEWFOLDERBUTTON  : Do not include the New Folder button in the browse dialog box.
  // BIF_NOTRANSLATETARGETS : When the selected item is a shortcut, return the PIDL of the shortcut itself rather than its target.
  // BIF_BROWSEFORCOMPUTER  : Only return computers
  // BIF_BROWSEFORPRINTER   : Only allow the selection of printers. In Windows XP and later systems, the best practice is to use a Windows XP-style dialog, 
  //                          setting the root of the dialog to the Printers and Faxes folder (CSIDL_PRINTERS).
  // BIF_BROWSEINCLUDEFILES : The browse dialog box displays files as well as folders.
  // BIF_SHAREABLE          : The browse dialog box can display sharable resources on remote systems. The BIF_NEWDIALOGSTYLE flag must also be set.
  // BIF_BROWSEFILEJUNCTIONS: Windows 7 and later. Allow folder junctions such as a library or a compressed file with a .zip file name extension to be browsed.

  BFFDATA BrowseForFolderData;

  BrowseForFolderData.cInvalidDataMsg = (TCHAR *) HMG_parc(4);
  BrowseForFolderData.cInitPath       = (TCHAR *) HMG_parc(5);

  if (HB_ISNUM(6) && HB_ISNUM(7))
  {
    BrowseForFolderData.bSetPos = TRUE;
    BrowseForFolderData.nX      = hb_parni(7);
    BrowseForFolderData.nY      = hb_parni(6);
  }
  else
    BrowseForFolderData.bSetPos = FALSE;

  BrowseInfo.hwndOwner      = hWnd;
  BrowseInfo.pidlRoot       = ItemIDList;
  BrowseInfo.pszDisplayName = cBuffer;
  BrowseInfo.lpszTitle      = HMG_parc(1);
  BrowseInfo.ulFlags        = hb_parnl(2);
  BrowseInfo.lpfn           = BrowseForFolderCallback;
  BrowseInfo.lParam         = (LPARAM) &BrowseForFolderData;
  BrowseInfo.iImage         = 0;
  
  ItemIDList = SHBrowseForFolder(&BrowseInfo);

  if (ItemIDList)
  {
    SHGetPathFromIDList(ItemIDList, cBuffer);
    HMG_retc(cBuffer);
  }
  else
    HMG_retc(_TEXT(""));

  CoTaskMemFree((LPVOID) ItemIDList); // It is the responsibility of the calling application to call CoTaskMemFree to free the IDList returned 
                                      // by SHBrowseForFolder when it is no longer needed.
}


/*
  adapted from tip_URLEncode()
*/
       //EncodeURIComponent(cText)
HB_FUNC( ENCODEURICOMPONENT )
{
  const char * pszData = hb_parc(1);

  if (pszData)
  {
    HB_ISIZ nLen = hb_parclen(1);

    if (nLen)
    {
      HB_ISIZ nPos = 0, nPosRet = 0;

      /*Giving maximum final length possible*/
      char * pszRet = (char *) hb_xgrab(nLen * 3 + 1);
      char cElem;
      HB_UINT uiVal;

      while (nPos < nLen)
      {
        cElem = pszData[nPos];

        if ((cElem >= 'A' && cElem <= 'Z') ||
            (cElem >= 'a' && cElem <= 'z') ||
            (cElem >= '0' && cElem <= '9') ||
            cElem == '-' || cElem == '_' || cElem == '.' || cElem == '!' || cElem == '~' || cElem == '*' || cElem == '\'' || cElem == '(' || cElem == ')')
        {
          pszRet[nPosRet] = cElem;
        }
        else /*encode*/
        {
          pszRet[nPosRet++] = '%';
          uiVal = ((HB_UCHAR) cElem) >> 4;
          pszRet[nPosRet++] = (char) ((uiVal < 10 ? '0' : 'A' - 10) + uiVal);
          uiVal = ((HB_UCHAR) cElem) & 0x0F;
          pszRet[nPosRet] = (char) ((uiVal < 10 ? '0' : 'A' - 10) + uiVal);
        }

        nPosRet++;
        nPos++;
      }

      hb_retclen_buffer(pszRet, nPosRet);
    }
    else
      hb_retc_null();
  }
  else
    hb_errRT_BASE(EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, 1, hb_paramError(1));
}

#pragma ENDDUMP
Does anyone have any suggestions for this problem?]]>
no_email@example.com (mlnr) https://hmgforum.com/viewtopic.php?f=40&t=5112&p=71799#p71799 Tue, 08 Jul 2025 14:58:24 +0000 https://hmgforum.com/viewtopic.php?f=40&t=5112&p=71799#p71799
<![CDATA[PDF Generation :: Re: PDF Viewer DLL? :: Reply by mlnr]]> https://hmgforum.com/viewtopic.php?f=40&t=5112&p=71801#p71801
Locate the function

Code: Select all

HB_FUNC( GETCOPYDATASTRING )
{
  PCOPYDATASTRUCT pCDS = (PCOPYDATASTRUCT) HMG_parnl(1);

  if (hb_parl(2))
    hb_retc(pCDS->lpData);
  else
    HMG_retc(pCDS->lpData);
}
Modify as follows

Code: Select all

HB_FUNC( GETCOPYDATASTRING )
{
  PCOPYDATASTRUCT pCDS = (PCOPYDATASTRUCT) HMG_parnl(1);

  if (hb_parl(2))
    hb_retc((const char *) pCDS->lpData);
  else
    HMG_retc((const HB_WCHAR *) pCDS->lpData);
}
It seems to work with this.]]>
no_email@example.com (mlnr) https://hmgforum.com/viewtopic.php?f=40&t=5112&p=71801#p71801 Thu, 10 Jul 2025 06:59:32 +0000 https://hmgforum.com/viewtopic.php?f=40&t=5112&p=71801#p71801
<![CDATA[General :: Re: Como ejecutar en segundo plano un PHP?? :: Reply by jorge_riv]]> https://hmgforum.com/viewtopic.php?f=24&t=7671&p=71785#p71785 no_email@example.com (jorge_riv) https://hmgforum.com/viewtopic.php?f=24&t=7671&p=71785#p71785 Fri, 20 Jun 2025 15:00:29 +0000 https://hmgforum.com/viewtopic.php?f=24&t=7671&p=71785#p71785 <![CDATA[General :: Re: Como ejecutar en segundo plano un PHP?? :: Reply by franco]]> https://hmgforum.com/viewtopic.php?f=24&t=7671&p=71786#p71786 no_email@example.com (franco) https://hmgforum.com/viewtopic.php?f=24&t=7671&p=71786#p71786 Fri, 20 Jun 2025 15:10:16 +0000 https://hmgforum.com/viewtopic.php?f=24&t=7671&p=71786#p71786 <![CDATA[General :: Re: Exportar tabla MariaDB a texto con tabulares :: Reply by Ismach]]> https://hmgforum.com/viewtopic.php?f=24&t=7654&p=71798#p71798

Code: Select all

Local cTempString := ''
Local oRow, oQuery

cQueryString := 'SELECT * FROM TuPedorraTabla"

oQuery := oServer:Query(cQueryString)
If oQuery:NetErr()
    memowrit(cError, oQuery:Error() + ' --- ' + cQueryString)
EndIf
If oQuery:RecCount() > 0
     For i := 1 to oQuery:RecCount() Step 1
         oRow := oQuery:GetRow(i)
        cTempString += oRow:FieldGet("Col1") + Chr(9) + oRow:FieldGet("Col2") + Chr(9) + oRow:FieldGet("ColZ") + hb_OsNewLine()
     Next i
EndIf
memowrit("TuPedorraTabla.plana.txt",cTempString)
]]>
no_email@example.com (Ismach) https://hmgforum.com/viewtopic.php?f=24&t=7654&p=71798#p71798 Sat, 05 Jul 2025 05:39:23 +0000 https://hmgforum.com/viewtopic.php?f=24&t=7654&p=71798#p71798
<![CDATA[HMG Samples :: Re: Draw border :: Reply by mol]]> https://hmgforum.com/viewtopic.php?f=9&t=3250&p=71802#p71802 Does anybody know, how to clear form from drawed lines? - Esgici presented his solution for DrawBorder in this topic.
It looks nice, but - how to cleap the form when I want to delete bordered control? How to delete drawed line?
Does anybody have solution for that? Maybe draw line in background color?]]>
no_email@example.com (mol) https://hmgforum.com/viewtopic.php?f=9&t=3250&p=71802#p71802 Fri, 11 Jul 2025 10:20:44 +0000 https://hmgforum.com/viewtopic.php?f=9&t=3250&p=71802#p71802
<![CDATA[HMG Samples :: Re: Draw border :: Reply by LOUIS]]> https://hmgforum.com/viewtopic.php?f=9&t=3250&p=71815#p71815
Once time I copied this about erase lines ...
I hope it is useful to you !

Code: Select all

#include <hmg.ch>

#define nMaxPenWidth 10

PROCEDURE Main()

   aWinBackColor := { 0xF0, 0xF0, 0xF0 } 

   aColorS := { YELLOW	,;   
                PINK		,;   
                RED		,;   
                FUCHSIA	,;   
                BROWN	,;
                ORANGE	,;
                GREEN	,;   
                PURPLE	,;   
                BLACK	,;   // WHITE	,;
                GRAY		,;
                BLUE		} 

   nLineBRow := 0       // Line Beg. Row 
   nLineBCol := 0       // Line Beg. Column
   nLineERow := 0       // Line End Row 
   nLineECol := 0       // Line End Column
   nLinePenW := 0       // Line colour ( form background colour, when erasing ) 
   nLineColr := 0       // Line Pen Width
   
   DEFINE WINDOW frmEraseLine ;
      AT 138 , 235 ;
      WIDTH  560 ;
      HEIGHT 380 ;   //  BACKCOLOR GRAY ;
      TITLE "Erasing drawn line" ;
      MAIN ;
      BACKCOLOR aWinBackColor ;
      ON INIT frmEraseLine.btnEras.Enabled := .F.
          
      ON KEY ESCAPE    ACTION frmEraseLine.Release
      
      @ 280, 100 BUTTON btnDraw CAPTION "&Draw"  ACTION Draw1Line() 
      @ 280, 230 BUTTON btnEras CAPTION "&Erase" ACTION Eras1Line( nLineBRow, nLineBCol, nLineERow, nLineECol, aWinBackColor, nLinePenW) 
      @ 280, 360 BUTTON btnExit CAPTION "E&xit"  ACTION frmEraseLine.Release
      
   END WINDOW // frmEraseLine
   
   frmEraseLine.Center
   frmEraseLine.Activate

RETURN // Main()

*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._

PROCEDURE Draw1Line()
                    
   LOCAL nOldColor := nLineColr
   
   nLineBRow := HB_RandomInt( 0, frmEraseLine.WIDTH / 2 )
   nLineBCol := HB_RandomInt( 0, frmEraseLine.HEIGHT / 2  )
   nLineERow := HB_RandomInt( nLineBRow , frmEraseLine.WIDTH  )
   nLineECol := HB_RandomInt( nLineBCol, frmEraseLine.HEIGHT  )
   nLinePenW := HB_RandomInt( 1, nMaxPenWidth )
      
   WHILE nOldColor = nLineColr
      nLineColr := HB_RandomInt( 1, LEN( aColorS ) )
   ENDDO   
   
   DRAW LINE IN WINDOW frmEraseLine AT nLineBRow, nLineBCol ;
                                    TO nLineERow, nLineECol ;
                                    PENCOLOR aColorS[ nLineColr ] ;
                                    PENWIDTH nLinePenW
        
   frmEraseLine.btnDraw.Enabled := .F.
   frmEraseLine.btnEras.Enabled := .T.
    
RETURN // Draw1Line()  

*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._


PROCEDURE Eras1Line(;
                      nBRow,;    // Line Beg. Row
                      nBCol,;    // Line Beg. Column
                      nERow,;    // Line End Row 
                      nECol,;    // Line End Column
                      aWBCLr,;   // Line erase colour ( form background colour) 
                      nPenW )    // Line Pen Width
        
   DRAW LINE IN WINDOW frmEraseLine AT nLineBRow, nLineBCol ;
                                    TO nLineERow, nLineECol ;
                                    PENCOLOR aWinBackColor  ;
                                    PENWIDTH nLinePenW
   
   frmEraseLine.btnDraw.Enabled := .T.
   frmEraseLine.btnEras.Enabled := .F.
    
RETURN // Eras1Line()  
*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._
]]>
no_email@example.com (LOUIS) https://hmgforum.com/viewtopic.php?f=9&t=3250&p=71815#p71815 Wed, 16 Jul 2025 00:42:33 +0000 https://hmgforum.com/viewtopic.php?f=9&t=3250&p=71815#p71815
<![CDATA[My HMG Projects :: Re: A NEW GAME :: Reply by LOUIS]]> https://hmgforum.com/viewtopic.php?f=15&t=7672&p=71787#p71787
Traigo la última actualización del programita MARATON, creo que con esta presentación ha quedado mucho mejor.

Saludos a todos.
Louis

P.D.- La primera pantalla que verán seran 2 fotos reales, sólo esperen 10 segundos para que desaparezcan y empiece el juego.

Attachments


captura.png (122.32 KiB)

MARATON.rar (3305.78 KiB)
]]>
no_email@example.com (LOUIS) https://hmgforum.com/viewtopic.php?f=15&t=7672&p=71787#p71787 Wed, 25 Jun 2025 01:50:38 +0000 https://hmgforum.com/viewtopic.php?f=15&t=7672&p=71787#p71787