Hi there,
We have to use a com interop library generated by tlbimp, where the orginal
com object is written in uniface (a compuware language). The method we use
and have the problem with has the following signature:
[PreserveSig, DispId(1002)]
int exec(
[In, MarshalAs(Unman agedType.BStr)] string servicetorun,
[In, MarshalAs(Unman agedType.BStr)] string inparameters,
[MarshalAs(Unman agedType.BStr)] out string outparameters);
As you can see we have an output parameter that returns a string. Everything
works great when the output string is <= 700k. However once it becomes
around 800k & greater, we get a horrible error that cannot be caught. Here's
the code that produces the error:
using System;
namespace MarshallingTest {
public class Class1 {
[STAThread]
public static void Main(string[] args) {
ePathway.Reques t.Broker.esyv00 05Class service = null;
try {
Console.WriteLi ne("Before create esyv0005");
service = new ePathway.Reques t.Broker.esyv00 05Class();
Console.WriteLi ne("esyv0005 created");
string xml;
service.exec("e syv0095", "", out xml);
Console.WriteLi ne(xml);
} catch (Exception e) {
Console.WriteLi ne(e.ToString() );
} finally {
if (service != null)
System.Runtime. InteropServices .Marshal.Releas eComObject(serv ice);
Console.WriteLi ne("Press a key to continue");
Console.ReadLin e();
}
}
}
}
The error is:
MarshallingTest .exe - Common Language Runtime Debuggin services
Application has generated an error that can't be handled
Process Id=0x6f8(1784), Thread Id=0xc24(3108)
Any ideas on what might be going on here ?
tia
andrew 2 2363
On 22 Jun 2004 02:37, "andrew lowe" wrote: Hi there,
We have to use a com interop library generated by tlbimp, where the orginal com object is written in uniface (a compuware language). The method we use and have the problem with has the following signature:
[PreserveSig, DispId(1002)] int exec( [In, MarshalAs(Unman agedType.BStr)] string servicetorun, [In, MarshalAs(Unman agedType.BStr)] string inparameters, [MarshalAs(Unman agedType.BStr)] out string outparameters);
As you can see we have an output parameter that returns a string. Everything works great when the output string is <= 700k. However once it becomes around 800k & greater, we get a horrible error that cannot be caught. Here's the code that produces the error:
<snip>
Have you tried using a StringBuilder as the out param rather than a string?
I recall seeing some stuff about doing that somewhere.....
--
Simon Smith
simon dot s at ghytred dot com http://www.ghytred.com/NewsLook - Usenet for Outlook
On Tue, 22 Jun 2004 11:37:00 +1000, "andrew lowe" <andrew [dot] lowe
[at] geac [.] com> wrote: Hi there,
We have to use a com interop library generated by tlbimp, where the orginal com object is written in uniface (a compuware language). The method we use and have the problem with has the following signature:
[PreserveSig, DispId(1002)] int exec( [In, MarshalAs(Unman agedType.BStr)] string servicetorun, [In, MarshalAs(Unman agedType.BStr)] string inparameters, [MarshalAs(Unman agedType.BStr)] out string outparameters);
As you can see we have an output parameter that returns a string. Everything works great when the output string is <= 700k. However once it becomes around 800k & greater, we get a horrible error that cannot be caught. Here's the code that produces the error:
Hi andrew:
You might try this tool to see if it gives you any useful information:
CLRSPY - http://www.gotdotnet.com/Community/U...5-ad09ef3bb37f
HTH,
--
Scott http://www.OdeToCode.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Trokey |
last post by:
I am making interop calls to an object in a .NET component from a C++
program and am leaking memory... the following is some sample code:
////////////////////////////////////////
// .NET component (Test)
////////////////////////////////////////
// interface
|
by: bugman |
last post by:
The problem started with Firefox. Got to www.foxnews.com and click on
any of the scrolling headlines in the right hand box. Firefox would
crash. Now Opera and IE do also. If I disable javascript in Firefox
the headlines do not show. Same behavior on my laptop, which is
configured in a similar fashion. What could be causing any browser on...
|
by: Jamma |
last post by:
Hello,
I have an Access 2000 file working on XP machines and a NT network.
The files are split and 95% of the time all is well and stable. The
main issue arises when the app prints,a novell netware pop up shows
and declares which printer the file is going to and when printing
completes, Access crashes. This is really starting to tick off...
|
by: J-T |
last post by:
I'm trying to read an excell file in my .Net application using Office XP
Primary Interop Assemblies
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_oxppias.asp).
I have installed Office 2003 on my developemnt box.Will my application be
able to read all kinds of Excell file (97-2000-2003)?
Dose the wrapper...
|
by: Brad |
last post by:
I have an aspx web page which initially displays fine. When I postback the
resulting response back to the client output is causing InternetExplorer 6
to crash. I've disabled the server side code for the submit button so what
is be going back to the client is just a recyling of the content. I used a
responsefilter to capture the initial...
| |
by: Technics |
last post by:
Ok I will be as clearer as I can (sorry for english/technical
mistakes)
I would like to write an audio application that supports ASIO drivers.
I downloaded the ASIO sdk from Stainberg and I read the docs and
viewed the code provided. The sdk retrieve the varius ASIO drivers
available from windows registry. The various drivers are COM...
|
by: Udi |
last post by:
Hi all,
I'm having difficulties returning a buffer allocated on a callback
called from a native dll to .NET assembly.
(See pseudo code below in "Foo" func):
The managed assembly (the called back function) needs to allocate the
buffer and return it as an out param to the "C" dll.
When invoking the callback from the C code, passing a valid...
|
by: RodneyAnonymous |
last post by:
I've got some code for composing an e-mail from the contents of an RTF box. The first time I execute it, everything works fine. If I close my app and then re-run it, however, I always receive the following error:
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error:...
|
by: q3537wh |
last post by:
Has anyone encountered a situation where the @import is causing IE 6
to crash?
I have a css file, let's call it test.css, that has only two lines in
it.
@import url("file1.css");
@import url("file2.css");
Both imports were successful in that there were http requests to get
|
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...
|
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...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |