Page 1 of 2

how to post messages using programming in "C"

Posted: Wed Apr 11, 2012 1:04 am
by jairpinho
how to send messages using programming in "C" in my program done in HMG following example:

#PRAGMA BEGINDUMP

#include "hbapi.h"
#include <stdio.h>



// ******************************************************************************
HB_FUNC( teste )
// ******************************************************************************


{
int x = 10;
int y = 10;
printf("result x %d", x )

}



#PRAGMA ENDDUMP
[u]Moderator Notes[/u] (Pablo César) wrote:Topic moved from Forum en Español.

Re: how to send messages using programming in "C"

Posted: Wed Apr 11, 2012 6:01 am
by mol
What kind of message do you want to send?
Via e-mail, network to another station?

Re: how to send messages using programming in "C"

Posted: Wed Apr 11, 2012 10:25 am
by salamandra
Hi Jair :) ,
Please take a look at the following folders:

1) To send data between 02 apps.
C:\hmg.3.0.xx\SAMPLES\COMM.01
C:\hmg.3.0.xx\SAMPLES\COMM.02

2) A Messenger like app:
C:\hmg.3.0.xx\SAMPLES\HMGTALK.


[]´s Salamandra

Re: how to send messages using programming in "C"

Posted: Wed Apr 11, 2012 3:48 pm
by jairpinho
expressed myself wrong, I want to see done in post code in "C" equals msginfo () HMG

HB_FUNC( teste )

{
int x = 10;
int y = 10;
printf("result x %d", x ) && - >>>>> does not work

}

Re: how to post messages using programming in "C"

Posted: Wed Apr 11, 2012 6:07 pm
by Pablo César
Jair, lembre que você está colocando uma função em C que exibe em modo console.
Experimente assim:

Jair, remember that you are putting a C function that displays in console mode.
Try this:

Code: Select all

REQUEST HB_GT_WIN_DEFAULT

Function Main()
SetMode(25,80)
cls
@ 00,00 to 24,79 double
teste()
inkey(0)
Return

#PRAGMA BEGINDUMP

#include "hbapi.h"
#include <stdio.h>

HB_FUNC( TESTE )
{
int x = 10;
int y = 10;
printf("resultado: x + y = %d", x+y ) ;
}

#PRAGMA ENDDUMP

Re: how to post messages using programming in "C"

Posted: Wed Apr 11, 2012 6:15 pm
by jairpinho
EN
Yes I understand but do not have as vilsualizar in a command prompt window in console mode need to debug the code in C and the only way to know what it's doing my code would be send via printf () or accept another command that in HMG


PT-BR
sim eu entendo mas não tem como vilsualizar em uma janela de prompt em modo console preciso depurar o codigo em C e a unica maneira de saber o que esta fazendo o meu codigo seria enviar via printf() ou outro comando que aceite em HMG

Re: how to post messages using programming in "C"

Posted: Wed Apr 11, 2012 6:31 pm
by Pablo César
Veja agora, compile o código fonte que tinha postado.

See now, please compile my source code posted before.

Re: how to post messages using programming in "C"

Posted: Wed Apr 11, 2012 7:05 pm
by jairpinho
não funcionou

not work




Pablo César wrote:Veja agora, compile o código fonte que tinha postado.

See now, please compile my source code posted before.

Re: how to post messages using programming in "C"

Posted: Wed Apr 11, 2012 7:19 pm
by Pablo César
For me it is working ! See attached files, you can execute .exe

Re: how to post messages using programming in "C"

Posted: Wed Apr 11, 2012 8:04 pm
by jairpinho
HMG in 3.0.xx IDE does not perform the function

Pablo César wrote:For me it is working ! See attached files, you can execute .exe