Hi all,
I keep getting a strange error and can't pin it down. The message is:
This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.
However I'm not purposely requesting that the Runtime terminate in an
"unusual way." The line that is causing me headaches is:
wcscpy(data, MyCode.c_str()) ;
Where data and MyCode are defined as:
wchar_t data[256];
std::wstring AuthorCode;
The strange thing is that the program appears to be running fine in Visual
Studio, but generates the error message whenever I try to run it from the
command line. Putting a try...catch block around the line in question
doesn't help - it doesn't catch the exception. I have no idea what's
causing this...
Any ideas are appreciated!
Thanks!
Sep 12 '06
11 2494
Mike C# wrote:
I ran some more tests, which is all I can do considering I cannot reproduce
the problem under the debugger. There's no explicit differentiation between
my choice of code paths under the debugger versus outside the debugger. If
a different code path is taken, process of elimination says it has to be
inside the MS MFC and Windows libraries. And I'm not eager to delve into
those. Instead I'm re-writing code to avoid as many of these functions as I
can.
Hmm, OK--if you think that the lines that cause it are those assignment
of AuthorCode to the wstring, what if you comment out everything and
just leave that assignment? (I'm not sure how big your program is so I'm
not sure how feasible it is).
But I suppose if you just wrap those 3 lines inside a bare main(), and
compile and run it, it'll run just fine?
Also, have you put some indicator just before and just after the line
where you think it blows up, just to see that indeed it blows up on that
very line when you run the executable? e.g.:
wcout << MyCode.c_str();
wcscpy(data, MyCode.c_str()) ;
wcout << L"My Code copied successfully!";
wcout << data;
Thanks.
"Ray" <ra********@yah oo.comwrote in message
news:e$******** ******@TK2MSFTN GP05.phx.gbl...
Mike C# wrote:
>I ran some more tests, which is all I can do considering I cannot reproduce the problem under the debugger. There's no explicit differentiatio n between my choice of code paths under the debugger versus outside the debugger. If a different code path is taken, process of elimination says it has to be inside the MS MFC and Windows libraries. And I'm not eager to delve into those. Instead I'm re-writing code to avoid as many of these functions as I can.
Hmm, OK--if you think that the lines that cause it are those assignment of
AuthorCode to the wstring, what if you comment out everything and just
leave that assignment? (I'm not sure how big your program is so I'm not
sure how feasible it is).
Did it, didn't work.
But I suppose if you just wrap those 3 lines inside a bare main(), and
compile and run it, it'll run just fine?
In VS it did, but not outside of VS.
Also, have you put some indicator just before and just after the line
where you think it blows up, just to see that indeed it blows up on that
very line when you run the executable? e.g.:
That's the first thing I did, and how I determined that it blew up on that
line.
wcout << L"Step 1\n";
wcscpy(data, MyCode.c_str()) ;
wcout << L"Step 2\n";
....
The output inside VS.NET was:
Step 1
Step 2
From the command line the output was:
Step 1
This application has requested the Runtime to terminate it in an unusual
way. Please contact the application's support team for more information.
wcout << MyCode.c_str();
wcscpy(data, MyCode.c_str()) ;
wcout << L"My Code copied successfully!";
wcout << data;
Just a follow up: I still have no idea what the problem was exactly, but I
installed VS Service Pack 1 and the newest Platform SDK, then recompiled and
it seems to run fine now from the command line. Maybe some of my files were
corrupted or something, but this seems to have fixed this particular
problem. Thanks all! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Olaf |
last post by:
I have a frameset page witch contains the myFuc() function. The
function is accessed from a page in one of the frames in the frameset.
An example is shown below.
<input onclick="javaScript:alert('document.forms(0)='+document.forms(0));
parent.myFunc(document.forms(0));" type="button" value="Open"
name="Button" ID="Button">
The strange part is that the debug alert says that the
document.forms(0) is an object så all seem to be well. But...
|
by: Neil Ginsberg |
last post by:
I have a strange situation with my Access 2000 database. I have code in the
database which has worked fine for years, and now all of a sudden doesn't
work fine on one or two of my client's machines. The code opens MS Word
through Automation and then opens a particular Word doc. It's still working
fine on most machines; but on one or two of them, the user is getting an
Automation Error. The code used is as follows:
Dim objWord As...
|
by: Kris Vanherck |
last post by:
yesterday i started getting this strange error when i try to run my asp.net
project:
Compiler Error Message: CS0006: Metadata file
'c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net
files\spsweb\0e3514bf\cb1844e7\assembly\dl2\3b163f
16\00452d31_84e5c301\infragistics.webui.ultrawebgrid.v3.dll' could not be
found
|
by: Gary |
last post by:
I have an application that has been working just fine for a couple of years.
It queries a SQL database and returns some formatted data back to the client.
I have a new client, who has a larger database than any of our previous
customers. For example, the query to build the datatable now takes about 2
minutes instead of one minute or less. This is a third party database we are
integrating with. He is getting very strange results. For...
|
by: Nathan Sokalski |
last post by:
When I view my index.aspx page any time after the first time, I recieve the
following error:
System.Web.TraceContext.AddNewControl(String id, String parentId, String
type, Int32 viewStateSize) +313
System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
calcViewState) +201
System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
calcViewState) +263
| |
by: ivb |
last post by:
Hi all,
I am using DB2 8.1.11.1 on NT with ASP.NET 1.1
When application make connection to database (via ADO.NET), it set
"Connection timeout" parameter to 30 seconds.
After, when my webpage requests database, and query execution time
exceeds 30 seconds, the following error reported:
===
|
by: Martin Joergensen |
last post by:
Hi,
I've encountered a really, *really*, REALLY strange error :-)
I have a for-loop and after 8 runs I get strange results...... I
mean: A really strange result....
I'm calculating temperatures. T = 20 degrees at all
times.... The 2D T-array looks like this:
|
by: JoReiners |
last post by:
Hello, I have a really strange problem. I'm unable to figure it out on
my own.
I parse very simple xml documents, without any check for their form.
These files look very similar and are encoded in UTF-8.
Now minidom is always able to parse these files with
minidom.parse("file") .
Now when fetching I use this expression:
xmldoc.getElementsByTagName('DocNumb').firstChild.data.encode('latin1')
|
by: Shelly |
last post by:
I am encountering two strange problems.
First one:
I get a "server misconfiguration error", but only sometimes. It occurs on
the first screen that accesses the database on a submit. This error is
intermittent -- sometimes it happens and sometimes not from the same screen
with the same data.
Here is the error:
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |