Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: causing a CScrollView to scroll by dragging the mouse outside client area Pin
Ryan Binns23-Feb-04 21:57
Ryan Binns23-Feb-04 21:57 
GeneralHelp Pin
Goh Hui Beng22-Feb-04 14:00
Goh Hui Beng22-Feb-04 14:00 
GeneralRe: Help Pin
Ravi Bhavnani22-Feb-04 14:37
professionalRavi Bhavnani22-Feb-04 14:37 
GeneralRe: Help Pin
Goh Hui Beng22-Feb-04 15:52
Goh Hui Beng22-Feb-04 15:52 
GeneralRe: Help Pin
Steve S22-Feb-04 22:25
Steve S22-Feb-04 22:25 
GeneralDocument/View Architecture - having 1doc and 2 Views Pin
Ehsan Baghaki22-Feb-04 13:42
Ehsan Baghaki22-Feb-04 13:42 
GeneralRe: Document/View Architecture - having 1doc and 2 Views Pin
Ehsan Baghaki22-Feb-04 22:18
Ehsan Baghaki22-Feb-04 22:18 
GeneralParallel port & EPP Pin
jane69smith22-Feb-04 11:14
jane69smith22-Feb-04 11:14 
I am working on an external device that I'm trying to interface through the parallel port. To get adequate speeds, I'm looking to use EPP instead of regular CENTRONICS. The problem is, I get the following output when I try to write to the port after negotiating the protocol.

<br />
Opening LPT1... OK<br />
Querying LPT1 Status...<br />
Status: 80<br />
Setting EPP Mode...<br />
Querying LPT1 Mode...<br />
Read Status: 40<br />
Write Status: 40<br />
Sending data...<br />
Error: Incorrect function.<br />
<br />
Sent 0 values<br />
Sending complete...<br />


The Read and Write status indicate that I've negotiated to EPP. However, I get the shown error. Here is the code snippet of what I'm doing
<br />
printf("Opening LPT1...\t");<br />
hParPort = CreateFile("LPT1", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);<br />
<br />
printf("Querying LPT1 Status...\n");<br />
PAR_QUERY_INFORMATION ParInfo;<br />
DeviceIoControl(hParPort, IOCTL_PAR_QUERY_INFORMATION, NULL, 0, &ParInfo, sizeof(ParInfo), &ret, NULL);<br />
printf("Status: %x \n", ParInfo.Status);<br />
<br />
printf("Setting EPP Mode...\n");<br />
PARCLASS_NEGOTIATION_MASK parMode;<br />
PARCLASS_NEGOTIATION_MASK parModeBack;<br />
parMode.usReadMask = EPP_ANY;<br />
parMode.usWriteMask = EPP_ANY;<br />
DeviceIoControl(hParPort, IOCTL_IEEE1284_NEGOTIATE, &parMode, sizeof(parMode), &parModeBack, sizeof(parModeBack), &ret, NULL);<br />
printf("Read Status: %x \n", parModeBack.usReadMask);<br />
printf("Write Status: %x \n", parModeBack.usWriteMask);<br />
<br />
printf("Sending data...\n");<br />
<br />
if(!WriteFile(hParPort, data, 1, &ret, NULL))<br />
{<br />
    //--- Print FormatMessage(GetLastError()) ---<br />
}<br />
printf("Sent %d values \n", ret);<br />
printf("Sending complete...\n");<br />
CloseHandle(hParPort)<br />


Any ideas as to why I get an invalid function and what I can try instead of WriteFile?




Jane
QuestionHow to determine whether master volume is enabled? Pin
Artem Moroz22-Feb-04 10:48
Artem Moroz22-Feb-04 10:48 
GeneralDestructing an exception Pin
Ravi Bhavnani22-Feb-04 9:57
professionalRavi Bhavnani22-Feb-04 9:57 
GeneralRe: Destructing an exception Pin
Artem Moroz22-Feb-04 10:51
Artem Moroz22-Feb-04 10:51 
GeneralRe: Destructing an exception Pin
Ravi Bhavnani22-Feb-04 10:56
professionalRavi Bhavnani22-Feb-04 10:56 
Generaldisplaying in string in hex Pin
lyn22-Feb-04 7:35
lyn22-Feb-04 7:35 
GeneralRe: displaying in string in hex Pin
Ehsan Baghaki22-Feb-04 13:53
Ehsan Baghaki22-Feb-04 13:53 
GeneralBitmap Operate On Window 98 Pin
Best Friend22-Feb-04 6:11
Best Friend22-Feb-04 6:11 
GeneralRe: Bitmap Operate On Window 98 Pin
Ryan Binns22-Feb-04 17:32
Ryan Binns22-Feb-04 17:32 
GeneralRe: Bitmap Operate On Window 98 Pin
Best Friend22-Feb-04 18:40
Best Friend22-Feb-04 18:40 
GeneralRe: Bitmap Operate On Window 98 Pin
sps-itsec4622-Feb-04 23:18
sps-itsec4622-Feb-04 23:18 
GeneralRe: Bitmap Operate On Window 98 Pin
Best Friend23-Feb-04 3:15
Best Friend23-Feb-04 3:15 
GeneralRe: Bitmap Operate On Window 98 Pin
sps-itsec4623-Feb-04 7:22
sps-itsec4623-Feb-04 7:22 
Generalthe windows interface Pin
Anonymous22-Feb-04 3:56
Anonymous22-Feb-04 3:56 
GeneralRe: the windows interface Pin
Irish_GUI22-Feb-04 6:10
Irish_GUI22-Feb-04 6:10 
GeneralMicrosoft Chart in Visual c++ Pin
krugger22-Feb-04 3:55
krugger22-Feb-04 3:55 
GeneralRe: Microsoft Chart in Visual c++ Pin
Ravi Bhavnani22-Feb-04 14:38
professionalRavi Bhavnani22-Feb-04 14:38 
Generaldialog parent window pointer Pin
Irish_GUI22-Feb-04 3:10
Irish_GUI22-Feb-04 3:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.