|
|
It could be an automatic update that was installed.
You could still try to clean and rebuild the project.
What program was highlighted as part of the newly installed?
|
|
|
|
|
transoft wrote: Every time I tried to re compile my project. MS will compile every files in the project even most of file are not updated.
What is wrong?
Sounds like it may be a dependency issue; your files are listed as dependent on some source or object which always makes them appear out of date. Check the project settings.
|
|
|
|
|
Is part of your project's files on a different computer (a network drive)? If so, is your computers time much different from the remote computer? Just a thought.
|
|
|
|
|
Is the computer's date and time set correctly?
"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
|
|
|
|
|
Yes, You are the MAN. I spent a lot of time to find this problem.
Thanks
|
|
|
|
|
The following function is as follows
LONG ITCSCAN_GetDefaultDevice(
LPTSTR lpDeviceNameBuffer,
DWORD * pBufferLength)
with explanation as follows
lpDeviceNameBuffer [out] Pointer to buffer that will store the returned device name
pBufferLength [in/out]Pointer to a variable that specifies the size, in bytes, of the buffer pointed to by the lpDeviceNameBuffer parameter. When the function returns, this variable contains the size of the data copied to lpDeviceNameBuffer
I under stand pointer points to address and I understand that dereference points to value at an address. But these Windows API functions have me confused, expecially with the out in/out stuff.
Can anyone make this clearer using the above function as example.
I would code
LONG defaultDevice;
LPTSTR deviceBuffer=NULL;
DWORD *bufferLength=NULL;
defaultDevice = ITCSCAN_GetDefaultDevice(deviceBuffer,bufferLength)
But that returns errors and when I've made changes to get the code to compile without errors I get access violation runtime errors.
Please Help!
|
|
|
|
|
egerving wrote: Can anyone make this clearer using the above function as example.
How about something like:
char deviceBuffer[1024];
DWORD bufferLength = sizeof(deviceBuffer);
LONG defaultDevice = ITCSCAN_GetDefaultDevice(deviceBuffer, &bufferLength);
"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
|
|
|
|
|
|
egerving wrote: Code does not work.
Based on your description David's code does exactly what is necessary; can you explain exactly what happens? Please remember to post your sample within the "code block" <pre></pre> tags to make it easier to read.
|
|
|
|
|
When I changed the char to TCHAR the code worked. I'm coding for windows ce and that was the difference.
Where I'm really confused it LPTSTR lpDeviceNameBuffer is pointer to a buffer to store the returned device name. How do I know what datatype to use for the buffer. It's not like
char *pdata is a pointer to
char data
because the datatype is LPTSTR
|
|
|
|
|
Its hard to say what your function does without seeing some documentation. But I suspect it is a dynamic sized buffer and when the functions fails it probably returns the size required. Something like this:
LPTSTR szBuffer = NULL;
DWORD dwLen = 0;
ITCSCAN_GetDefaultDevice(NULL,&dwLen)
if(0 < dwLen)
{
szBuffer = new TCHAR[dwLen];
ITCSCAN_GetDefaultDevice(szBuffer,&dwLen);
delete [] szBuffer;
}
Best Wishes,
-David Delaune
|
|
|
|
|
With regard to the above functions 1st parameter LPTSTR lpDeviceName [out] pointer to buffer that will store the returned device name.
What exactly does that mean? I think it means to declare a variable of type LPTSTR which is defined as a pointer to a buffer to store the returned device name. And the buffer is built into the function itself. Am I wrong?
Does is mean to actually delare a LPTSTR pointer and another buffer variable that it will point to?
|
|
|
|
|
Typically OUT means the function will write data OUT/into the buffer. The IN means the function expects data to be passed INTO the function. Can you guess what IN/OUT means?
Best Wishes,
-David Delaune
|
|
|
|
|
Thanks. That make sense and that's what I thought. Can you help me with the dataTypes. I pretty confused on this. For example.
Function says LPTSTR lpDeviceNameBuffer is pointer to buffer. But what datatype must the buffer be. This is where I'm really having problems. It's not like
char data
char *pdata
where you know that the variable is a char and the pointer is a char.
|
|
|
|
|
LPTSTR is a Long Pointer to a TCHAR string. If your project has Unicode defined then the pointer will point to a WCHAR string. In an ANSI build it will point to a CHAR string.
Best Wishes,
-David Delaune
|
|
|
|
|
Thank you very much. I think I'm starting to get it now. The Wind32 Simple Data Types do actually tell you what all the various pointers are pointing to; ie, BOOL, BYTE, DWORD, CHAR, etc, etc.
|
|
|
|
|
|
Hi,
I want to ask you that what are the different manners to run a file auto in WindowsXP and Linux? Is auto run of any file is possible in Linux? Is there any other method in windowsXP to run a file auto(makeing a autorun.inf file)?
|
|
|
|
|
Hi
I can use "wifstream" to read strings. But I can not read number (using operator >>) back from a binary file.
it seems "wifstream" that "read" function work fine and its operator >> does not functioning.
Do you have any experience with "wifstream"? Could you share it with me?
Best
|
|
|
|
|
transoft wrote: Do you have any experience with "wifstream"? Could you share it with me?
This works for me:
void main( void )
{
wofstream out("c:\\data.dat", ios::binary);
out << 123;
out.close();
wifstream in("c:\\data.dat", ios::binary);
int x;
in >> x;
in.close();
}
"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 very much.
I found out that "c:\\data.dat" is a text file.
I saved a number like "1". It should show in the binary file like "01 00 00 00" (using HexEditor). But your sample saved it as "1".
Thanks,
modified on Tuesday, November 3, 2009 2:01 PM
|
|
|
|
|
transoft wrote: But your sample saved it as "1".
Sorry about that. Can you just use the stream's write() method instead?
"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
|
|
|
|
|
But "Write" function can only write string to the file. The operator << suppose should be able to write number to the file. But it did not.
If you make a binary file using HexEditor like first 4 bytes looks like "01 00 00 00". Your sample can not read any thing back.
It is Microsoft fstream BUGs??? Or wifstream can only be used with text file?
|
|
|
|
|
transoft wrote: But "Write" function can only write string to the file.
It writes whatever is at the address provided to it, at least the ofstream method does.
ofstream out("c:\\data.dat", ios::trunc | ios::binary);
int y = 1234;
out.write((const char *) &y, sizeof(y));
out.close();
"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
|
|
|
|