For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
I got a strange message from my compiler. Same code, same (at nearly) settings for Debug and Release versions. But what is more important, same files and same code! But when I try to create Release version, I get this:
Thank you, your tip was useful. I checked all places in the project's settings where I met the word "manifest" and found one, where settings for Debug and Release were different. Release wanted to generate manifest file, but Debug did not. I excluded manifest generation for the Release version and finally got it.
Look, guys, I have a code that worked properly under Windows XP 32 bit.
hHookMsg = SetWindowsHookEx(WH_JOURNALPLAYBACK, hkprc, hInst, 0). But under Windows 7 64 bit this call failed and I got System Error Message "Acces denied"
I tried this:
hHookMsg = SetWindowsHookEx(WH_JOURNALPLAYBACK, hkprc, hInst, GetCurrentThreadId())
hHookMsg = SetWindowsHookEx(WH_JOURNALPLAYBACK, hkprc, (HINSTANCE)NULL, GetCurrentThreadId())
and got "This hook can be set only globally".
Any ideas how to resolve the situation?
They have put security around that sort of thing and you probably have to be running as administrator and it's likely going to throw a UAC to user to confirm it is okay. Goto MSDN and look at the documentation.
which waits for a file to be created and then once it is, it
proceeds to the next job. The problem is, this code doesnt seem to
work every time. Im nervous now in using it. I need to wait for a
file to be full created and sometimes it may take 5+ minutes. Once its
created, then I want to move onto the next step. How can I adjust this
code to make it work every time? Please any response any one can give me
will be great appreciated.
Is that Linux sleep() or Windows Sleep()? Or, more to the point, are you sleeping for 1 second, or 1 millisecond? If the latter, maybe you should try to increase the time to around 100ms: The Windows file system is not very fast, and might be hamstrung by constantly trying to open nonexistant files.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
If you are waiting for the file to be fully created (i.e. completely written), then this code won't work. At best, it will wait until the file is created (i.e. when the other task opens it for writing).
The problem may be broken into two steps:
Wait until the file is created (i.e. it appears in the directory)
Wait until the file is closed (i.e. the writing is completed)
Others have given you good ideas about how to wait for the file to be created. In order to wait for the file to be completely written, the best way would be for the other application to create another file AFTER it is done with the data file. For example:
Your application waits for the creation of DATA.DAT
Other application creates file DATA.DAT (your application detects the creation)
Other application writes into DATA.DATA (your application waits for the creation of FINISHED.DAT)
Other application closes DATA.DAT
Other application creates FINISHED.DAT (your application detects FINISHED.DAT, and knows that DATA.DAT is ready)
There are some other points to handle (e.g. what happens if DATA.DAT is created before your application starts waiting for it?), but this is the basic idea.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
Yes, I know VS2008 is old, but I have to use it for a development project.
Anyway, a couple of weeks ago, I installed some software from Intel that broke my VS2008. Nothing would compile, I could not set breakpoints, etc. Using a clean Windows 10 VM, I re-installed VS2008, SP1 and an ATL update required for WEC7 development. I can compile and set breakpoints again. Joy. Now it gets a little weird. The step over (F10) and step into (F11) functions refuse to work. They are being treated as the go (F5) commands, making it just about impossible to get anything done. Note that even the menu debug commands behave this way.
Now it gets a little weird now - it seems to be project/solution related. If I debug project A the functions work, debug Project B (the one I really need to work on) they don't.
So a clean re-install did not fix this, a reset to all settings didn't fix it, deleting .suo, etc files didn't fix it... maddening
Thoughts? Ever run into this?
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Last Visit: 18-Jan-20 16:26 Last Update: 18-Jan-20 16:26