Click here to Skip to main content
15,912,977 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to run a programm from memory location Pin
Anonymous22-Feb-04 20:32
Anonymous22-Feb-04 20:32 
AnswerRe: How to run a programm from memory location Pin
Monty223-Feb-04 0:24
Monty223-Feb-04 0:24 
GeneralRe: How to run a programm from memory location Pin
Prakash Nadar23-Feb-04 0:50
Prakash Nadar23-Feb-04 0:50 
GeneralRe: How to run a programm from memory location Pin
Monty223-Feb-04 2:11
Monty223-Feb-04 2:11 
GeneralRe: How to run a programm from memory location Pin
Prakash Nadar23-Feb-04 3:05
Prakash Nadar23-Feb-04 3:05 
QuestionHow to load Child Dialog before program Pin
catngo22-Feb-04 20:19
catngo22-Feb-04 20:19 
AnswerRe: How to load Child Dialog before program Pin
Balkrishna Talele22-Feb-04 23:58
Balkrishna Talele22-Feb-04 23:58 
GeneralRe: How to load Child Dialog before program Pin
catngo23-Feb-04 21:49
catngo23-Feb-04 21:49 
GeneralSocket problem... Pin
Prakash Nadar22-Feb-04 19:34
Prakash Nadar22-Feb-04 19:34 
GeneralRe: Socket problem... Pin
Anonymous22-Feb-04 21:02
Anonymous22-Feb-04 21:02 
GeneralRe: Socket problem... Pin
Prakash Nadar22-Feb-04 21:56
Prakash Nadar22-Feb-04 21:56 
Generalcausing a CScrollView to scroll by dragging the mouse outside client area Pin
mickelliot22-Feb-04 14:07
mickelliot22-Feb-04 14:07 
GeneralRe: causing a CScrollView to scroll by dragging the mouse outside client area Pin
Ryan Binns22-Feb-04 17:19
Ryan Binns22-Feb-04 17:19 
GeneralRe: causing a CScrollView to scroll by dragging the mouse outside client area Pin
mickelliot23-Feb-04 5:06
mickelliot23-Feb-04 5:06 
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 

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.