|
CFile::Read("test.bin",CFile::modeRead) is the mode to read a binary file? or different flag? Thanks
|
|
|
|
|
From the docs: "One access permission and one share option are required"...
something like
CFile file(_T("pathname"), CFile::modeRead | CFile::shareDenyNone);
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi,
I have written a custom expression evaluator add-in (EEAddIn) that I use with the Visual Studio .NET 2003 debugger to improve the display of certain C++ objects. The EEAddIn interface is very limited, however, and I would really like to be able to call GetExpression on the process being debugged while handling an EEAddIn callback. Unfortunately, GetExpression does not seem to work in this case.
I can use a separate add-in (EEAddInHelper) that calls GetExpression during an OnEnterBreakMode event handler to retrieve certain information from the debugged process. However, at this point I don't know the type that the expression evaluator is trying to display. Therefore, I am limited to retrieving certain general, static, type information from the process (e.g. the size of certain types that I am interested in handling in my EEAddIn).
If I try to call GetExpression while inside an EEAddIn callback, GetExpression returns E_FAIL and answers a NULL string. This happens regardless of the value of the UseAutoExpandRules parameter. I am invoking GetExpression from my EEAddInHelper, and I get a handle to this add-in via a call to GetModuleHandle in my EEAddIn callback handler. I am able to call other functions in EEAddInHelper to retrieve the static type information (which EEAddInHelper previously got by calling GetExpression in its OnEnterBreakMode handler), but direct (synchronous) calls to GetExpression always fail. Note that most of the ideas for my EEAddIn and EEAddInHelper come from http://www.codeproject.com/macro/CRCView.asp.
Does anyone know why GetExpression fails and whether there is a work-around? Would it help if I called GetExpression in a separate thread that I spawn while handling the EEAddIn callback? Are there any recommendations for debugging this problem?
Any help would be greatly appreciated.
Thanks.
|
|
|
|
|
Im using C++, and OpenGL. For some reason when I run my game on a AMD machine it has these skips. When I run it on an Intel it runs fine. It could have nothing to do with the CPU but I suspect it may have something to do with it (maybe QueryPerformance?)
Thanks for any help or advice.
|
|
|
|
|
R.A.V.E. wrote: it has these skips
What is a 'skip' ? What do you mean by that ?
|
|
|
|
|
The Objects jump/skip in the direction they're heading at random times.
|
|
|
|
|
I work with real-time graphics in flight simulation. It sounds like a timing problem more than anything. I'm not familiar with PC chips all that much, but it may be that the timing you've chosen to animate your objects can't be sustained at the rate you would like it to. In regular animation, the human eye can begin to detect 'stepping' at somewhere between 20-25 Hz (20-25 frames per second). So if you aren't displaying your scene faster than this, you are going to notice 'skipping' or 'stepping' of your scene objects. Hope this helps.
John P.
|
|
|
|
|
I am creating an application which has a list view control and you can drag and drop items into it - for example, from the explorer - which then processes the data and adds an entry to the list view. How would i implement this?
Thanks for your help,
--PerspX
|
|
|
|
|
Perspx wrote: How would i implement this?
Since CView provides the functionality, it should be handled automatically. What are you having trouble with?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Well i am using straight C/C++ with no classes so I am not sure how to handle drag and drop. Is there some sort of APIs for this?
Thanks for your help!
--PerspX
|
|
|
|
|
Perspx wrote: Well i am using straight C/C++ with no classes...
My bad.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Hi
I have an activex control. In that control I have a bitmap image. Now I have a function called GetImage(), I want to return this bitmap. How do I do that. What should be variable type of GetImage().
Any help would be of great help.
Regards
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Zainu wrote: What should be variable type of GetImage().
A pointer to an Image object.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
One way is via the IPicture[^] interface (and related interfaces and APIs).
Steve
|
|
|
|
|
Hello,
Can you please give me the reference for OnCmdMsg() method for CMDIFrameWnd class
Pritha
|
|
|
|
|
http://msdn2.microsoft.com/en-us/library/e1zkw1et(VS.80).aspx
http://msdn2.microsoft.com/en-us/library/k63bsef7(VS.80).aspx
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi All,
I followed Michael Dunn's article on The Complete Idiot's Guide to Writing Shell Extensions - Part I[^], and created a pair of (two separate) extensions: one for creating file checksums; and a second for verifying. Reference: A File Checksum Shell Menu Extension Dll[^].
It is apparent these are mutually exclusive on Vista (I just retested on Windows 2000 - OK):
* Register both Create and Verify
- Only Create is available
* Register only Verify (unregister Create)
- Verify is available
Any ideas? I pasted part of the Registry Resource (to verify uniqueness of UUIDs). But I suspect it has to do with the way the handler registers. I verifed both are registered under HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers.
Also, I'm not convinced this is a Shell/COM issue, so I moved the question from the ATL board to the VC++ board.
Jeff
The Ctx prefix was added below so that the items would 'stack' (group together) on the Context menu.
HKCR
{
NoRemove CLSID
{
ForceRemove {7E745006-3E3F-42F8-B806-E24D4133439C} = s 'CtxVerifyHash Class'
...
and
HKCR
{
NoRemove CLSID
{
ForceRemove {571077DC-F353-43C8-ACAC-4DE4B7EFC4E3} = s 'CtxCreateHash Class'
...
|
|
|
|
|
Hi All,
A fresh build using Visual Studio 2005 (new project, not a port) did not resolve the issue. Also, the issue is confirmed in XP.
Jeff
|
|
|
|
|
I need help on how to get the device id in program for a particular pocket pc. I'm using Embedded Visual C++.
|
|
|
|
|
Hi, can anyone help me?
I need to run 4 threads(each thread handle the same function) in my app.
The function looks like this:
void ThreadFunction()
{
Do something...
Do something, but only one thread at one time //it doesn't consume much time
Do something...
EndThread()
}
1) How should I start threads? (CreateThread(),AfxBeginThread(),...)
2) How should I end threads? (EndThread() - ???)
3) How should I handle the part of code that must be processed only by one thread at a time?
Thank you very much for any help.
Petr
|
|
|
|
|
How to start a thread can depend on what the thread procedure uses -
For just Windows API, CreateThread()
If using any C Runtime (CRT), use _beginthread/_beginthreadex
If using MFC, use AfxBeginThread
Ending threads should be done by letting the thread procedure return normally.
Anything that needs to be thread safe (done by only one thread at a time) should be synchronized.
Mutex and critical section objects work well for this.
See Joseph Newcomer's article Using Worker Threads[^] for lots of handy info.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thank you for your help. I am using MFC.
I have already read something about synchronization.
If I use Mutex, it must be defined outside the ThreadFunction(). Am I right?
If I need to wait until other thread stopped using of critical part of code, what should I use? WaitForSingleObject() function?
|
|
|
|
|
zudroj wrote: If I use Mutex, it must be defined outside the ThreadFunction(). Am I right?
Not always. If more than one thread in your process needs to use the mutex, then you need its
handle outside the threadproc, somewhere where other threads can access it.
If the mutex is used only by that thread in the process (for example, a named mutex for
synchronizing different processes) then you could create/open it IN the threadproc.
Define it wherever it can be accessed by all threads that need the handle.
zudroj wrote: If I need to wait until other thread stopped using of critical part of code, what should I use? WaitForSingleObject() function?
Yes. When WaitForSingleObject() returns and indicates you own the mutex, make sure to call
ReleaseMutex() when you're done executing critical code so other threads can assume ownership of
the mutex.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thank you.
All I needed is working well.
|
|
|
|