ReadFile error for HID device

Hi,

I am going to write driver for my HID USB device. The USB device
reports data periodically for 100ms. However, when I use ReadFile
function to read data, an error with code 1784 returned.

:
:

if(!ReadFile(hidHandle, recvDataBuf, RECV_DATA_LEN, &recvdBytes, &ol))
{         
						DWORD err = GetLastError();
            if(err != ERROR_IO_PENDING && err !=
ERROR_DEVICE_NOT_CONNECTED && g_KeepGoing)
            {
                msg.Format("Read File error code: %d", err);
                AfxMessageBox(msg);
                goto exit1;
            }
:
:

Anyone has idea about that?
0
leonlai2k (5)
9/16/2004 10:55:42 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
2654 Views

Similar Articles

[PageSpeed] 45

        1784 is ERROR_INVALID_USER_BUFFER ( The supplied user buffer is not
valid for the requested operation.). Make sure your recvDataBuf is correct.

-- 
Cheers
Check Abdoul [VC++ MVP]
-----------------------------------

"terry" <leonlai2k@yahoo.com> wrote in message
news:9904d48.0409160255.7bc5f739@posting.google.com...
> Hi,
>
> I am going to write driver for my HID USB device. The USB device
> reports data periodically for 100ms. However, when I use ReadFile
> function to read data, an error with code 1784 returned.
>
> :
> :
>
> if(!ReadFile(hidHandle, recvDataBuf, RECV_DATA_LEN, &recvdBytes, &ol))
> {
> DWORD err = GetLastError();
>             if(err != ERROR_IO_PENDING && err !=
> ERROR_DEVICE_NOT_CONNECTED && g_KeepGoing)
>             {
>                 msg.Format("Read File error code: %d", err);
>                 AfxMessageBox(msg);
>                 goto exit1;
>             }
> :
> :
>
> Anyone has idea about that?


0
CheckAbdoul
9/16/2004 1:25:51 PM
"CheckAbdoul" <checkabdoul at mvps dot org> wrote in message news:<uviEzD$mEHA.592@TK2MSFTNGP11.phx.gbl>...
> 1784 is ERROR_INVALID_USER_BUFFER ( The supplied user buffer is not
> valid for the requested operation.). Make sure your recvDataBuf is correct.
> 
> -- 
> Cheers
> Check Abdoul [VC++ MVP]
> -----------------------------------
> 
> "terry" <leonlai2k@yahoo.com> wrote in message
> news:9904d48.0409160255.7bc5f739@posting.google.com...
> > Hi,
> >
> > I am going to write driver for my HID USB device. The USB device
> > reports data periodically for 100ms. However, when I use ReadFile
> > function to read data, an error with code 1784 returned.
> >
> > :
> > :
> >
> > if(!ReadFile(hidHandle,recvDataBuf,RECV_DATA_LEN,&recvdBytes, &ol))
> > {
> > DWORD err = GetLastError();
> >             if(err != ERROR_IO_PENDING && err !=
> > ERROR_DEVICE_NOT_CONNECTED && g_KeepGoing)
> >             {
> >                 msg.Format("Read File error code: %d", err);
> >                 AfxMessageBox(msg);
> >                 goto exit1;
> >             }
> > :
> > :
> >
> > Anyone has idea about that?

After increasing the buffer size of recvDataBuf, I find the error
above is solved. However, the program loops infinitely and seems to
read no data. However, I have checked the usb device using SnoopyPro
that it really send out data periodically.

while(WaitForSingleObject(hIOWaiter,1000)==WAIT_TIMEOUT)
{
  if(!g_KeepGoing)
  {
    if(hidHandle!=INVALID_HANDLE_VALUE) 
    {
      CancelIo(hidHandle);
    }
    goto exit1;
  }
}

Thanks!
0
leonlai2k (5)
9/17/2004 5:26:11 AM
Could anyone help me?
0
leonlai2k (5)
10/9/2004 1:44:32 PM
Reply:

Similar Artilces:

post sp2 smtp errors on IMF
2003 server sp1 , exchange 2003 sp2 finished cleanly i configured IMF ( once Bharat Suneja showed me where!); i am now getting the following errors; i have searched but found no reference that seams pertinent ( to me ) . Any suggestions would be appreciated. TIA. i might add that the IMF 1.0 was NOT previous installed Event Type: Error Event Source: MSExchangeTransport Event Category: SMTP Protocol Event ID: 7514 Date: 11/15/2005 Time: 6:48:41 PM User: N/A Computer: AZMAIL Description: An error occurred while loading Microsoft Exchange Intelligent Message Filter. The error code is 0x800...

Clean free busy error Outlook 2000/2003
"unable to save free/busy information" is the error that I am starting to see on a number of different users workstations. They are trying to add information into another users calendar which they have the appropriate access to. I have tried the clean free busy switch that is all over the Internet (on both the users side and the user attempting access), removed and then re-added the permissions to the calendar, also tried office SP1 and 2, also changed their user profiles with no change. It is only happening to a few users but the number is starting to grow and we are starting to w...

Syntax error in CREATE TABLE statement. (Error 3290)
I am trying to Create a table from DDL code. Upon running the query I get the error: Syntax error in CREATE TABLE statement. (Error 3290) Here is my code after making many changes to it: CREATE TABLE ACCOUNTABILITY ( OBJECTID number (22) NOT NULL, OBJECTOWNERID decimal (22), COMMISOID decimal (22), RESPONOID decimal (22), COMMISOBJECTTYPE CHARACTER (5), RESPONOBJECTTYPE CHARACTER (5), ACCOUNTYPEOID decimal (22), BEGINDATE TIMESTAMP, ENDDATE TIMESTAMP, OBJECTTYPE CHARACTER (5), ACL decimal (22), REPLICNUMBER INTEGER, ROW...

Bullshit error message
Hi I am trying to run the following code: - Dim db As Database Dim RST_Out As Recordset '#### the results table TTEMP_CampaignRunResults Dim RST_IN As Recordset '#### the Campaign Customer TM_CampaignCustomers Dim INT_Count As Integer '#### this holds the count of how many records are added '####################################################################################################################### '#### this is the final bit where we place all the records selected by the queries into the cam...

error 0x800ccc17
I use comcast high-speed cable and can't use my outlook 2000 with this. I'm running windows XP. I get an error message 0x800ccc17. This is an outlook express error message. I'm at a loss. Can anyone help me out? Is outlook 2000 compatible with windows XP or does the problem lie with the Comcast cable? Rich ...

Access 2007 Run-time Error 2467 when accessing a listbox value on a sub form
I have a database that has been in production on Access 2003 for quite some time and has run without errors. A user's machine was recently upgraded to Access 2007 and now the database throughs a Run-time Error 2467 "The Expression you entered referes to an object that is closed or does not exist" on the following line that references a listbox value on a sub form. If Nz(Me.sfrm_Consultant_Contract_Request.Form.Cmb_Consultant.Value) = "" Then .. .. .. I changed the code to If Nz(Forms! frm_Main.sfrm_Consultant_Contract_Request.Form.Cmb_Consultant.Value) = ""...

Mail Merge Error #3
Hi All, When I send mail merge on campaign using outlook - CRM i always got error message: A SQL Server error. Check Microsoft Dynamic CRM Community for Solutions any response would be appreciate. Thanks KS ...

VBA Error
I have a database that I use on a desktop and everything works fine. When I bring the database file to a laptop I get errors trying to open some reports. Bot desktop and laptop are running Windows 7 64 bit operating system. IN VB the highlighted code is: Function Concatenate(pstrSQL As String, _ Optional pstrDelim As String = ", ") _ As String Is there a specific reason this is doing that on the laptop? Any help is greatly appreciated. "S" <S@discussions.microsoft.com> wrote in message news:A96AD53E-A4CD-4715-A024-58673AA9B23A@mic...

Error Error my framework is not loading
Help, just installed Office / Mac 2004 for word...... every time I open it I = get an=20 error of "problem loading the framework library?" HELP ! Any thoughts Thanks in advance Larry Hi Larry: See here: http://support.microsoft.com/default.aspx?scid=kb;EN-US;321386 Regards On 28/9/04 2:54 AM, in article 21fe01c4a4b2$b967d460$a501280a@phx.gbl, "anonymous@discussions.microsoft.com" <anonymous@discussions.microsoft.com> wrote: > Help, > just installed Office / Mac 2004 for word...... every time I open it I get an > error of "problem loading the fr...

Error when call web service
I've written an aspx page to access crmService to create new records for entity. After I compile the program, and run the page, it works fine. But after running for a few times, there is error when using crmService. Error: The underlying connection was closed. or [WebException: The operation has timed-out.] System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request) +58 System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request) +5 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] par...

Outlook 2002 & Runtime Error
I installed Outlook 2002 for my Ipaq on my computer. My computer came with 0utlook Express installed. Outlook 2002 will not run, it gives me an error message about a runtime error and I cannot get into Outlook. I have also installed Franklin's PlanPlus which runs on top of Outlook. Any suggestions? Thanks in advance, Reggie 1) what is the runtime error? look for it in the event log... 2) is outlook set as the default mail client? 3) did outlook work correctly before you installed planplus? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauth...

RMS Store Ops version and errors
I recently upgraded QS2K to RMS Store Ops and added HQ and an additional site. I've had all kinds of problems. When I do a cash drop, it shows up on the receipt as a pay out - end result my drawer ends up off by double the amount of the drop. When entering items on the HQ Manager - if you click outside the field, it crashes. When I purchased the upgrade, all I received was a demo disk and a dongle. I can't help but feel that I should have received a more up to date version of the software than the demo disk. Is this the normal way that RMS is distributed (demo and dongle)? ...

MSmoney error
After entering password to enter MS Money 2001, I get this error: "Msmoney has caused an error in OLEAUT32.dll" I can't even get in to find my PID # to get online support! Any info? (This occurred after computer came back up after 10 days down without power due to the hurricane. Seemed fine before then) Can you open any other files or create a new file? If not, you may want to try removing and reinstalling Money and possibly reinstalling or updating/upgrading your version of Internet Explorer. "Cindy" <STEVEE56@msn.com> wrote in message news:075301c38e1b$...

Folks getting 552 error sending to our server?
Could the 552 error below possibly be caused by something other than a full mailbox? The users mailbox is NOT near quota? >552 Requested mail action >aborted: > exceeded storage allocation Are external users getting that message from your domain? What do you have in the mail path between the Internet and your exch server? On Thu, 16 Dec 2004 14:48:54 -0900, "Child" <dawg@alaskaSPAMFREE.com> wrote: >Could the 552 error below possibly be caused by something other than a full >mailbox? The users mailbox is NOT near quota? > > > > > &...

287 errors redux
Sorry to repost but this is what the technet folks told me to do... I'm getting regular 287 errors in my system logs for my exchange 5.5 server. They occur almost by the minute, and in each case merely seem to indicate messages are being rerouted from one MTA on an exchange server to another. Since I know the amount of internal e-mail isn't that high, is there some reason for this? Here's a sample: Event Type: Information Event Source: MSExchangeMTA Event Category: X.400 Service Event ID: 287 Date: 9/13/2005 Time: 11:21:18 AM User: N/A Computer: VXXX Description: Message C=us;...

"ERROR: Posting to table ..." message
A user had their computer crash while they were posting receiving transactions. When they rebooted and logged back into Great Plains, they got a message that posting was interupted but they click OK to continue posting. The following messages were found on the Receivings Posting Journals: "ERROR: Posting to table POP30390. Restore from a backup if possible." "ERROR: Posting to table POP30310. Restore from a backup if possible." They appear to be for one transaction, not for the entire batch. I looked in inquiry, the transaction is there under historical rec...

Registry errors/repair
I've read some posts in this group about cleaning the registry of "registry errors". I have used a program on occasion to "clean" the registry but I am questioning the need for this after reading some of the posts here. Is this something that should be done at any time, or is it something that is just more "BS"? I have been asked to write a report on registry errors and the reasons behind them as well as how and why to fix them. TIA for your time and help. Justin I would ask whomever commissioned the report to define what constitutes "regi...

LockBox error
We are trying to use the lockbox module in GP 9.0 and when we use the file from the bank we are receiving the following error: "Unhandled script exception Invalid year '1493' in date function." This appears to be coming from the type 6 record which doesn't have any date related information in it. An thoughts? Thanks ...

Error
I have two investment accounts. Both have the same stock. When I enter the symbol in the second account, I get an Error Message "Symbol in Use." Anyone know why this occurs and how two investment accounts can hold the same stock. When asked for the symbol, don't type it in but use the drop down menu. -- Regards Bob Peel, Microsoft MVP - Money Hints/Tips http://support.microsoft.com/default.aspx?scid=fh;EN-GB;mny UK Wishes/Suggestions mnyukwsh@microsoft.com "Scott" <anonymous@discussions.microsoft.com> wrote in message news:06d701c39540$e8...

Linker error LNK2005
nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *,int,char const *,int)" (??3@YAXPAXHPBDH@Z) already defined in KomodiaInfraLib.lib(OSManager.obj) nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete[](void *,int,char const *,int)" (??_V@YAXPAXHPBDH@Z) already defined in KomodiaInfraLib.lib(SocketThreadManager.obj) I have 3 different projects in my solution (VS.Net 2003). Two are static libraries, the third is an MFC dialog app. The KomodiaInfraLib above is one of the two static libraries, both part of a socket library I am ...

Exchange error #7
Hi All, Here is an error message I am getting A program is trying to access e-mail addresess you have stored in outlook. Do you want to allow this? If this is unexpected, it may be a virus and you should choose "No" I am trying to send several e-mails with a different program and getting the above error. Any idea how to prevent it? Thanks, Doron On Fri, 27 May 2005 09:04:45 -0400, "Doron Farber" <DF_XYZ@hotmail.com> wrote: >Hi All, > >Here is an error message I am getting > >A program is trying to access e-mail addresess you have stored in o...

Error 3144 syntax error in UPDATE statement
Why am I getting an error message? Here is the code, I have Access 2003. I am trying to select the appropriate table to update using a command button on a form. The form has the reference objects "grpSampleMonth and "txtCalYr". Private Sub btnTransFlag_Click() Dim SQL As String Dim FNSmo As String FNSmo = MonthName(Forms.frmLoadToFNS.grpSampleMonth, True) & txtCalYr SQL = "UPDATE tbl1FNS&FNSmo & SET TransFlag = ""0"" WHERE TransFlag Is Null " DoCmd.RunSQL SQL End Sub I tried this too - Privat...

691 error
Could someone please tell me how to fix the above error. It is telling me that access is denied as my username/password is not recognized on the domain. I have posted this question somewhere else but cannot find it. Thanks. You really need to give a bit more information...what application are you using, version etc... But, if I was you I would log onto webmail with my account to make sure you're using the right information...then deleted my account in my respective application, then re- add it... >-----Original Message----- >Could someone please tell me how to fix the abo...

Cannot Create File When That File Already Exists Installation Error
Hi, I'm running a test install of MSCRM on a VPC and I'm getting an error message that says Action Microsoft.Crm.Setup.Server.ConfigureServiceVirtualDirAction failed. Cannot create a file when that file already exists. It gives me the option to Retry, which immediately fails and displays the error again, and to Cancel, which will end the installation process early and show me a log, but the log doesn't say what file it is attempted to create that already exists. The VPC is the latest one (not the one that's coming out right NOW, but the last one). The server is running on S...

Calling ReadFile after DeviceIOControl (Unexpected Results)
Hi folks, I'm using "LPT1" via CreateFile for Overlapped communications. I use WaitSingleObject and then GetOverlapped Result to collect ReadFile results. All that code, including overlapped WriteFile's work great and have been for years. However, now I need to get the BUSY state of the port. It appears the only way to do this in the context of Win32 is via: DeviceIOControl(Handle, IOCTL_PAR_QUERY_INFORMATION, Nil, 0, @status, SizeOf(status), @OVERLAPPED); This call works great, repeated adnausem and yields the proper results every time, in realtime....