|
Well not a driver, but a USB HID device - so sort of a driver? I've got this credit card reader that is a USBHID device - so you need to use the WinDDK. Here's my story - I actually got this working in VC++ 6.0 about 3 years ago and now I can't figure out how to setup my project anymore. But that's just what I did - I created a COM object and linked to the DDK (from VC++ 6.0). Now I've upgraded to VC++ 2008 and just want to take the best route - if I have to learn the right way of doing it along the way, BONUS! I'm all ears. Just because I got it working before doesn't mean it was the best way of doing it anyway - and just the same, I can't get my project linked with MFC.
Current project settings: (with errors below)
Use MFC in a Static Library
Not Using ATL
Additional include directories:
C:\WinDDK\7600.16385.0\inc
C:\WinDDK\7600.16385.0\inc\api
C:\WinDDK\7600.16385.0\inc\crt
C:\WinDDK\7600.16385.0\inc\mfc42
C:\WinDDK\7600.16385.0\inc\ddk
C:\WinDDK\7600.16385.0\inc\api\dao360
Ignore standard include path: No
Additional library directories:
C:\WinDDK\7600.16385.0\lib\wxp\i386
C:\WinDDK\7600.16385.0\lib\Mfc\i386
C:\WinDDK\7600.16385.0\lib\ATL\i386
Additional dependencies:
ntdll.lib
msvcrtd.lib
Errors:
1>Linking...
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/RELEASE' specification
1>LINK : warning LNK4075: ignoring '/DELAYLOAD' due to '/DRIVER' specification
1>MathHelper.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/DRIVER' specification
1> Creating library C:\dev\USBHIDCardReader\Debug\USBHIDCardReader.lib and object C:\dev\USBHIDCardReader\Debug\USBHIDCardReader.exp
1>LINK : error LNK2001: unresolved external symbol _DriverEntry
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol __afxForceEXCLUDE
1>MathHelper.obj : error LNK2001: unresolved external symbol __afxForceEXCLUDE
1>stdafx.obj : error LNK2001: unresolved external symbol __afxForceEXCLUDE
1>StringHelper.obj : error LNK2001: unresolved external symbol __afxForceEXCLUDE
1>USBHIDCardReader.obj : error LNK2001: unresolved external symbol __afxForceEXCLUDE
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol __afxForceUSRDLL
1>MathHelper.obj : error LNK2001: unresolved external symbol __afxForceUSRDLL
1>stdafx.obj : error LNK2001: unresolved external symbol __afxForceUSRDLL
1>StringHelper.obj : error LNK2001: unresolved external symbol __afxForceUSRDLL
1>USBHIDCardReader.obj : error LNK2001: unresolved external symbol __afxForceUSRDLL
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: __thiscall CString::~CString(void)" (??1CString@@QAE@XZ) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,char,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HDH@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::~CString(void)" (??1CString@@QAE@XZ)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::~CString(void)" (??1CString@@QAE@XZ)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: __thiscall CString::CString(class CString const &)" (??0CString@@QAE@ABV0@@Z) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,char,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HDH@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::CString(class CString const &)" (??0CString@@QAE@ABV0@@Z)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::CString(class CString const &)" (??0CString@@QAE@ABV0@@Z)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: void __cdecl CString::Format(char const *,...)" (?Format@CString@@QAAXPBDZZ) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,char,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HDH@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: void __cdecl CString::Format(char const *,...)" (?Format@CString@@QAAXPBDZZ)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: void __cdecl CString::Format(char const *,...)" (?Format@CString@@QAAXPBDZZ)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: __thiscall CString::CString(void)" (??0CString@@QAE@XZ) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,char,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HDH@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::CString(void)" (??0CString@@QAE@XZ)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::CString(void)" (??0CString@@QAE@XZ)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: class CString const & __thiscall CString::operator+=(char)" (??YCString@@QAEABV0@D@Z) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,class CString,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HV2@H@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: class CString const & __thiscall CString::operator+=(char)" (??YCString@@QAEABV0@D@Z)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: class CString const & __thiscall CString::operator+=(char)" (??YCString@@QAEABV0@D@Z)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: int __thiscall CString::Find(char,int)const " (?Find@CString@@QBEHDH@Z) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,class CString,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HV2@H@Z)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: int __thiscall CString::GetLength(void)const " (?GetLength@CString@@QBEHXZ) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,class CString,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HV2@H@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: int __thiscall CString::GetLength(void)const " (?GetLength@CString@@QBEHXZ)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: int __thiscall CString::GetLength(void)const " (?GetLength@CString@@QBEHXZ)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: __thiscall CString::CString(char const *)" (??0CString@@QAE@PBD@Z) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,class CString,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HV2@H@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::CString(char const *)" (??0CString@@QAE@PBD@Z)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::CString(char const *)" (??0CString@@QAE@PBD@Z)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: class CString const & __thiscall CString::operator+=(class CString const &)" (??YCString@@QAEABV0@ABV0@@Z) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomStringOfNumbers(int)" (?GenerateRandomStringOfNumbers@CMathHelper@@SA?AVCString@@H@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: class CString const & __thiscall CString::operator+=(class CString const &)" (??YCString@@QAEABV0@ABV0@@Z)
1>StringHelper.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall CStringArray::~CStringArray(void)" (??1CStringArray@@UAE@XZ) referenced in function "public: static class COleDateTime __cdecl CStringHelper::GetOleDateTimeFromMySQLString(class CString,int)" (?GetOleDateTimeFromMySQLString@CStringHelper@@SA?AVCOleDateTime@@VCString@@H@Z)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CStringArray::~CStringArray(void)" (??1CStringArray@@UAE@XZ)
1>StringHelper.obj : error LNK2019: unresolved external symbol "public: __thiscall COleDateTime::COleDateTime(class COleDateTime const &)" (??0COleDateTime@@QAE@ABV0@@Z) referenced in function "public: static class COleDateTime __cdecl CStringHelper::GetOleDateTimeFromMySQLString(class CString,int)" (?GetOleDateTimeFromMySQLString@CStringHelper@@SA?AVCOleDateTime@@VCString@@H@Z)
1>StringHelper.obj : error LNK2019: unresolved external symbol "public: int __thiscall COleDateTime::SetTime(int,int,int)" (?SetTime@COleDateTime@@QAEHHHH@Z) referenced in function "public: static class COleDateTime __cdecl CStringHelper::GetOleDateTimeFromMySQLString(class CString,int)" (?GetOleDateTimeFromMySQLString@CStringHelper@@SA?AVCOleDateTime@@VCString@@H@Z)
1>StringHelper.obj : error LNK2019: unresolved external symbol "public: int __thiscall COleDateTime::SetDate(int,int,int)" (?SetDate@COleDateTime@@QAEHHHH@Z) referenced in function "public: static class COleDateTime __cdecl CStringHelper::GetOleDateTimeFromMySQLString(class CString,int)" (?GetOleDateTimeFromMySQLString@CStringHelper@@SA?AVCOleDateTime@@VCString@@H@Z)
1>StringHelper.obj : error LNK2019: unresolved external symbol "public: __thiscall CString::operator char const *(void)const " (??BCString@@QBEPBDXZ) referenced in function "public: static class COleDateTime __cdecl CStringHelper::GetOleDateTimeFromMySQLString(class CString,int)" (?GetOleDateTimeFromMySQLString@CStringHelper@@SA?AVCOleDateTime@@VCString@@H@Z)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::operator char const *(void)const " (??BCString@@QBEPBDXZ)
...............
|
|
|
|
|
Yes, I see now why you were talking about VC++. The thing is, WinDDK comes with its own compiler, which is 'annointed' (i.e. official and supported) by the DDK development team. WinDDK is intended to work with it. Now, that doesn't mean it won't work with other compilers - you've made it work with VC6, but that's not how it's intended (by microsoft) to be compiled. What I did was I used their official compiler which comes with WinDDK and is in fact in the directory (C:\WinDDK\bin or something). So if you really want to use VS2008 I can't be of much help because that's not how I did it. I used the WinDDK official compiler. See if this thread (http://www.osronline.com/showthread.cfm?link=151863) can help you, they talk about how to make it work with VS2008 there. There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi
I'm having a mfc dialog box application as a dll. I want to send any event (button press) in the dll to the application that calls the dll. how to do that. Anybody can please help me.
Thanks
Vijeesh T
Bangalore, NAL
|
|
|
|
|
May be you can pass the handle of the main window to the dll( in some initilization function ) and when button click occures you can send a message( RegisterWindowMessage() ) to the main dialogbox from the dll indicating the button press.
|
|
|
|
|
thanks. I could do by Inheritting the dll class and implementing the virtual function.
Thanks again
Vijeesh
|
|
|
|
|
Member 4599406 wrote: I want to send any event (button press) in the dll to the application that calls the dll.
What?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
He might have a dialog created with DoModal in the DLL, with all the code of the dialog in the DLL. Then he can't call directly to functions from the parent app (that has loaded the DLL).
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Why would the DLL ever need to know anything about the application that has loaded it?! Leave alone executing code from that.
But I'm still not sure of what the OP is trying to achieve and I'll leave it up to the OP to precisely explain the issue.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
I'm a rookie to C and i'm looking for some libraries to learn,something likes the C++ STL or Boost ,does any1 can tell me some of them?Thanks a lot
Eric
|
|
|
|
|
You should learn STL[^] and Boost[^].
By the time you learn them, you will no longer be a rookie.
|
|
|
|
|
Hi,
Just happen to see your profile on MVP page( Congrats on that ). Where are you in kerala?
|
|
|
|
|
Dengjin_CN wrote: I'm a rookie to C and i'm looking for some libraries to learn,something likes the C++ STL or Boost
«_Superman_» wrote: You should learn STL[^] and Boost[^].
Possibly he needs to learn C++ , before.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
well,everybody,I said C~~maybe you should tell me something likes GTK library,any others?I know GTK only...
|
|
|
|
|
Dengjin_CN wrote: well,everybody,I said C~~
So you're interested in C-wavy-wavy ?
That's should be for sissies.
Dengjin_CN wrote: maybe you should tell me something likes GTK library
Using widget toolkits is even more sisser.
You lost a lot of man points (if you had any)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello,
I have a little Win32 Windows app in C. It accepts filename as argument and calculates MD5 hash for the file. The dialog based app should show up with MD5 calculated. When I put hashing function to be executed under WM_INITDIALOG it fails and MD5 hash is not calculated. When should I execute it? I have tried WM_PAINT but md5 hashing gets executed all time then. Please help when should I begin hashing in this app.
I have VB6 background I remember I used to place all start up code under Form - OnLoad function. But in Win32 it is getting so hard. Please help a newbie.
|
|
|
|
|
You can still do the processing in response to WM_INITDIALOG , but only indirectly. Consider something like:
LRESULT CALLBACK DialogProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
switch (uMsg)
{
case WM_INITDIALOG:
PostMessage(hDlg, user_defined_message);
break;
case user_defined_message:
break;
default:
return FALSE;
}
return TRUE;
}
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thank you and others who took time to respond. Its working now
|
|
|
|
|
|
Ugh... The dude is using things like WM_USER+1 to define a "unique message" and such 'technique' is bound to break some day. I'd use RegisterWindowMessage [^] instead...
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
No, very bad.
Read Petzod and Richter for Win32 basics about messages
|
|
|
|
|
I am running a VC++ application, got a fatal error, clicked on the debug button, and the debugger open to this page which I have some problem understanding. Will like to get some help on how to interpret this error message.
Thanks much.
RDLLocation *GetDemandLocation()
{
return pDemandLocation; //this is where the deburgger yellow arrow is pointing
}
- this 0xdddddddd
- RDLLoObject {...}
- RDLDatabaseObject {...}
- TStreamableBase {...}
__vfptr CXX0030: Error: expression cannot be evaluated
loadStatus CXX0030: Error: expression cannot be evaluated
- Name {???}
m_pchData CXX0030: Error: expression cannot be evaluated
- _destructCB {...}
__vfptr CXX0030: Error: expression cannot be evaluated
_enabled CXX0030: Error: expression cannot be evaluated
_needToInvoke CXX0030: Error: expression cannot be evaluated
_doorOpen CXX0030: Error: expression cannot be evaluated
_srcObj CXX0030: Error: expression cannot be evaluated
- _cbList {...}
allocator {...}
_Head CXX0030: Error: expression cannot be evaluated
_Size CXX0030: Error: expression cannot be evaluated
- _valueCB {...}
__vfptr CXX0030: Error: expression cannot be evaluated
_enabled CXX0030: Error: expression cannot be evaluated
_needToInvoke CXX0030: Error: expression cannot be evaluated
_doorOpen CXX0030: Error: expression cannot be evaluated
_srcObj CXX0030: Error: expression cannot be evaluated
- _cbList {...}
allocator {...}
_Head CXX0017: Error: symbol "" not found
_Size CXX0030: Error: expression cannot be evaluated
ulDisplayFlags CXX0030: Error: expression cannot be evaluated
pLoadItemSet CXX0017: Error: symbol "CSet<RDLLoadItem,1>" not found
pDemandLocation CXX0030: Error: expression cannot be evaluated
pSupplyLocation CXX0030: Error: expression cannot be evaluated
pProTransResSet CXX0017: Error: symbol "CSet<RDLString,1>" not found
pTimeWindowSet CXX0017: Error: symbol "CSet<RDLShipmentTimeWindow,1>" not found
- LoadRef {???}
m_pchData CXX0030: Error: expression cannot be evaluated
ShipmentDemandType CXX0030: Error: expression cannot be evaluated
Demand1 CXX0030: Error: expression cannot be evaluated
Demand2 CXX0030: Error: expression cannot be evaluated
Demand3 CXX0030: Error: expression cannot be evaluated
LoadRate1 CXX0030: Error: expression cannot be evaluated
LoadRate2 CXX0030: Error: expression cannot be evaluated
LoadRate3 CXX0030: Error: expression cannot be evaluated
UnLoadRate1 CXX0030: Error: expression cannot be evaluated
UnLoadRate2 CXX0030: Error: expression cannot be evaluated
UnLoadRate3 CXX0030: Error: expression cannot be evaluated
CommonCarrierCost CXX0030: Error: expression cannot be evaluated
ShipmentPriority CXX0030: Error: expression cannot be evaluated
FixedServiceTime CXX0030: Error: expression cannot be evaluated
IsDummy CXX0030: Error: expression cannot be evaluated
CurrentLoadItemNumber CXX0030: Error: expression cannot be evaluated
validDays CXX0030: Error: expression cannot be evaluated
pTmpTimeWindowSet CXX0017: Error: symbol "CSet<RDLShipmentTimeWindow,1>" not found
fLTLCost CXX0030: Error: expression cannot be evaluated
|
|
|
|
|
"pDemandLocation" was not initialized or assigned a value.
|
|
|
|
|
hello sir/madam,
I am an novice programmer and eager to learn as fast as it is possible to learn so i decided to move to solve the programming puzzles but i don't know i step up for this. Which book I prefer to start as a programmer to solve programming puzzles.
Pls enlist some good books or any other resource from where I learn some related to solving programming puzzles.
Thanx in advance.
|
|
|
|
|
|
Hi,
choose first which kind of programming language you want to learn. Then learn the things, suppose if you want to learn any Microsoft technology it can be improved by WWW.msdn.com. Like this for every language we have to choose correct path.
And when have discussion with people like code project obviously we will get different problems and we improve the things very firstly.
For problem solving relate issues go through WWW.topcoder.com
sampath-padamatinti
|
|
|
|