Home » Developer & Programmer » Forms » How to call c++ code in forms 6i (database10g,forms 6i)
How to call c++ code in forms 6i [message #541063] Fri, 27 January 2012 06:40 Go to next message
mughals_king
Messages: 392
Registered: January 2012
Location: pakistan
Senior Member
can anyone tell how to call this c++ code by using forms 6i


To open and configure the COM port:


HANDLE hCom;
COMMTIMEOUTS lpTo;
COMMCONFIG lpCC;

char str_com[10];
unsigned short no_com = 0;


sprintf( str_com, "\\\\.\\COM%d\0", no_com+1);
hCom = CreateFile(str_com,GENERIC_READ|GENERIC_WRITE,0,NULL,
OPEN_EXISTING,FILE_FLAG_OVERLAPPED,NULL);
GetCommState( hCom, &lpCC.dcb);

/* Initialisation des parametres par defaut */
lpCC.dcb.BaudRate = CBR_9600;
lpCC.dcb.ByteSize = 8;
lpCC.dcb.StopBits = ONESTOPBIT;
lpCC.dcb.Parity = NOPARITY;

lpCC.dcb.fDtrControl = DTR_CONTROL_DISABLE;
lpCC.dcb.fRtsControl = RTS_CONTROL_DISABLE;
SetCommState( hCom, &lpCC.dcb );

GetCommTimeouts(hCom,&lpTo);
lpTo.ReadIntervalTimeout = 0;
lpTo.ReadTotalTimeoutMultiplier = 10;
lpTo.ReadTotalTimeoutConstant = 10;
lpTo.WriteTotalTimeoutMultiplier = 10;
lpTo.WriteTotalTimeoutConstant = 100;
SetCommTimeouts(hCom,&lpTo);

SetupComm(hCom,2048,2048);

To close the port :

CloseHandle(hCom);

To monitor communications events :


SetCommMask(hCom, dwEvtMask );

dwEvtMask is logical or with :
EV_BREAK, EV_CTS, EV_DSR, EV_ERR, EV_RING, EV_RLSD , EV_RXCHAR, EV_RXFLAG, EV_TXEMPTY values

and used WaitCommEvent function

BOOL WaitCommEvent(
HANDLE hFile,
LPDWORD lpEvtMask,
LPOVERLAPPED lpOverlapped
);


kindly explain step by step

thanks

[Updated on: Fri, 27 January 2012 06:44]

Report message to a moderator

Re: How to call c++ code in forms 6i [message #542505 is a reply to message #541063] Tue, 07 February 2012 11:08 Go to previous message
mughals_king
Messages: 392
Registered: January 2012
Location: pakistan
Senior Member
all gurus waiting for answer


Thanks in Advance


Previous Topic: Report Calling From Parameter Form 6i
Next Topic: Unable to solve foreign Key problem
Goto Forum:
  


Current Time: Tue Jul 09 18:11:20 CDT 2024