|
Hi All,
If I run the Activex Control Test Container Application to test the activex control, the Test Container application either crashes or dumps an "unspeifified error" as "Microsoft Development Environment has encounters a problem and need to close".
Help me to fix the error!
|
|
|
|
|
hi
i have a application in windows mobile that is to create a ini file.
in nthe same ini file i must write data and read the data
k.guru moorthy
|
|
|
|
|
|
// select suitable seedwave file for the deck
CString file_now;
s_dis=0;
int ii=0;
file_now=ftitle[0];
s_dis=sd_dis[0];
//
do {
file_now=ftitle[ii];
s_dis=sd_dis[ii];
//
ii =ii+1;
//
} while (ii<nfile && sd_dis[ii]<dis);
//
I debudg my program I got "Access Violation" at ii=ii+1; all other variables print value correctly. I really do not know what is the problem ?
Thanks for the help
|
|
|
|
|
mrby123 wrote: I debudg my program I got "Access Violation" at ii=ii+1;
What is the value of ii at this point?
"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
|
|
|
|
|
at this point ii=0. However, if the statement would exicute, ii should be 1.
However, access violation occured when the statement was tried to exicute.
You can see I initialized ii before the block.
Thanks
modified on Saturday, January 26, 2008 2:54:41 AM
|
|
|
|
|
I think you should post also array declarations.
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.
[my articles]
|
|
|
|
|
Thanks for your response.
Here is the array declarations:
float sd_dis[20];
CString ftitle[20];
//
CString file_now;
s_dis=0;
int ii;
ii=0;
do {
file_now=ftitle[ii];
s_dis=sd_dis[ii];
ii =ii+1;
} while (ii<nfile && sd_dis[ii]<dis);
//
|
|
|
|
|
Well, of course ii=ii+1; cannot give such an exception, you have to check, using the debugger, for out-of-boundary array access, i.e. if ii happen to be 20 or more in code containing sd_dis[ii] or ftitle[ii] .
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.
[my articles]
|
|
|
|
|
Thanks for the comments:
I can not find anything like "if ii happen to be 20 or more in code containing sd_dis[ii] or ftitle[ii].". At ii=ii+1 the error pointed in the debudg at the following statement:
->> 00433872 mov dword ptr [ecx],edx
Thanks for the help
|
|
|
|
|
Could please post the whole error message (and the whole code snippet)?
What is the ii value when the exception occurs?
BTW the assembly instruction reported doesn't appear to be an integer increment operation: it seems more an array access.
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.
[my articles]
|
|
|
|
|
We used to use strncpy to protect the buffer when copying into it. Does strcpy_s totally take that over?
I know when I debug, that sometimes I get a runtime error inside strcpy_s when the source string is longer than the buffer.
Will this runtime error appear in a non-debug build?
And should I really be using strncpy_s() instead of strcpy_s()?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Peter Weyzen wrote: And should I really be using strncpy_s() instead of strcpy_s()?
Only if you need to tell the function how many characters to copy.
"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 guess it was the exception inside strcpy_s that got me.
I hope that's debug only....
What's your opinion of the _s funtions? They seem long overdue...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Peter Weyzen wrote: What's your opinion of the _s funtions? They seem long overdue...
Non-portable, slow and also not very secure either.
|
|
|
|
|
Hi all,
I've see apps before where you click a button and it shows you a listbox with local SMTP server(s). How exactly is this done? I've done some research into querying MX records, and also the DnsQuery function in Windows, but they don't help at all.
Can anyone give me some pointers?
Thanks in advance.
|
|
|
|
|
hxhl95 wrote: How exactly is this done?
DnsQuery() is but one way.
PDNS_RECORD pRec = NULL;
DnsQuery(lpszHostDomain, DNS_TYPE_MX, DNS_QUERY_STANDARD, NULL, &pRec, NULL);
"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
|
|
|
|
|
How would I find the host domain though?
|
|
|
|
|
Can't you use whatever domain you are sending the e-mail to?
"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 could, but I've seen apps where they get the local domain...I'm just curious. I mean, of course it would work to get the domain of the recipient's email(s), but I'd like to know how you get the local domain name.
And...to use DnsQuery you have to include WinDNS.h and add dnsapi.lib to your library files, right? I've added dnsapi.lib in, but my VC++ 6.0 compiler tells me that it can't find the file. Why? (I've installed the SDK already)
modified on Saturday, January 26, 2008 11:21:58 PM
|
|
|
|
|
hxhl95 wrote: ...but my VC++ 6.0 compiler tells me that it can't find the file. Why?
Is your SDK's Include folder known by the IDE (it's not by default)? If you use an absolute path with dnsapi.lib, does that satisfy the linker?
"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
|
|
|
|
|
Yeah, the IDE knows the include folder's path. I added it in.
Apparently though, everything works without Dnsapi.lib. MSDN told me that DnsQuery needed dnsapi.lib, but I guess not.
So one question remains: Is there any way to obtain the local domain?
|
|
|
|
|
hxhl95 wrote: ...but I guess not.
So what other library do you suppose its hiding in?
hxhl95 wrote: So one question remains: Is there any way to obtain the local domain?
hxhl95 wrote: So one question remains: Is there any way to obtain the local domain?
You can use NetWkstaGetInfo() for this.
"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
|
|
|
|
|
About NetWkstaGetInfo():
LPWKSTA_INFO_100 netinfo = NULL;<br />
if (NetWkstaGetInfo(NULL,100,(LPBYTE*)netinfo)!=NERR_Success){<br />
MessageBox("Error");<br />
return;<br />
}
I get the messagebox each time. Any clues as to why the function isn't getting the info properly? I debugged, and past the NetWkstaGetInfo line, netinfo points to 0x00000000...Definitely not correct.
Thanks for all your help.
|
|
|
|
|
If NetWkstaGetInfo() is failing, have you called GetLastError() .
"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
|
|
|
|