Hi, Im quite new to SerilaPort handling.Im trying to open a serial communication on a particular COM port.Im able to Open a new one by using CreateFile(L\\\\.\\Com5, GENERIC_READ | GENERIC_WRITE, 0, // exclusive access NULL, // no security OPEN_EXISTING, 0, // no overlapped I/O NULL); But I want to do this by getting the user input on the console ,say 'x' COM and then initialize it.Kindly help me with the way i should concatenate the com number'x' with L\\\\.\\Com .

Member Avatar
Member Avatar
+0 forum 4

Hello i have a printer cable that i connect to it some LEDs . i want to use CreateFile and WriteFile functions but i don't know that i should use LPT1 and LPT2 or COM1 and COM2 in CreateFile function. h = CreateFile( L"LPT1", // pointer to name of the file GENERIC_WRITE, // access (read-write) mode 0, // share mode NULL, // pointer to security attributes OPEN_EXISTING, // how to create FILE_ATTRIBUTE_NORMAL, // file attributes NULL // handle to file with attributes to copy );

Member Avatar
Member Avatar
+0 forum 3

This code should read in some data from sector zero off of a USB flash drive, then print out some of the data. However when I run it there is nothing that was put in the buffer. int _tmain(int argc, _TCHAR* argv[]) { int ReadSect = 0; char diskname[60]; sprintf_s(diskname, "\\\\.\\K:", 'K'); HANDLE DiskHandle = CreateFile((LPCTSTR) diskname , GENERIC_READ,FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); // set up the offsets for the addresses passed to setFilePointer, and ReadFile long lo_offset, hi_offset; LPDWORD temp = 0; lo_offset = ReadSect << 9; hi_offset = ReadSect >> 23; (void) SetFilePointer( DiskHandle, 0, &hi_offset, FILE_BEGIN); char …

Member Avatar
Member Avatar
+0 forum 1

I have a problem getting my assembly program designed to get the first 47 numbers of the fibonacci series to output to a file. I'm not getting any errors except for when opening command window. This is the exact question on my homework problem if this helps : Using Programming Exercise 6 in Chapter 4 as a starting point, write a program that generates the first 47 values in the Fibonacci series, stores them in an array of doublewords, and writes the doubleword array to a disk file. You need not perform any error checking on the file inputoutput because …

Member Avatar
Member Avatar
+0 forum 4

Hello Everyone !!!! [COLOR="Red"][B]Is It Possible To Create JSP at A runtime ?[/B][/COLOR] It Means Can we Get The Data From One JSP And then Show it on another JSP which is Generated [B]By Coding [/B]Through Runtime ? Please Help......:S

Member Avatar
Member Avatar
+0 forum 1

Hello, I am encountering a problem when I try to connect to my webcam using CreateFile. Using the SetupApi, I found the interface path of my webcam: \\?\usb#vid_03f0&pid_5d11&mi_00#6&aad3e6&0&0000#{6bdd1fc6-810f-11d0-bec7-08002be2092f} According to the MSDN documentation I supposed that when I use this interface path in CreateFile, I will be able to read from the webcam. But when I use: [CODE] CreateFileA(detInfo->DevicePath,GENERIC_READ,FILE_SHARE_READ,0,CREATE_ALWAYS,FILE_FLAG_OVERLAPPED,0); [/CODE] GetLastError will return "2": ERROR_FILE_NOT_FOUND What's wrong?

Member Avatar
+0 forum 0

The End.