how to post messages using programming in "C"

Moderator: Rathinagiri

User avatar
jairpinho
Posts: 420
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Contact:

how to post messages using programming in "C"

Post 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.
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: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

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

Post by mol »

What kind of message do you want to send?
Via e-mail, network to another station?
User avatar
salamandra
Posts: 311
Joined: Thu Jul 31, 2008 8:33 pm
DBs Used: DBF, MySQL, SQL
Location: Brazil

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

Post 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
There is one time in which is crucial awakening. That time is now. ( Buddha )
User avatar
jairpinho
Posts: 420
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Contact:

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

Post 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

}
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

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

Post 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
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: 420
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Contact:

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

Post 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
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

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

Post by Pablo César »

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: 420
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Contact:

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

Post 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.
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

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

Post by Pablo César »

For me it is working ! See attached files, you can execute .exe
Attachments
CCode.rar
(374.52 KiB) Downloaded 430 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
jairpinho
Posts: 420
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Contact:

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

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