|
overloading with the following code produced no change in compile results.
bool CErasCls::operator ==(const CErasCls &Array)
{
if( m_Code == Array.m_Code &&
m_Description == Array.m_Description &&
m_Synopsis == Array.m_Synopsis)
return true;
else
return false;
}
|
|
|
|
|
the operator== takes 2 parameters:
<br />
bool operator==(const CEraCls &lhs, const CEraCls &rhs)<br />
{<br />
}<br />
And the overloadeded operator doesn't need to be a member of the class (I don't think it does matter though).
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
I thought of that and that didn't work either , however the following solution DID work.
<br />
bool operator==(const CEraCls &pCopy) const<br />
{<br />
}<br />
go figure.
thanks for the tip though.
|
|
|
|
|
hi,
can someone please explain me with simple words whats the diffrence between CxxxDoc and CxxxView?
Help please...
Avi.
|
|
|
|
|
The class CxxxDoc contains information used by CxxxView.
The CxxxView (often called just "view" or GUI) is the window that a user can actual see.
The CxxxDoc (often called "document") is the class where the data is stored. The document class is also used for serialisation.
If you want to know more about the MFC Doc/View architecture, I suggest you read some articles about it.
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
ok, i read and understood the architechture...
but now i have more complicated question (plz help...) -
if i want to query a table from a DB,
should the query operation be at the CxxxDoc and the query results should be shown by the CxxxView?
thanks again, Avi.
|
|
|
|
|
Yes, that's the best solution .
|
|
|
|
|
how do i transfer data from CxxxDoc to CxxxView?
Avi
|
|
|
|
|
From the document, to obtain a pointer to the view:
<br />
POSITION Pos = GetFirstViewPosition();<br />
if (Pos)<br />
{<br />
CXXXView* pView = (CXXXView*)GetNextView(Pos);<br />
pView->DoSomething();<br />
.... <br />
Do something with the pointer<br />
}<br />
From the view, to obtain a pointer to the document:
<br />
CXXXDoc* pDoc = GetDocument();<br />
if (pDoc)<br />
pDoc->DoSomething();<br />
|
|
|
|
|
Has anyone creates a project in Visual Studio 6 for building a 64-bit DLL? Thanks
|
|
|
|
|
Hi!,
I want to know how to make a service that will automatically restart every 3 hours or make windows 2000 server to reboot every 3 hours.
What happend is one of my services has very serious memory leak problem? To found there are bugs could take long time. So before a solution is found, we decide to restart a servier every 3 hours or make windows 2000 server to reboot itself every 3 hours.
|
|
|
|
|
Configure the service to automatically restart in the Recovery tab of the Service Properties.
Then use a TimerQueueTimer set to 3 hours and have the Service Stop itself and exit normally when the timer event fires.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I can not able to configure out how to make TimerQueueTimer work. Any exmaple. Thanks.
|
|
|
|
|
|
i don't want to method of retsrting service but i know the method of restrating machine.
you set WM_TIMER message of 5 min
eg
SetTimer(1,1000*300,NULL);//setimer for 5 min
and now make variable that increment after every WM_TIMER message
nCount++;//like this way
when timer equal to 35
use this code for restart
HANDLE hToken; // handle to process token
TOKEN_PRIVILEGES tkp; // pointer to token structure
OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken) ;
// Get the LUID for shutdown privilege.
LookupPrivilegeValue(NULL,SE_SHUTDOWN_NAME,
&tkp.Privileges[0].Luid);
tkp.PrivilegeCount = 1; // one privilege to set
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
// Get shutdown privilege for this process.
AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,
(PTOKEN_PRIVILEGES) NULL, 0);
use
::InitiateSystemShutdown(NULL,ReturnStr,(DWORD)(atoi(this->m_nmpShutdown.Time)),TRUE,TRUE); this api's
thanks
I Think It will Work
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
check my application, about the simple windos utility. There I have designed a shutdown timer. you can configure it because you have the source code
http://www.codeproject.com/useritems/A_little_window_Utility.asp
gabby
|
|
|
|
|
Is 115,200 Baud the max rate for Win32 serial driver? There are definitions for 128kbaud and 256 kbaud but these don't seem to work. If they did they would not work with the device i'm communicating with.
Thanks
Carter
|
|
|
|
|
They won't unless you have special hardware that supports them.
The highest standard baudrate is 115,200 baud and then that is divided to get 57,600 (/2), 38,400 (/3) etc.
It is possible they were put in place to support IDSN or something similar and never removed.
Elaine
The tigress is here
|
|
|
|
|
Thanks Elaine!
I think the ISDN (or whatever) support makes sense. I appreciate the help.
Carter
|
|
|
|
|
Hi, I have coded a custom CMiniDockFrameWnd derived class that removes the WS_CAPTION bit from its style to remove the title bar from the toolbar in the app.
Only trouble is that that CDockContext class calls a static function in CMiniFrameWnd to calculate the drag rect of the bar. The function is defined as;
<br />
static void PASCAL CalcBorders(LPRECT lpClientRect,<br />
DWORD dwStyle = WS_THICKFRAME | WS_CAPTION, DWORD dwExStyle = 0);<br />
<br />
void PASCAL CMiniFrameWnd::CalcBorders(<br />
LPRECT lpClientRect, DWORD dwStyle, DWORD dwExStyle)<br />
{<br />
UNUSED_ALWAYS(dwExStyle);<br />
<br />
AdjustWindowRectEx(lpClientRect, dwStyle, FALSE, WS_EX_PALETTEWINDOW);<br />
}<br />
Believe it or not, the CDockContext class uses the default parameters of the function so the drag rect of a tool bar is always calculated with a title bar and thickframe. This causes series bugs in my app not just a mis-aligned toolbar drag rect but the entire toolbar dragging screws up.
I was wondering if anyone knew a way to modify how CalcBorders behaives or how to modify the CDockContext::startDrag function without vast amounts of rewriting of MFC.
Ed Deighton - eddeighton@freeuk.com
|
|
|
|
|
|
hello guys,
i'm doing programming in vc++ on building a simple neural network. Can anyone help me out by giving any reference of coding a neural network in VC++.
thanks in advance,
Pavan.
|
|
|
|
|
GOOGLE: VC++ "neural network"
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
thanks for your suggestion....
i have tried for it many times before...but i'm not able to find anthing
|
|
|
|
|
pavanbabut wrote:
but i'm not able to find anthing
1) Start your Internet Browser Program
2) Navigate to http://www.google.com
3) Enter the Search Text:
VC++ "neural network"
4) Click the Search button
5) Wait until the search completes and displays the first page of the 737 results found
6) Click one of the links presented as results and read the contents therein
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|