|
It depends for what !
Sometimes exceptions are much much more easy to use and reduce your code. For example if in one function you need to do a lot of operations (by calling the same function everytime), instead of each time looking for return value, you just encapsulate this in a try/catch block...
Also it's nice when you have a lot of classes 'nestled' (I mean a class that uses a class, that uses a class, ....) and you just need to know in the first class that an error occured in the 'last' class, then you don't need to check for error return at each function called. You just put a try/catch statement in the first class and that's it
|
|
|
|
|
hummm, it reminds me a conversation that took place on that forum yesterday...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I really don't see what you are talking about
|
|
|
|
|
|
Just because it is modern doesn't mean it is good. There is still a HUGE debate over exceptions. In my life, we have tried to use exceptions many times but found that they just don't scale very well. We are producing much higher quality software without exceptions than we ever did with exceptions.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Tim Smith wrote:
Just because it is modern doesn't mean it is good.
That's true. But in general modern C++ is superior to older C++. I'd still go for exceptions over error codes. However, some languages, e.g., Eiffel, have a different and arguably a superior take on exceptions than say C# and Java.
Kevin
|
|
|
|
|
Hi,
As we know, we can write a COM object with VB6, which can be refered in C#
.NET project. My question is, can I do so with VC6, other than VB6?
In VB6, it is easy to create a COM object: Wizard->ActiveX DLL.
But how to do this in VC6?
I created a DLL in VC6: MFC AppWizard -> Regular DLL with MFC static..(with
Automation checked). I refered it in my C# .NET prj, BUT any classes of it
can NOT be seen. Why?
Thank you in advance.
Dave
|
|
|
|
|
|
Thanks. It is a good idea.
|
|
|
|
|
Is is possible to give an XP look to programs written for win 2000 through manifesting?
|
|
|
|
|
|
|
Salam...
I am making a splitter in my drawing SDI. I want that anything that i draw in one pane should also be drawn in other pane. I am using the same view class. But it does not draw in the other pane. If any one could help me in this regard. I am pasting the code in OnClientCreate(...) function.
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
CRect rect;
GetClientRect(&rect);
m_splitter.CreateStatic(this,1,2);
m_splitter.CreateView(0,0,RUNTIME_CLASS
(CMyPaintBrushView),CSize(rect.Width()/2,rect.Height ()),pContext);
m_splitter.CreateView(0,1,RUNTIME_CLASS (CMyPaintBrushView),CSize(rect.Width()/2,rect.Height()),pContext);
return TRUE;
}
|
|
|
|
|
Hello all
I am working on internationalization of an application and tried using some of the functions that I could see as relevant in this context:
1)IsValidLocale() returns always true, with my 2nd argument being LCID_INSTALLED
2)Tried also using the pair EnumUILanguages() and the associated callback required, BUT could not find anywhere an example of what this call back should have inside it….
Any help will be appreciated
Thanks
Alex
|
|
|
|
|
|
Hi Michael
Thanks for that, but after following the link, could not search or ask any question becasue I am not a registerd member
Thanks again
Alex
|
|
|
|
|
|
Hi Alok
I am a registered user at CP, but I am not on that site that Michael pointed me to...
I visited your web site but could not find and answer to my question
Maybe you can be a bit more specific
Thanks
Alex
|
|
|
|
|
|
Hi all!
I have two network connections, both of which have the same destination address - the only thing that distinguishes them is the interface.
I also have two processes: process 1 may only use connection 1, and process 2 may only use connection 2.
Is there any way I can ensure that my outbound socket connects via a particular interface? I can't leave it to windows to decide which way to route the connections.
Any help would be greatly appreciated!
Thanks,
Gary
|
|
|
|
|
int nVar = 0; //GlobalVar
int main(int argc, char* argv[])
{
int nTest1 = nVar;
int nVar = 1; //1stLevelLocalVar
nTest1 = nVar;
{
int nTest2 = ::nVar; // can acess global var, but how to access 1stLevelLocalVar
int nVar = 2; //n2ndLevelVar
nTest2 = nVar;
}
return 0;
}
|
|
|
|
|
Here's your chance to learn that global variables are crap.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Don't do it. Never, ever reuse variable names like that. It just leads to all sorts of problems with accidentally using the wrong one.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
i just do it for test purpose
|
|
|
|
|
Without the global :: specifier i believe the name alone will get the variable at the next outer level of scope.
e.g.
int main(int argc, char* argv[])
{
int t0, t1, t2;
int v = 0;
t0 = v;
{
t1 = v+1;
int v = t1;
{
t2 = v+1;
int v = t2;
}
}
return 0;
}
...cmk
Save the whales - collect the whole set
|
|
|
|