|
Add an OnSysCommand[^] handler that watches for SC_CLOSE and calls __super::OnCancel() when it hits.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
See here.
"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
|
|
|
|
|
David,
That FAQ answered many other questions. Thanks for its post.
|
|
|
|
|
Also, one use use PreTranslateMessage to intercept the ESC key. Add the function to the dialog using the class wizard, then check for the ESC key.
BOOL CDxf2NastranDlg::PreTranslateMessage(MSG* pMsg) <br />
{<br />
if(pMsg->wParam == VK_ESCAPE) { return TRUE; }<br />
<br />
return CDialog::PreTranslateMessage(pMsg);<br />
}<br />
|
|
|
|
|
Hi,
I want to read Text File line by line and code follows;(with out using the << operator and char buffer)
ifstream Textfile;
Textfile.open(strFilePath,ios::in);
string value;
while(!Textfile.eof())
{
getline(Textfile,value);
}
Textfile.close();
When i am compiling the above code it throws the error as
error C3861: 'getline': identifier not found, even with argument-dependent lookup
How to rectify this error.. Any other sample Code??
reg,
Subbu
|
|
|
|
|
Did you #include <string> ?
Also, basic_istream has a member getline() , maybe try using that one?
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Make sure you're including a using namespace std; line as well.
Dybs
|
|
|
|
|
Hi, is it possible to draw the background of a status bar with UxTheme.dll ? I was browsing through available XP Visual style controls[^], but can't find the status bar background.
Thanks for any help. I looked into existing articles here at CodeProject, which usually derive from CStatusBar (to get the background) and then extend it. I like to find out if it's possible to make an owner-draw control without using the standard status bar control at all.
Cheers!
|
|
|
|
|
|
Thanks but my question is not about subclassing.
|
|
|
|
|
Yes, it works like for all controls, with DT
(see on Win32 ng[^] for code, in C/Win32)
|
|
|
|
|
hi i try to convert code but i dont know how put bass in the code C# to C++ by example here
class NAME() : base();
{
bla.item;
}
base.item;
how i can pass it to C++
and the variables private in C# repeat the private keyword
private variable1;
private variable2;
in C++ its the same way do this?
private:
variable1;
variable2;
|
|
|
|
|
That is not C# code.
Can you re-state your example?
David Anton
http://www.tangiblesoftwaresolutions.com
Convert VB to C#, C++, or Java
Convert C# to VB, C++, or Java
Convert C++ to C#, VB, or Java
Convert Java to C#, C++, or VB
|
|
|
|
|
Can anyone tell me why i receive right data in case of traditional chinese but not in Simplified Chinese... I'm searching and experimenting "How to display right data in GUI" in case of "Simplified Chinese Character", But nothing seems to work..
So i just need to know why my applications(Non Unicode) is able to display right data in GUI in case of traditional chinese, but not in simplified chinese?
P.S
I'm reading data from text files, which are encoded in UNICODE.
Thanks.
|
|
|
|
|
i want the answer plzzzz
how to display the signal image in VC++
|
|
|
|
|
But... is it URGENTZZZ ?
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Please read this[^], especially point 2 and 3, and try to obey them, otherwise, don't expect any usefull answers...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hello, I have got an project to develop Virtual Printer Drivers, I am searching for all the information for the same. We have no previous development experience so I need some points to be clarified whether I am right or wrong
1. Virtual Drivers can be created only using MFC/C++. No need to code for any hardware access.
2. No ready made libraries are available online other than WDM.H
3. Device drivers are totally different than Virtual Drivers, no use of reading about Device drivers.
4. Kernal level programming is needed or not?
Kindly answer if any one knows about the same. I am not able to get any help by Googling.
|
|
|
|
|
My Google skills lead me to that[^].
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Hi all,
I m working on SDI type Application, Here i m Using Mutex to prevent multiple instances of my exe.
i m using this code for mutex.
HANDLE hMutex = ::CreateMutex(NULL, TRUE, _T("_315FrYu76A_GlobalMainMutex__315FrYu76A"));
switch(::GetLastError())
{
case ERROR_SUCCESS:
break;
case ERROR_ALREADY_EXISTS:
return FALSE;
default:
return FALSE;
}
for system tray icon i m taking help of this article.
Adding Icons to the System Tray[^]
My problem is that if application is already running and its in hide mode and icon present in system tray,now when i click on my exe than its not open becoz of mutex.
i want when application is already running or its hide than if i click on exe than the hide application show.
please tell me how can i do this.
if possible please explain me with any example .
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
First store the main window handle somewhere like in the registry so that every other instance can access it. When the CreateMutex returns ERROR_ALREADY_EXISTS , you could check if the main window is visible using IsWindowVisible[^] and show it.
Or
You can have one thread wait on an event handle. When the CreateMutex returns ERROR_ALREADY_EXISTS , just set this event and the thread waiting on the handle can show the window.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Please can u explain me with any example.
please tell me how can i store handle in registry because its in terms of CWnd*.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote:
i want when application is already running or its hide than if i click on exe than the hide application show.
please tell me how can i do this.
if possible please explain me with any example .
One option is to use the FindWindow Function[^] to retrieve a handle to the top-level window of your target application instance. Something like this:
HANDLE hMutex = ::CreateMutex(NULL, TRUE, _T("YOUR_GUID"));
if(ERROR_ALREADY_EXISTS == GetLastError())
{
TCHAR szCaption[MAX_PATH];
LoadString(m_hInstance,AFX_IDS_APP_TITLE,szCaption,MAX_PATH);
CWnd* pwndFirst = CWnd::FindWindow(NULL,szCaption);
if (pwndFirst)
{
CWnd* pwndPopup = pwndFirst->GetLastActivePopup();
pwndFirst->SetForegroundWindow();
if (pwndFirst->IsIconic())
{
pwndFirst->ShowWindow(SW_SHOWNORMAL);
pwndFirst->PostMessage(WM_SYSCOMMAND, SC_MAXIMIZE);
}
if (pwndFirst != pwndPopup)
{
pwndPopup->SetForegroundWindow();
pwndPopup->PostMessage(WM_SYSCOMMAND, SC_MAXIMIZE);
}
}
}
Best Wishes,
-David Delaune
|
|
|
|
|
Thanks its help me ,now its done.
tnaks alot
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Randor wrote: One option is to use the FindWindow Function[^]
That is a bad option because the window caption of the app's window can change (File name added, etc.) or you can run into race conditions when two instances of the app are started almost simultaneously. See Avoiding Multiple Instances of an Application[^] for a complete discription and a proper soloution to this problem.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|