J
Jim Bancroft
Hi everyone,
I've recently ported a COM component into .Net using a runtime callable
wrapper. The component in question is SQL Server's DTS package, if that
helps.
The import worked well enough....now I'm having some trouble using the
component. Specifically, this code below from VB6, which works:
Dim oTask As DTS.Task
Dim oCustomTask0 As DTS.ExecuteSQLTask2
Set oTask = goPackage.Tasks.New("DTSExecuteSQLTask")
Set oCustomTask0 = oTask.CustomTask
......doesn't work in my C# app. Here's how I've ported it:
DTS.Task oTask;
DTS.ExecuteSQLTask2 oCustomTask0;
oTask = goPackage.Tasks.New("DTSExecuteSQLTask");
oCustomTask0 = (DTS.ExecuteSQLTask2) oTask.CustomTask; //<----blows up here
On the last line above, where I do a cast, I get a runtime error telling me
QueryInterface failed. I'm not sure why it would fail in C#, when the
equivalent code in VB6 worked. Would anyone have an idea what I've done
wrong? Thanks!
I've recently ported a COM component into .Net using a runtime callable
wrapper. The component in question is SQL Server's DTS package, if that
helps.
The import worked well enough....now I'm having some trouble using the
component. Specifically, this code below from VB6, which works:
Dim oTask As DTS.Task
Dim oCustomTask0 As DTS.ExecuteSQLTask2
Set oTask = goPackage.Tasks.New("DTSExecuteSQLTask")
Set oCustomTask0 = oTask.CustomTask
......doesn't work in my C# app. Here's how I've ported it:
DTS.Task oTask;
DTS.ExecuteSQLTask2 oCustomTask0;
oTask = goPackage.Tasks.New("DTSExecuteSQLTask");
oCustomTask0 = (DTS.ExecuteSQLTask2) oTask.CustomTask; //<----blows up here
On the last line above, where I do a cast, I get a runtime error telling me
QueryInterface failed. I'm not sure why it would fail in C#, when the
equivalent code in VB6 worked. Would anyone have an idea what I've done
wrong? Thanks!