With all due respect. you looked at the (psuedo) code and not the question, the char * shown in the object is really a const char * (as it only sets char * to hardcoded strings) and the new is not shown in the snippit because I want to know what signature to use to avoid the default copy constructor being called.
What I want to do is use a constructor and then use a function to further initialize it in one statement. The problem is...
User Profile
Collapse
-
Construct followed by setter
Hello Guys and Gals,
Been trying to throw as follows.
throw MyException("ba d exception OMG").inputValu e("value");
I observed a strange error in my code the hypothetical MyException class has a pointer which needs to be "new" allocated. The problem was that said pointer was not initialized.
This leads me to believe that copying is going on and the copy constructor... -
vainstah replied to deriving from std::exception and overiding what() to construct dynamic messages.in Cconst_cast had completely slipped my mind. If I had marked the objects I am using for string manipulation as const (I think) I would not have had to add an extra level of indirection to my code, I would have done a const_cast.
Your tip has directly addressed my confusion. Thank you.
I am still a bit miffed at how the const keyword is used in C++. I appreciate the need for it in the design of an API and as a tool to reduce...Leave a comment:
-
Theoritically :
What you are talking about is the functionality of code a profiler. Basically a compiler should have the ability to instrument your functions so that some code is executed at the entry and exit of your function.
In practise :
The above paragraph talks about what is available in dynamic languages. From experience In the systems languages world such support is obtuse and hard to find (intel compilers do it...Leave a comment:
-
vainstah started a topic deriving from std::exception and overiding what() to construct dynamic messages.in Cderiving from std::exception and overiding what() to construct dynamic messages.
Hello Guys and Galls,
To start off, I have reached the solution I was looking for, but I would like comments and feedback on the solution I have reached and tips/tricks on making it more elegant. I am not satisfied with the underlying machinery of the solution though.
I am an advanced C programmer and most do object-based programming in C++. Please do not reply to this article with references to basic material or obvious... -
Hi Guys,
I sent this to the microsoft ODBC native client team :
And got this response :
so I guess i'm gonna have to hack together a solution along the lines of what rkeith mentioned but without using the external bcp utility or varchars for the fields. :D...Leave a comment:
-
Hello rkeith27,
The method you mention is one way of doing it, however the ODBC(and OLE DB) drivers that come with ms-sql-server 2005 and above support bulk inserts natively. It supports the method you mention above programaticall( i,e. Without having to call the BCP utility).
Additionaly though, it supports building the rows code side by binding memory locations to columns with bcp_bind and then calling bcp_sendrow...Leave a comment:
-
SQL Server 2005 native client ODBC query
Hello Guys,
I am writing a high performance win32 telemetry midleware service which uploads to SQL server in bulk frequently. I know how to do simple things in ODBC native-client.
ODBC native-client documentation is terse to say the least. I would like to know from people who have used the native client bulk upload feature what the behaviour of a bulk upload is when one of the rows causes a server-side constraint error....
No activity results to display
Show More
Leave a comment: