|
If you have the contact of the reader vendor, you can request a checked-build driver (which outputs debug messages). When the Windows session is unlocked, you would probably see the driver sunk into certain infinite loop around read FIFO or something. It usually has been the main reason SCardGetStatusChange not returns.
Of course there might be other reasons such as a third-party smartcard security application running when workstation session is locked and it uses poor method to poll card present status thus it exclusively locks the reader resource ...
Basically you can figure out most situations by reading the driver logs.
Maxwell Chen
|
|
|
|
|
Hi,
while compiling an old VC6 project to VC2005 (and also upgrading to the latest Ultimate Grid Version), I got the following messages:
1>ugrndm.lib(UGCell.obj) : error LNK2005: "public: int __thiscall CUGCell::SetDefaultInfo(void)" (?SetDefaultInfo@CUGCell@@QAEHXZ) is already defined in UGCell.obj.
1>ugrndm.lib(UGCell.obj) : error LNK2005: "public: int __thiscall CUGCell::AddCellInfo(class CUGCell *,class CUGCell *)" (?AddCellInfo@CUGCell@@QAEHPAV1@0@Z) is already defined in UGCell.obj.
1>ugrndm.lib(UGCell.obj) : error LNK2005: "public: int __thiscall CUGCell::SetText(char const *)" (?SetText@CUGCell@@QAEHPBD@Z) is already defined in UGCell.obj.
1>ugrndm.lib(UGCell.obj) : error LNK2005: "public: int __thiscall CUGCell::AppendText(char const *)" (?AppendText@CUGCell@@QAEHPBD@Z) is already defined in UGCell.obj.
1>ugrndm.lib(UGCell.obj) : error LNK2005: "public: int __thiscall CUGCell::GetTextLength(void)" (?GetTextLength@CUGCell@@QAEHXZ) is already defined in UGCell.obj.
1>ugrndm.lib(UGCell.obj) : error LNK2005: "public: int __thiscall CUGCell::SetMask(char const *)" (?SetMask@CUGCell@@QAEHPBD@Z) is already defined in UGCell.obj.
1>ugrndm.lib(UGCell.obj) : error LNK2005: "public: int __thiscall CUGCell::GetMask(class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > *)" (?GetMask@CUGCell@@QAEHPAV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) is already defined in UGCell.obj.
1>ugrndm.lib(UGCell.obj) : error LNK2005: "public: char const * __thiscall CUGCell::GetMask(void)" (?GetMask@CUGCell@@QAEPBDXZ) is already defined in UGCell.obj.
1>ugrndm.lib(UGCell.obj) : error LNK2005: "public: int __thiscall CUGCell::SetLabelText(char const *)" (?SetLabelText@CUGCell@@QAEHPBD@Z) is already defined in UGCell.obj.
1>ugrndm.lib(UGCell.obj) : error LNK2005: "public: int __thiscall CUGCell::GetLabelText(class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > *)" (?GetLabelText@CUGCell@@QAEHPAV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) is already defined in UGCell.obj.
1>ugrndm.lib(UGCell.obj) : error LNK2005: "public: char const * __thiscall CUGCell::GetLabelText(void)" (?GetLabelText@CUGCell@@QAEPBDXZ) is already defined in UGCell.obj.
1>ugrndm.lib(UGCell.obj) : error LNK2005: "public: int __thiscall CUGCell::SetBool(int)" (?SetBool@CUGCell@@QAEHH@Z) is already defined in UGCell.obj.
1>ugrndm.lib(UGCell.obj) : error LNK2005: "public: int __thiscall CUGCell::SetNumber(double)" (?SetNumber@CUGCell@@QAEHN@Z) is already defined in UGCell.obj.
1>ugrndm.lib(UGCell.obj) : error LNK2005: "public: int __thiscall CUGCell::SetNumberDecimals(int)" (?SetNumberDecimals@CUGCell@@QAEHH@Z) is already defined in UGCell.obj.
1>ugrndm.lib(UGCell.obj) : error LNK2005: "public: int __thiscall CUGCell::GetNumberDecimals(void)" (?GetNumberDecimals@CUGCell@@QAEHXZ) is already defined in UGCell.obj.
(.. and another 661 lines!)
I added '#include "uglibsel.h" ' to my stdafx.h , and also created the ugdndm.lib (and udrndm.lib for release versions).
It looks like that I have defined them twice, but where?
Any help is appreciated.
quastman
|
|
|
|
|
The libraries are conflicting. Why do you need to link with both libraries?
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.
[my articles]
|
|
|
|
|
I don't link both, I just put both in the same directory as putting the debug version into the debug subdir and the release version un the release subdir (and adding these dirs to the "Additional Incluse for Debug / Release tab) does not work. If I only add one of the dlls, everything works fine, but as far as i understand, I need both (or am I wrong with this?)
quastman
|
|
|
|
|
Actually (maybe I'm wrong) seems that your application links with one of such libraries and, at the same time with an object file of the library itself.
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.
[my articles]
|
|
|
|
|
I think I found the problem: I added the libs to the project (as we are more than one programmer). In this case, both libraries are linked into the project. After removing them from the Project and just putting them in a directory, It works fine!.
Thanks for your help!
quastman
|
|
|
|
|
delete [] m_buffer;
////////////////////////// prepare to Cut
CFileException e;
CFile f;
if(f.Open(m_Path, CFile::modeRead,&e))
{
char szTmp[10];
WAVEFORMATEX pcmWaveFormat;
ZeroMemory(szTmp, 10 * sizeof(char));
f.Read(szTmp, 4 * sizeof(char)) ;
if (strncmp(szTmp, _T("RIFF"), 4) != 0) ;
//::AfxThrowFileException(CFileException::invalidFile, -1, f.GetFileName());
DWORD dwFileSize;/* = m_buffer.GetNumSamples() * m_pcmWaveFormat.nBlockAlign + 36*/
f.Read(&dwFileSize, sizeof(dwFileSize)) ;
ZeroMemory(szTmp, 10 * sizeof(char));
f.Read(szTmp, 8 * sizeof(char)) ;
if (strncmp(szTmp, _T("WAVEfmt "), 8) != 0) ;
//::AfxThrowFileException(CFileException::invalidFile, -1, f.GetFileName());
DWORD dwFmtSize; /*= 16L*/
f.Read(&dwFmtSize, sizeof(dwFmtSize)) ;
f.Read(&pcmWaveFormat.wFormatTag, sizeof(pcmWaveFormat.wFormatTag)) ;
f.Read(&pcmWaveFormat.nChannels, sizeof(pcmWaveFormat.nChannels)) ;
f.Read(&pcmWaveFormat.nSamplesPerSec, sizeof(pcmWaveFormat.nSamplesPerSec)) ;
f.Read(&pcmWaveFormat.nAvgBytesPerSec, sizeof(pcmWaveFormat.nAvgBytesPerSec)) ;
f.Read(&pcmWaveFormat.nBlockAlign, sizeof(pcmWaveFormat.nBlockAlign)) ;
f.Read(&pcmWaveFormat.wBitsPerSample, sizeof(pcmWaveFormat.wBitsPerSample)) ;
ZeroMemory(szTmp, 10 * sizeof(char));
f.Read(szTmp, 4 * sizeof(char)) ;
if (strncmp(szTmp, _T("data"), 4) != 0) ;
//::AfxThrowFileException(CFileException::invalidFile, -1, f.GetFileName());
m_pcmWaveFormat = pcmWaveFormat;
DWORD dwNum;
f.Read(&dwNum, sizeof(dwNum)) ;
//m_buffer=NULL;
m_buffer=new char[dwNum];
f.Read(m_buffer, dwNum) ;
m_dwNum=dwNum;
f.Close();
}
|
|
|
|
|
Haven't you a debugger, have you?
What are result of you inspection using the debugger?
What is the offending line, is it m_buffer=new char[dwNum]; ?
If the answer is Yes, then what is dwNum value?
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.
[my articles]
|
|
|
|
|
You have got WAAAAAY more patience than me.
I couldn't even see a question...
Iain.
|
|
|
|
|
Maybe patience it is context dependent. Anyway your reply to former Hakan D (now Mr. Surprise) was simply great.
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.
[my articles]
|
|
|
|
|
hi...
am using pocket oc 6.0.
i have to read a text file.
what is the procedure?
can anybody help me?
paulraj
|
|
|
|
|
I'm assuming you're using C++, as you're posting here. Reading a text file is the same on a normal PC as it is on a mobile PC. So, you're better writing a test program on the PC first, as that's easier to experiment with.
Look at CreateFile , ReadFile and CloseHandle functions.
But for more detailed help, you'll need to write more detailed questions.
Iain.
|
|
|
|
|
hi...
am using vc++ and pocket pc6.0.
am having a file like paul.doc.
and paul file condains { hi this is paul};
now i have to read the paul.doc and i have to store the datas in a string...
can anybody help me?
paulraj
|
|
|
|
|
In your first message, you said you had a text file. If you look on MSDN for the SDK functions I gave you, you can read data from a file.
Now, you say it's a DOC file. If this is still just a text file, look at my previous answer. If it's a Word document, then it's going to be a lot harder. Those files contain all sorts of things, (author info, fonts, bold etc) and not just the text.
What is the format of the text file?
If it is in word format, can you ask whoever is giving you this file to make it a friendlier format?
Iain.
|
|
|
|
|
its a doc file.
can you help me?
paulraj
|
|
|
|
|
Then it's gona be a lot harder. Google for Word automation and read tutorials about it. It's much too long to explain on a forum.
Can't you use a simple text file (.txt) ? That will be much easier.
|
|
|
|
|
|
What about using C++ ifstream class?
This is a very basic task, you can also check out some documentation samples, I suppose.
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.
[my articles]
|
|
|
|
|
CPallini wrote: you can also check out some documentation samples
Where do I get one of those?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi friends...
I need ur suggestion .how to converting datas file into CStringArray?
how its possible
Thanks n Advance
raju.k
|
|
|
|
|
For instance reading line by line (or value by value) adding the read content to the array, i.e Dont' you think the question is a bit too broad?
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.
[my articles]
|
|
|
|
|
is my syntax..is correct??
CFile file;
CStringArray get_array;
get_array=file.GetLenght();
is this correct....
Thanks
raju.k
|
|
|
|
|
raju.k wrote: CFile file;
CStringArray get_array;
OK.
raju.k wrote: get_array=file.GetLenght();
Nope. What do you want to do with the above line?
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.
[my articles]
|
|
|
|
|
actually file contains some data ..i wanna passing all the data into CStringArray..thats y i am writing these function ..is it correct?
raju.k
|
|
|
|
|
You should consider how your file is structured (is it a text file or is it a binary one, has a regular format ?), then you have to use some function to read in a meaningful way the file constent (for instance fread for binary files, fscanf for text ones,...) then you need to use (as suggested by Iain Clarke) the CStringArray::Add method to add read elements to your array.
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.
[my articles]
|
|
|
|