How to define a parameter

How to define a parameter

Postby Otto » Sun Jan 02, 2011 10:08 pm

Can someone help me to pass the parameter to the messageBox.
I would like to show cTest inside the messagebox.

Thanks in advance
Otto

Code: Select all  Expand view  RUN

#include "FWCE.ch"
//----------------------------------------------------------------------------//
function Main()
   local oDlg, cText := "Hello world!   "
  local hReturn := ""

  hReturn = TESTFUNKTION( "216.117.77.7" )

  msginfo(hReturn)
   
return nil

//----------------------------------------------------------------------------//

#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

HB_FUNC( TESTFUNKTION )
{
   LPSTR cTest=  ( hb_parc( 1 ) ) ;
   
//MessageBox( GetActiveWindow(), ( char * ) cTest, ( char * ) cAgent,0);

//MessageBox (NULL,  _T( &cTest) , _T("Hello"), 0);

MessageBox (NULL,  _T("Hello") , _T("Hello"), 0);


hb_retc( ( char * ) cTest);
}

#pragma ENDDUMP
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Re: How to define a parameter

Postby Daniel Garcia-Gil » Mon Jan 03, 2011 1:57 am

Hello Mr. Otto

you need convert to wide

with Harbour try with hb_mbtowc (AnsiToWide)

Code: Select all  Expand view  RUN


#include "FWCE.ch"
//----------------------------------------------------------------------------//
function Main()
   local oDlg, cText := "Hello world!   "
  local hReturn := ""

  hReturn = TESTFUNKTION( "216.117.77.7" )

  msginfo(hReturn)
   
return nil

//----------------------------------------------------------------------------//

#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

HB_FUNC( TESTFUNKTION )
{
   WCHAR * cTest = hb_mbtowc( hb_parc( 1 ) ) ;
   
   MessageBox ( 0, cTest , cTest, 0 );
   
   HB_TCHAR_FREE( cTest );

}

#pragma ENDDUMP

 


i didn't tested...
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 4 guests