Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7959157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:31:43+00:00 2026-06-04T04:31:43+00:00

I took this code as example to write a service. And I made some

  • 0

I took this code
as example to write a service. And I made some changes in my main function in such a way to work with command line parameters and removed

#define UNICODE
#define WINVER 0x502 

Am using “MINGW”.

Am getting the following errors:

usb_detect.c: In function 'ServiceMain':
usb_detect.c:123:16: error: unknown type name 'DEV_BROADCAST_DEVICEINTERFACE'
usb_detect.c:132:41: error: request for member 'dbcc_size' in something not a structure or union
usb_detect.c:132:61: error: 'DEV_BROADCAST_DEVICEINTERFACE' undeclared (first use in this function)
usb_detect.c:132:61: note: each undeclared identifier is reported only once for each function it appears in
usb_detect.c:133:41: error: request for member 'dbcc_devicetype' in something not a structure or union
usb_detect.c:133:60: error: 'DBT_DEVTYP_DEVICEINTERFACE' undeclared (first use in this function)
usb_detect.c:136:117: error: 'DEVICE_NOTIFY_SERVICE_HANDLE' undeclared (first use in this function)
usb_detect.c:136:148: error: 'DEVICE_NOTIFY_ALL_INTERFACE_CLASSES' undeclared (first use in this function)

If I uncomment the unicode and winver there are no errors, but command line parameters are not working..
I included dbt.h too..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:31:44+00:00Added an answer on June 4, 2026 at 4:31 am

    The DEV_BROADCAST_DEVICEINTERFACE structure is only supported on Windows XP and later (as well as some of the other APIs that this code relies upon). It won’t be defined in the Windows headers unless you’re targeting that version of Windows or later.

    To make sure that it’s defined, you need to explicitly specify your target version of Windows at the top of your header file before you include Windows.h.

    The typical pattern looks something like this:

    #include <WinSDKVer.h>
    #define _WIN32_WINNT    _WIN32_WINNT_WINXP
    #include <SDKDDKVer.h>
    

    The original version of the code you tried had this line, which you removed:

    #define WINVER 0x502
    

    That explicitly set the target Windows version to Windows Server 2003 (Windows NT v5.2). Removing it means that you revert to the lowest common denominator, which is a version of Windows prior to XP, where the DEV_BROADCAST_DEVICEINTERFACE structure is not defined.

    It’s also not clear why you’re removing the UNICODE define. It’s 2012—any app you’re building should be targeting Unicode. Leave that defined as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I took some code from this Microsoft provided Example which allows me to
I took the code from this example. http://msdn.microsoft.com/en-us/library/2tw134k3.aspx What I am wondering (and I've
I have this modified code example I took from the wikipedia article on anonymous
I took this code straight from the w3 schools example, however, outside of their
Ok i have this piece of code from which i took from W3schools :-
I need to write some code that deals with generating and manipulating multivariable polynomials.
I have this old C++ COM component. I took the latest code base, built
Why is this CLLocationManager inside my singleton not working? I took this code http://jinru.wordpress.com/2010/08/15/singletons-in-objective-c-an-example-of-cllocationmanager/
I have the a function I took from this post which works great: private
I want to display a This page took x seconds widget at the bottom

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.