|
In VB you can do
MsgBox Err.Description
to see a string description of the error. However sometimes it will issue "Unspecified error" or something like that which does not help much.
Best regards,
Alexandru Savescu
|
|
|
|
|
I agree with your observation.
In the particular case above it was about calling add method of IXMLDOMSchemaCollection interface. It throws a _com_error object when fails and will always provide an appropriate description. Should be no reason to warry about it.
rechi
|
|
|
|
|
Hi Friends....
i just try a program in VC++ compiler,then there is an Exeption occurs...Anyone can give me an Explanation abt the following???
void main()
{
char *s = "123456789" ;
for(int i =0 ;i <strlen(s) ; i++)
{
char ss = *(s+i) ;
*(s+i) = 'x' ; //Exception
// s[i] = 'x' ; Exception
}
}
"A Programmer Never Dies..!!!"
|
|
|
|
|
's' points to read-only memory - this is the place where string literal "123456789" is stored. Change s declaration to
char s[] = "123456789";
or, better yet, switch to std::string.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
i already get the solution..but i want the reason behind it...is it in the code segment/data segment...why this consider as read only and how...what happend to when we cahnge that stsmnt in to []..??
pls explain.....
A Programmer Never Dies..!!!
|
|
|
|
|
'char *s' declares a pointer which stores an address. char s[] creates an array which is initialized at runtime. In this case, there's a literal string in read-only segment. This literal is copied into the array located in read-write data segment.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
But it Working in TURBO C++ Compiler
A Programmer Never Dies..***
|
|
|
|
|
Turbo C++ creates DOS executables, and you surely know that there's no memory protection under DOS.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
s points to a constant string, you can§t change it.
Pavel
Sonork 100.15206
|
|
|
|
|
i already get the solution..but i want the reason behind it...is it in the code segment/data segment...why this consider as read only and how...what happend to when we cahnge that stsmnt in to []..??
pls explain.....
A Programmer Never Dies..!!!
|
|
|
|
|
Because inherently, the "..." is a literal, and is placed in a const segment. This *should* be a safe thing to do, and the segment then can be read-only. This allows the compiler/optimiser to use string pooling (multiple occurrences of the same literal can be folded into one). The address (char*) is the variable part, and is in the r/w segment.
The [] version simply declares and initialises some of the r/w segment, and is different.
Steve S
[This signature space available for rent]
|
|
|
|
|
The string is in code segment.
Pavel
Sonork 100.15206
|
|
|
|
|
But it Working in TURBO C++ Compiler
A Programmer Never Dies..***
|
|
|
|
|
DOS version of Turbo C++? The code segment is read-only on Windows.
Pavel
Sonork 100.15206
|
|
|
|
|
Howdy,
Does anyone know of a macro or whatever which lets you display line numbers in the VC6 Editor? I am having no luck so far...
Cheers
James
|
|
|
|
|
Try this dude..... but it's for C under Linux...might work here too.
#define TRACE printf ("%filename, %linenumber\n", _ _FILE_ _,_ _LINE_ _)
be careful with the "_"
and call TRACE anywhere you want. IE: TRACE; that's all
Good luck to ya.
Jey
|
|
|
|
|
Hi,
I'd be oblidged if someone can give me the code (using VC++) to accessing a particular port at a specified IP address.
The code should detect for failure(-1) or success.
Many Thanks,
John
|
|
|
|
|
Looking through a log file from Dr Watson (drwtsn32.exe) i found the following line
'------------ Stack Trace ---------*
FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Funktionsnavn
01712610 00000665 6C3A1C58 01711320 00000001 6C3A1C58 !DLdbAPI::`default constructor closure'
Now I am wondering what 'default constructor closure' means ... can anyone help (the program that creates the dump/crash is in visual c++
Something clever
|
|
|
|
|
I *guess* this may be the default constructor generated by C++ compiler. Do you have the source for DLdbAPI class?
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Yes I do have the source, but it doesn't really give any hints as to what this could mean. But I suspect that you're probably right, it probably has something to do with the default ctor.
Something clever
|
|
|
|
|
Is there a difference between Visual C++ and C++
|
|
|
|
|
Question is Silly but Good
VC++ is Microsoft specific...
A Programmer Never Dies..!!
|
|
|
|
|
C++ is a programming language, Visual C++ is Microsoft's product for programming in the C++ language.
|
|
|
|
|
markkuk wrote:
C++ is a programming language, Visual C++ is Microsoft's product for programming in the C++ language.
This is the nicest (shortest and accurate) explanation
Best regards,
Alexandru Savescu
|
|
|
|
|
Can C# use the unmanaged classes I created with VC++ 6.0 before, which use many pointers ?
|
|
|
|