Click here to Skip to main content
15,899,754 members
Home / Discussions / C#
   

C#

 
QuestionReplicate Vista Feature (Is there an API?) Pin
User 23822929-Mar-09 16:32
User 23822929-Mar-09 16:32 
QuestionExcel and C# Pin
clj198705039-Mar-09 15:14
clj198705039-Mar-09 15:14 
AnswerRe: Excel and C# Pin
Christian Graus9-Mar-09 16:19
protectorChristian Graus9-Mar-09 16:19 
GeneralRe: Excel and C# Pin
abhiram_nayan9-Mar-09 21:39
abhiram_nayan9-Mar-09 21:39 
Question"could not find installable ISAM" error when reading Excel.xls file by OleDbConnection Pin
imio249-Mar-09 14:47
imio249-Mar-09 14:47 
AnswerRe: "could not find installable ISAM" error when reading Excel.xls file by OleDbConnection Pin
Mycroft Holmes9-Mar-09 21:24
professionalMycroft Holmes9-Mar-09 21:24 
QuestionTelent connect for Oracle.Net app Pin
BrianWood9-Mar-09 13:38
BrianWood9-Mar-09 13:38 
QuestionExceptions and out parameters Pin
mringholm9-Mar-09 13:00
mringholm9-Mar-09 13:00 
I have a com dll written in VC6 c++ and and app written in c#, my question is the following:

I want to be able to return the parameter values from the com dll even if an exception occurs, this works in vb6 as well as in vc6 c++ but for some reason in c# the parameters are returned empty. The parameters that are passed into the com dll are assigned values prior to the exception being thrown so why aren't the values returned to the calling app?

I know, I know why would I want to do something like this? Well, because I want to differentiate between error and alarm conditions without adding additional parameters to my functions. In case of an error condition (fatal) the exception is thrown prior to the return parameters being populated, in the case of an alarm (non-fatal) condition the return parameters are populated prior to the exception being thrown.

C++ COM function definition:
HRESULT GetInfo([out] BSTR* name, [out] BSTR* serialNumber, [out] BSTR* modelNumber);

C# calling routine:
try
{
GetInfo(out name, out serialNumber, out modelNumber, out mac);
}
catch(ComException ex)
{
Debug.WriteLine(SerialNumber);
}

Is this possible? Seems like it should be as it works correctly with VB6 and C++.
AnswerRe: Exceptions and out parameters Pin
Christian Graus9-Mar-09 14:07
protectorChristian Graus9-Mar-09 14:07 
GeneralRe: Exceptions and out parameters Pin
mringholm10-Mar-09 5:26
mringholm10-Mar-09 5:26 
AnswerRe: Exceptions and out parameters Pin
Luc Pattyn9-Mar-09 14:55
sitebuilderLuc Pattyn9-Mar-09 14:55 
GeneralRe: Exceptions and out parameters Pin
mringholm10-Mar-09 5:23
mringholm10-Mar-09 5:23 
AnswerRe: Exceptions and out parameters Pin
Luc Pattyn10-Mar-09 6:00
sitebuilderLuc Pattyn10-Mar-09 6:00 
QuestionIXMLHTTPRequest Pin
tsahiB9-Mar-09 12:25
tsahiB9-Mar-09 12:25 
QuestionSerialport speed unstable C# Visual Studio 2008 Pin
jondaeh9-Mar-09 10:18
jondaeh9-Mar-09 10:18 
AnswerRe: Serialport speed unstable C# Visual Studio 2008 Pin
Dan Neely9-Mar-09 11:01
Dan Neely9-Mar-09 11:01 
AnswerRe: Serialport speed unstable C# Visual Studio 2008 Pin
Luc Pattyn9-Mar-09 11:16
sitebuilderLuc Pattyn9-Mar-09 11:16 
AnswerRe: Serialport speed unstable C# Visual Studio 2008 Pin
0x3c09-Mar-09 11:17
0x3c09-Mar-09 11:17 
AnswerRe: Serialport speed unstable C# Visual Studio 2008 Pin
Jonathan Davies10-Mar-09 1:56
Jonathan Davies10-Mar-09 1:56 
Questionhow to know who executed my application ? Pin
shabya9-Mar-09 10:11
shabya9-Mar-09 10:11 
AnswerRe: how to know who executed my application ? Pin
Jimmanuel9-Mar-09 10:36
Jimmanuel9-Mar-09 10:36 
AnswerRe: how to know who executed my application ? Pin
harold aptroot9-Mar-09 10:40
harold aptroot9-Mar-09 10:40 
GeneralRe: how to know who executed my application ? Pin
shabya10-Mar-09 12:20
shabya10-Mar-09 12:20 
AnswerRe: how to know who executed my application ? Pin
Dragonfly_Lee9-Mar-09 19:47
Dragonfly_Lee9-Mar-09 19:47 
GeneralRe: how to know who executed my application ? Pin
shabya10-Mar-09 12:21
shabya10-Mar-09 12:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.