|
I need to attach a dialog to a single document application.
On the menu bar I want to go to view then 'Device Setup'. Once I click on the 'Device Setup' a Dialog should appear initialised with default values.
How would I do this. Suggestions are much appreciated
|
|
|
|
|
Hello!
Create new entry in resource editor in menu. By using class wizard create a method which will be called when menu item will be chosen. In this method instantiate dialog class instance, and call DoModal()

|
|
|
|
|
I am currently a student at uni and need to randomize where a set of nine graphics appear along a graphic. These have hotspots allocated to them, and are stored in a seperate file. Is it possible to use regions to offset the images, or am I bartking up the wrong tree?
I can offset the region to change where the hotspot is "located" but the original image needs to be offset aswell.
|
|
|
|
|
Hi, tried to search msdn and internet, but haven't found an article, how to display something (like how many unread mails user has) on the Welcome Screen of Windows XP. Thanks for any help ...
|
|
|
|
|
|
I have a class that represents a log file.
This class has two functions and a member variable
CFile m_file
First is StartLog conains code
m_file.Open(.....);
Second StopLog contanis code
m_file.Close();
And also there is a function AddEvent like this:
m_file.Write(.....);
m_file.Flush();
I call StartLog when my program starts, and StopLog when it exits. AddEvent is called several times while program runs;
It works fine mostly, but there is a problem:
File gets corrupted (it contains junk) when the program gets terminated incorrectly. For example when somebody has rebooted computer or terminates it via task manger. (Close() is not get called in this case)
Should I reopen and close file every time I need to write to it to ensure safety of the data???

|
|
|
|
|
Yes. Add code in the class destructor to close the file.
Kuphryn
|
|
|
|
|
I already did.
The problem Is that when the program is terminated incorrectly, the garbage appears inside a file sometimes....
You see, the Close() is not called in such a case 
|
|
|
|
|
Yeah.
The only solution is to analyze the file as the program opens it. Do CRC check or simply calculate the bytes and remove all extra data.
Kuphryn
|
|
|
|
|
M A V wrote:
The problem Is that when the program is terminated incorrectly, the garbage appears inside a file sometimes....
If you manually open the file in append mode, write to the file, and then manually close it every time then you are unlikely to experience the corruption you are talking about.
The only way it could get corrupted is if the system were incorrectly shut down during the few milliseconds that the file were open.
|
|
|
|
|
Is there a way to get the position of the users mouse, and/or move the cursor to a selected part of the screen in MFC? Any help would be appreciated.
-Dev578
|
|
|
|
|
GetCursorPos, SetCursorPos 
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Wasn't expecting it to be that easy, ty Believe it or not that actually helped me out quite a bit.
thanks again
-Dev578
|
|
|
|
|
Hi there...
I'm using VC6 & STL in my program along with Openssl.
I'm getting compilation error in OpenSSL\bn.h
The error is as follows:-
error C2955: 'modulus' : use of class template requires template argument list
c:\program files\microsoft visual studio\vc98\include\functional(57) : see declaration of 'modulus'
There seems to be some kind of conflict in template names, because STL and OpenSSL structure are using same template name.
Is there any simple workaround for this ?
Any help is appreciated.
Cheers,
Sheetal.
|
|
|
|
|
Have you inserted
using namespace std; before including "bn.h" ? If so, try deleting the using directive.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
How do I always show the vertical scrollbar in an CListCtrl (report view)? Just call ShowScrollBar( SB_VERT, true ); in every OnSize method doesn't work, because then the last column (which has the flag LVSCW_AUTOSIZE_USEHEADER) is too big.
The implementation of the CListCtrl seems to be really clumsy, because it is somehow handled completely different than in any other WIN32-Control. Thanks for any answer.
Konrad
|
|
|
|
|
Hi,
I'm trying to solve the very same problem and I haven't been successfull with that ShowScrollbar-function either.. It doesn't help that I'm not that experienced with MFC.
I'm wondering that could this be solved by simply using the WS_VSCROLL style when creating the control?
Well, in my app the scrollbar _does_ show in certain situations when using that style (even if there are only few items in the report view and therefore no actual need for the scrollbar) but I haven't been able to pinpoint the exact conditions for this. My guess is that this behavior has something to do with redrawing.. You tell me
But hey, give it a try and let the world know if it works..
-Jussi
|
|
|
|
|
How to overcome this error following error
LINK : fatal error LNK1181: cannot open input file "..\..\..\..\Program Files\Microsoft Visual Studio\VC98\Lib\WINMM.LIB"
What can be the reason for this?
How to overcome?
Thanks In advance
__________________
Leave Your Mark Wherever You Go
|
|
|
|
|
Your path to the lib-files seems to be invalid. Just set the correct path in Visual Studio. If you use version 2003 go to Tool->Options->Projects->Vc++ Directories and set the correct path for library files.
In Visual Studio 6 it should be very similar.
Konrad
|
|
|
|
|
I have an edit box to be enabled when user tick check box and disabled when box is unchecked.
I want the disabling/enabling to be done immediately after user use the mouse click to check/uncheck. How do i detect the mouse click? currently the code is:
if(left mouse click and box is checked){
GetDlgItem( IDC_BUTTON1 )->EnableWindow(TRUE);}
else{
GetDlgItem( IDC_BUTTON1 )->EnableWindow(FALSE);
}
|
|
|
|
|
Handle the BTNCLICK massage for the check box.Note associate a boollean member variable with the checkbox tocheck the current status.
|
|
|
|
|
Hi all!
Help me,please!
How to hook and override api fuctions?
Example DrawText funtion
|
|
|
|
|
read codeproject.com and stop making exaggarative use of exclamation marks, that makes your question in no way more important than other threads.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi all!
Help me,please!
How to hook and override api fuctions?
Example DrawText funtion
|
|
|
|
|
Hello!
Take some time and read:
http://research.microsoft.com/sn/detours/

|
|
|
|