Click here to Skip to main content
15,888,236 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralProcess.Start problems... Pin
Jan van den Baard21-Jul-04 0:03
professionalJan van den Baard21-Jul-04 0:03 
GeneralRe: Process.Start problems... Pin
Javier Lozano22-Jul-04 14:28
Javier Lozano22-Jul-04 14:28 
GeneralRe: Process.Start problems... Pin
Jan van den Baard22-Jul-04 19:19
professionalJan van den Baard22-Jul-04 19:19 
GeneralRe: Process.Start problems... Pin
partyganger29-Jul-04 15:08
partyganger29-Jul-04 15:08 
GeneralRe: Process.Start problems... Pin
Jan van den Baard29-Jul-04 19:43
professionalJan van den Baard29-Jul-04 19:43 
QuestionConverting SafeArray? Pin
So and So20-Jul-04 6:13
So and So20-Jul-04 6:13 
AnswerRe: Converting SafeArray? Pin
So and So20-Jul-04 8:44
So and So20-Jul-04 8:44 
Generalproblem in accessing a VC++ 6.0 ATL COM object via a .Net application Pin
vipul_vips20-Jul-04 5:19
vipul_vips20-Jul-04 5:19 
HI all,

I am facing a problem in accessing a VC++ 6.0 ATL COM object via a .Net application

The atl com dll is accessing another dll called OTAClient80.dll

The following piece of code has been written in ATL COM:

/* START OF CODE SNIPPET */

STDMETHODIMP TDDOORSApi::temp(int *count)
{
HRESULT hr = E_FAIL;

::CoInitialize(NULL);
ITDConnection *connect;
HRESULT hr = ::CoCreateInstance(__uuidof(TDConnection), NULL, CLSCTX_INPROC_SERVER, __uuidof(ITDConnection), (LPVOID *)&connect);
if (connect==NULL)
{
return hr;
}
connect->AddRef();
//OTAClient80.dll api
hr=connect->InitConnection("http://PC-P33774/TDBIN","","");//Making a connection to the an application server
if (FAILED(hr))
return hr ;

//OTAClient80.dll api
hr = connect->ConnectProject("TestDirector_Demo","admin",""); //Making a connection to a project on the server
if (FAILED(hr))
return hr;

IRunFactory *runPointer = NULL;
IList *runFieldList = NULL;

//OTAClient80.dll api
hr = connectionPtr->get_RunFactory ((IDispatch**)&runPointer);

//This line gives an exception..
//OTAClient80.dll api
hr = runPointer->get_Fields(&runFieldList);

//Release the connection and dsiconnect from the project
connect->DisconnectProject();
connect->Release();

::CoUninitialize();
return hr;
}

/* END OF CODE SNIPPET */

When I try to invoke this code from a C# windows application or a console application, the line

hr = runPointer->get_Fields(&runFieldList);

gives an exception as follows:

/* START OF EXCEPTION TEXT */

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception.
at DOORSTDLib.TDDOORSApiClass.temp(Int32& count)
at WindowsApplicationTesting.Form1.button1_Click(Object sender, EventArgs e) in c:\documents and settings\mahendsa\my documents\visual studio projects\windowsapplicationtesting\windowsapplicationtesting\form1.cs:line 123
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
WindowsApplicationTesting
Assembly Version: 1.0.1662.29448
Win32 Version: 1.0.1662.29448
CodeBase: file:///C:/Documents%20and%20Settings/mahendsa/My%20Documents/Visual%20Studio%20Projects/WindowsApplicationTesting/WindowsApplicationTesting/bin/Debug/WindowsApplicationTesting.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
Interop.DOORSTDLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/mahendsa/My%20Documents/Visual%20Studio%20Projects/WindowsApplicationTesting/WindowsApplicationTesting/bin/Debug/Interop.DOORSTDLib.DLL
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitdebugging="true">


When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.


---------------------------------------------

/* END OF EXCEPTION TEXT */

Sometimes, I get the error as under:


/* START OF ERROR TEXT */

The value of ESP was not properly saved across function call. This is usually a result of calling a function
declared with one calling convention with a function pointer declared with a different calling convention.

/* END OF ERROR TEXT */



There are no errors if I invoke the dll from an MFC application.



The following is the code invoked from the C# application:

DOORSTDLib.TDDOORSApiClass obj = new TDDOORSApiClass();
obj.temp();




Can someone please throw some light as to where can the problem be / what is the solution?


Regards
Vipul
GeneralWeb Service Error in Debug Mode Pin
jobr1ch19-Jul-04 21:47
jobr1ch19-Jul-04 21:47 
GeneralForm Size Too Big Pin
myNameIsRon19-Jul-04 19:53
myNameIsRon19-Jul-04 19:53 
GeneralRe: Form Size Too Big Pin
Small Rat24-Jul-04 18:13
Small Rat24-Jul-04 18:13 
GeneralFreeze some columns in Datagrid Pin
Sreepathi19-Jul-04 17:15
Sreepathi19-Jul-04 17:15 
General.NET &amp; MFC Serialization Compability Pin
alexatn19-Jul-04 11:35
alexatn19-Jul-04 11:35 
GeneralRe: .NET &amp; MFC Serialization Compability Pin
mav.northwind19-Jul-04 21:35
mav.northwind19-Jul-04 21:35 
GeneralSyntax Coloring in .NET Pin
bneacetp19-Jul-04 10:54
bneacetp19-Jul-04 10:54 
GeneralPrinting using ExecWB gives error &quot;Trying to revoke a drop target ...&quot; Pin
alexatn16-Jul-04 12:02
alexatn16-Jul-04 12:02 
GeneralSpeech .NET Pin
Serge Lobko-Lobanovsky16-Jul-04 6:20
Serge Lobko-Lobanovsky16-Jul-04 6:20 
GeneralReplacement of In-place Activation Pin
Aamir Butt15-Jul-04 23:56
Aamir Butt15-Jul-04 23:56 
GeneralRe: Replacement of In-place Activation Pin
mav.northwind17-Jul-04 4:28
mav.northwind17-Jul-04 4:28 
GeneralRe: Replacement of In-place Activation Pin
Aamir Butt18-Jul-04 18:17
Aamir Butt18-Jul-04 18:17 
GeneralListView icon disappear Pin
ting66815-Jul-04 4:24
ting66815-Jul-04 4:24 
GeneralWindows mobile 2003 for Pocket PC Pin
Member 123796715-Jul-04 3:37
Member 123796715-Jul-04 3:37 
GeneralRe: Windows mobile 2003 for Pocket PC Pin
Roman Rodov15-Jul-04 15:03
Roman Rodov15-Jul-04 15:03 
GeneralBehavior of RichTextBox Pin
mav.northwind14-Jul-04 9:48
mav.northwind14-Jul-04 9:48 
GeneralRegistry entry for date of installation Pin
vipul_vips13-Jul-04 20:58
vipul_vips13-Jul-04 20:58 

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.