Click here to Skip to main content
15,894,106 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to migrate from an MFC application (GUI witch reads write through a kernel driver to a USB device) to a VC++.NET win form application. But when I include the setupapi.h file in the stdafx.h the following errors are produced

MSIL
1>Compiling...
1>stdafx.cpp
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\setupapi.h(60) : error C2143: syntax error : missing ';' before '*'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\setupapi.h(60) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\setupapi.h(60) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\spapidef.h(23) : error C2146: syntax error : missing ';' before identifier 'SP_LOG_TOKEN'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\spapidef.h(23) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\spapidef.h(23) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\commctrl.h(19) : error C2059: syntax error : 'return'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\prsht.h(97) : error C2065: 'CALLBACK' : undeclared identifier
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\prsht.h(97) : error C2065: 'LPFNPSPCALLBACKA' : undeclared identifier
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\prsht.h(97) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\prsht.h(97) : fatal error C1903: unable to recover from previous error(s); stopping compilation



any help????
Thanks Nick
Posted
Comments
Sergey Alexandrovich Kryukov 25-May-11 3:20am    
Gosh, what's the use of this dump? Without code... What are you thinking about..?
--SA

I manage to solve the problem by include the following headers:
XML
#include <windows.h>
#include <strsafe.h>
#include <setupapi.h>

Regards Nick
 
Share this answer
 
This is beyond good and evil, honestly. Please see my comment to the question.

OK, when it says "missing ;" add ';' where compiler expects it. Make it happy! :-)
After you hit a brick wall, start thinking at the situation, in case you did not switch this function before (well, you don't really need to thing to add all those ';').

C++ compiler messages can be very misleading, don't expect fast resolution. When you exhausted all your possibilities and fail to sort it out, well, ask a real question. It will need some code, of course. :-)

Note: do all us a favor: when you respond, skip the words "I'm new to programming" and the like. Just skip it. This is not an excuse, or just helpless.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900