how to post messages using programming in "C"

Moderator: Rathinagiri

User avatar
jairpinho
Posts: 209
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Been thanked: 1 time
Contact:

how to post messages using programming in "C"

Post by jairpinho » Wed Apr 11, 2012 1:04 am

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.
Last edited by jairpinho on Wed Apr 11, 2012 3:49 pm, edited 1 time in total.
Jair Pinho
HMG ALTA REVOLUÇÃO xBASE
HMG xBASE REVOLUTION HIGH
http://www.hmgforum.com.br

User avatar
mol
Posts: 2872
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 133 times
Been thanked: 66 times
Contact:

Post by mol » Wed Apr 11, 2012 6:01 am

What kind of message do you want to send?
Via e-mail, network to another station?

User avatar
salamandra
Posts: 130
Joined: Thu Jul 31, 2008 8:33 pm
Location: Brazil
Has thanked: 1 time

Post by salamandra » Wed Apr 11, 2012 10:25 am

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
There is one time in which is crucial awakening. That time is now. ( Buddha )

User avatar
jairpinho
Posts: 209
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Been thanked: 1 time
Contact:

Post by jairpinho » Wed Apr 11, 2012 3:48 pm

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

}
Jair Pinho
HMG ALTA REVOLUÇÃO xBASE
HMG xBASE REVOLUTION HIGH
http://www.hmgforum.com.br

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 177 times

Post by Pablo César » Wed Apr 11, 2012 6:07 pm

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
Last edited by Pablo César on Wed Apr 11, 2012 6:32 pm, edited 2 times in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
jairpinho
Posts: 209
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Been thanked: 1 time
Contact:

Post by jairpinho » Wed Apr 11, 2012 6:15 pm

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
Jair Pinho
HMG ALTA REVOLUÇÃO xBASE
HMG xBASE REVOLUTION HIGH
http://www.hmgforum.com.br

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 177 times

Post by Pablo César » Wed Apr 11, 2012 6:31 pm

Veja agora, compile o código fonte que tinha postado.

See now, please compile my source code posted before.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
jairpinho
Posts: 209
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Been thanked: 1 time
Contact:

Post by jairpinho » Wed Apr 11, 2012 7:05 pm

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.
Jair Pinho
HMG ALTA REVOLUÇÃO xBASE
HMG xBASE REVOLUTION HIGH
http://www.hmgforum.com.br

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 177 times

Post by Pablo César » Wed Apr 11, 2012 7:19 pm

For me it is working ! See attached files, you can execute .exe
Attachments
CCode.rar
(374.52 KiB) Downloaded 140 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
jairpinho
Posts: 209
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Been thanked: 1 time
Contact:

Post by jairpinho » Wed Apr 11, 2012 8:04 pm

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
Jair Pinho
HMG ALTA REVOLUÇÃO xBASE
HMG xBASE REVOLUTION HIGH
http://www.hmgforum.com.br

Post Reply