I need a simple "one at a time" lock on a section of code. Consider the function func which can be run from multiple threads:
void func()
{
// locking/mutex statement goes here
operation1();
operation2();
// corresponding unlock goes here
operation3();
}
I need to make sure that operation1 and operation2 alwa...
Hi,
depending on a compile switch (values are COMPILE_A or COMPILE_B), which is set in the form of an envorinment variable, I want to compile my application with different settings, like application name and splash screen.
I got this far:
In "Project / Settings / C/C++ / Preprocessor Definitions" I added $(COMPILESWITCH) (results in...
How do you disable CBitmapButton? I tried using m_bitmapbutton.EnableWindow(false); but it doesn't work. It still fires an event.
What I'm trying to do is prevent Button A from firing Event A if Event B is executing (from Button B). So in Event B, I want to disable Button A.
...
What is the maximum number of files limit in this code?
FIX: Common File Dialog Multiple Selection File Limit
http://support.microsoft.com/kb/179372
...
Hi,
I have an MFC appplication where the user have to move the mouse around a circle circonference with a dragging mouvement. I need to retrieve the number of degrees during this mouse drag "rotation" and I need to know if it's clockwise or counterclockwise.
At first, to determine the rotation direction, I was comparing x-coordinnate be...
Hi,
I have a Windows service running in a specified user account with write permission on a shared drive on another computer. The service is logging on that shared drive.
I allow the user to enter mapped path or network path (e.g. z:\MyRemoteFolder or \RemoteComputer\MyRemoteFolder) as the log destination.
As I am in an unstable netw...
Is there any way to find out the actual time spent by a thread inside the CPU using MFC/Win32? By actual time, I mean I don't want to count the time the thread spent in states other than "Running". I tried GetThreadTimes() method in Win32 SDK but couldn't get the proper values. I want to do this because I want to check effect of setting ...
My code talks to a little Java application provided by a vendor. This Java app sets up a web server at localhost:57000 which is used to control the state of 'the machine'. For the purpose of this question, I need to change the state of 'the machine' from 'off' to 'on'. To make this happen I'm supposed to HTTP PUT the following string ...
Hello,
Can someone please guide me on how to pass the reference pointer to the dialog class so that it can call DoModal?
e.g.
EditorSvr.cpp -- implementation of the interface class (which is also located in a DLL)
CDialogClass1.cpp -- Dialog class that will receive the pointer from EditorSvr.cpp
I tried to search the whole google bu...
I have a large amount of code for an MFC/ATL program that I would like to use in a windows form appllication. What is the easiest way to "convert" this code so that it compiles with /clr enabled and finds the basic classes, e.g. CObject, CString, CFile and the templates?
...
Summary questions:
Do you know of a lightweight application that can save files in RTF Version 1.6 format?
Do you know what version of RTF Abiword's "Rich Text Format for old apps" corresponds to?
Do you know a way to inspect an RTF file and determine what version of RTF it's encoded under?
Do you know which DLL describes the RTF forma...
Hello
I have a PHP script that generates a product key for an application written in c++/MFC.
The product key is email to the user and the user copy and pasts it in to my application.
function EncryptData( $data ) {
$key = "abcdefghijklmnopqrstuvwxyz";
// This encrypt method is described here
// http://ca3.php.net/mcrypt
$val =...
I am new to MFC well not entirely new but wanted to ask experts on this forum as why one would choose one project over the other. I hope this is not a stupid question as I am relatively new to MFC.
Thanks so much
...
I have a large MFC C++ application that I would be very keen to port into AutoCAD and IntelliCAD. AutoDesk offer Object ARX for this purpose, which replaces the older and slower ADS technology. IntelliCAD, afaik only supports ADS. Has anyone out there done this, and if so which tools did you use and what pitfalls did you encounter?
I...
I have a MFC dialog in Visual C++ 2005, (MFC Application) and I have added several controls to it. But Visual Studio has no option for deleting a control if I no longer need it.
Is there any easy way to do that except modifying all the code where a reference to the control appears?
...
Can anyone explain how to add dropdown arrows to CMFCToolBar toolbar buttons - like for undo/redo buttons. We had this with CToolBar by using the TBSTYLE_EX_DRAWDDARROWS style and TBN_DROPDOWN notification. This doesn't seem to work with CMFCToolBar. These dropdown arrows i believe are added to the VisualStudioDemo MFC feature pack de...
I was reading through some threading related code and found this piece of code:
MyThread::start()
{
//Create a thread
m_pThread = AfxBeginThread(/*some parameters*/)
//Create a duplicate handle for the created thread
m_hDuplicateHandle = DuplicateHandle(/* some more parameters*/)
}
MyThread::stop()
{
//Set some variables so ...
I have an MDI app. I would like to add an icon to the non client title bar of the child window that allows the window to float separately from the parent MDI container, allowing the user to take the child windows and arbitrarily place them around the desktop, outside of the MDI window.
I have seen it done so I know it's possible, but I'...
I have an MFC app built using Visual Studio 2008 and it needs to run on W2K, XP, 2003 and Vista. The application writes to HKLM in the registry and will only work on Vista if you run it as Administrator.
My question is: can I force the app to run as Adminstrator automatically? Does it involve creating a manifest file? At the moment I...
Hello
I want to make a CListView that will read his rows from e remote server using socket. The rows may be more than a million that's why i need to read rows only when I need them and may be read them in a groups (with more that 1 row per request). I also need to support sorting by rows.
May be I have to use List Control with LVS_OWNE...