|
Hi All,
I my project when I run the application then it crash and when I
debug that application then it is working fine. So can any body give me solution to this problem.
Thanks in Advance
am
hi
|
|
|
|
|
Send me u'r project.
Come online at:-
jubinc@skype
|
|
|
|
|
Have a look at http://www.flounder.com/debug_release.htm[^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
most often the cause is an unitialized variable...
Are there any warnings when you compile your program? Did you fix them?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
In the release you must have no errors in variables initialization, by default the debug version makes "some tricks" that avoid crashes due to bad initializations.
Take a look around your code (specially by starting sections that you programmed, altough I recommend you to the whole programm) and be sure that you are giving a "valid" value to EVERY variable you declare. No matter if local, global, one type or another. Use "0", "NULL", "-1" whatever you want, but use something.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
We are clever guys but if you more explain about your program will be helpful.
|
|
|
|
|
Hamid. wrote: We are clever guys
I like the modestly way you tell it :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
|
Hi......
I am working on a SDI (Form based i.e., CFormView) Application. I need to remove the Tittlebar & Menu. Can anybody help me.
Thanks in advance
Sairam
|
|
|
|
|
Hi,
If you dont want Menu and ToolBar in your SDI application.
Comment the Hilighted Lines in this program.
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
//if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | //WS_VISIBLE | CBRS_TOP
// | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | //CBRS_SIZE_DYNAMIC) ||
// !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
//{
// TRACE0("Failed to create toolbar\n");
// return -1; // fail to create
//}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
//m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
//EnableDocking(CBRS_ALIGN_ANY);
//DockControlBar(&m_wndToolBar);
return 0;
}
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
Hmmm...
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
How can i disconnect a computer from using internet after a specified amount of time. The internet connection can be in the form of dial up or LAN/PPP.
Please advice.
Thanks in advance.
Regards,
John.
|
|
|
|
|
emmmatty1 wrote: The internet connection can be in the form of dial up...
If RasDial() was used to make the connection, use RasHangUp() to terminate the connection.
I would think a better solution would be to mimic what happens when you right-click a connection and select Disable. I am not sure what API does this, however. You could try tapping into the Shell (i.e., opening the Network Connections applet in Control Panel, finding the Local Area Connection object, and then invoking its Enable or Disable menu item). I can do this via VBS but have not tried in VC++.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
modified on Wednesday, December 19, 2007 10:04:20 AM
|
|
|
|
|
What do you expect "disconnect" to do, when your computer is connected to a LAN with access to the internet?
Or are you talking about your computer actually *being* the router, connected to some sort of DSL or cable modem?
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Hello everyone,
Why Visual Studio compiler can not optimize in this case? I think this case is almost the same as sample 1, why compiler can optimize sample 1 but can not optimze sample 2?
(sample 2, http://msdn2.microsoft.com/en-us/library/ms364057(vs.80).aspx)
class A {
public:
A() {printf ("A: I am in constructor\n");i = 1;}
~A() { printf ("A: I am in destructor\n"); i = 0;}
A(const A& a) {printf ("A: I am in copy constructor\n"); i = a.i;}
int i, x, w;
};
class B {
public:
A a;
B() { printf ("B: I am in constructor\n");}
~B() { printf ("B: I am in destructor\n");}
B(const B& b) { printf ("B: I am in copy constructor\n");}
};
A MyMethod()
{
B* b = new B();
A a = b->a;
delete b;
return (a);
}
int main()
{
A a;
a = MyMethod();
}
thanks in advance,
George
|
|
|
|
|
And what is sample 1 and sample 2?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Hi Nelek,
Here is sample 2 code. I do not understand why if we optimize by /O2, there is still copy constructor invoked?
http://msdn2.microsoft.com/en-us/library/ms364057(vs.80).aspx[^]
Here is output,
A: I am in constructor
A: I am in constructor
B: I am in constructor
A: I am in copy constructor
B: I am in destructor
A: I am in destructor
A: I am in destructor
A: I am in destructor
class A {
public:
A() {printf ("A: I am in constructor\n");i = 1;}
~A() { printf ("A: I am in destructor\n"); i = 0;}
A(const A& a) {printf ("A: I am in copy constructor\n"); i = a.i;}
int i, x, w;
};
class B {
public:
A a;
B() { printf ("B: I am in constructor\n");}
~B() { printf ("B: I am in destructor\n");}
B(const B& b) { printf ("B: I am in copy constructor\n");}
};
A MyMethod()
{
B* b = new B();
A a = b->a;
delete b;
return (a);
}
int main()
{
A a;
a = MyMethod();
}
thanks in advance,
George
|
|
|
|
|
George_George wrote: I do not understand why there is still copy constructor invoked?
Because for efficiency-reasons,
A a = b->a; invokes the copy constructor instead of the constructor and the assignment-operator.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Thanks jhwurmbach,
You mis-understood my question. My question is NRVO technique is used to optimize to reduce the need to invoke copy constructor. Why in the above code, NRVO does not take effect and copy constructor is still invoked.
regards,
George
|
|
|
|
|
Hi Friends,
I want to know the size of WCHAR.
This is the code line i am using WCHAR InputText[99999]=L"";
I am using this string to read a *.txt file.
But if i choose a 5 mb file. I am not able to read.
It is posible to increase the size
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
U can set its value to the maximum positive value of int or to the available memory.
Come online at:-
jubinc@skype
|
|
|
|
|
WCHAR* InputText = ( WCHAR* ) HeapAlloc( GetProcessHeap( ), HEAP_GENERATE_EXCEPTIONS, 5 * 1024 * 1024 );
|
|
|
|
|
Not many people read the whole file into a buffer. As we say, this solution doesn't scale.
Most people read text files, line by line... only buffering what they need.
If you're writing a text editor... it's a different story... and in that case you should dynamically allocate the text file buffer.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
santhoshv84 wrote: This is the code line i am using WCHAR InputText[99999]=L"";
Why not use a std::wstring object instead?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i am working on client server application both are developed on mfc.My problem is that client create a file after writing put it in a directory on server and server is continuously searching that directory and try to open that file but still hold by client.How can i know that particular file is not hold by client.
thank u in advance
|
|
|
|