From: Mark Goldin on
The not.net environment is VB6.
I simply want to create an object, call its method and get results back.

"Scott M." <s-mar(a)nospam.nospam> wrote in message
news:eyMQJJwXKHA.1232(a)TK2MSFTNGP05.phx.gbl...
>> I need some help converting the code to produce a dll or something else
>> in order to run this application from non .net environments.
>>
>> TIA
>
> What "non .net" environments do you mean?
>
> Do you mean from Windows directly?
>
> Do you mean from a non-Windows box on a private network?
>
> Do you mean from a non-Windows box across the web?
>
> You can write code in .NET that produces a .dll, and if you configure that
> .dll properly, you can create a proxy that can be called from COM objects,
> thus making your .NET .dll available to COM.
>
> If you want your .NET .dll available over the web, you should expose the
> class as a Web Service, which would allow Windoss and non-Windows
> platforms alike the ability to consume your class(es).
>
> But, if you want to strictly write .NET code that is immediately available
> to non-.NET environments, that is not possible.
>
> -Scott
>

From: Scott M. on

"Mark Goldin" <mgoldin(a)UFANDD.LOCAL> wrote in message
news:Oiev8bwXKHA.3428(a)TK2MSFTNGP06.phx.gbl...
> The not.net environment is VB6.
> I simply want to create an object, call its method and get results back.

Then, you'll need to code the .NET code just as it is, but mark the assembly
as availble for COM InterOp in the project's properties.

Then, you can use the .NET "regasm.exe" tool, to generate a COM Callable
Wrapper (CCW) that your VB 6 application can make a reference to and use as
if the .NET assembly was a COM object the whole time.

There isn't anything you need to do to your C# code.

http://msdn.microsoft.com/en-us/library/w29wacsy(VS.80).aspx

-Scott


From: Mark Goldin on
This is what I have so far:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Services.Protocols;
using WebServiceAccessReports.ufddbreportservices;

namespace WebServiceAccessReports
{
public class Program
{
static void Main(string[] args)
{
}
public string getParameters(string reportFile)
{
ReportingService2005 rs = new ReportingService2005();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
string report = reportFile;
bool forRendering = false;
string historyID = null;
string returnStr = "";
ParameterValue[] values = null;
DataSourceCredentials[] credentials = null;
ReportParameter[] parameters = null;

try
{
parameters = rs.GetReportParameters(report, historyID,
forRendering, values, credentials);
if (parameters != null)
{
foreach (ReportParameter rp in parameters)
{
returnStr = returnStr + " " + rp.Name;
//Console.WriteLine("Name: {0}", rp.Name);
}
}
}

catch (SoapException e)
{
Console.WriteLine(e.Detail.InnerXml.ToString());
}
return returnStr;

}
}
}


I built it as a class library I ran regasm utility with no problem.
My question is: do I instantiate WebServiceAccessReports.Program or what?

Thanks for all the help.

"Scott M." <s-mar(a)nospam.nospam> wrote in message
news:ex6892wXKHA.3600(a)TK2MSFTNGP04.phx.gbl...
>
> "Mark Goldin" <mgoldin(a)UFANDD.LOCAL> wrote in message
> news:Oiev8bwXKHA.3428(a)TK2MSFTNGP06.phx.gbl...
>> The not.net environment is VB6.
>> I simply want to create an object, call its method and get results back.
>
> Then, you'll need to code the .NET code just as it is, but mark the
> assembly as availble for COM InterOp in the project's properties.
>
> Then, you can use the .NET "regasm.exe" tool, to generate a COM Callable
> Wrapper (CCW) that your VB 6 application can make a reference to and use
> as if the .NET assembly was a COM object the whole time.
>
> There isn't anything you need to do to your C# code.
>
> http://msdn.microsoft.com/en-us/library/w29wacsy(VS.80).aspx
>
> -Scott
>

From: Family Tree Mike on
Mark Goldin wrote:
> The not.net environment is VB6.
> I simply want to create an object, call its method and get results back.
>
> "Scott M." <s-mar(a)nospam.nospam> wrote in message
> news:eyMQJJwXKHA.1232(a)TK2MSFTNGP05.phx.gbl...
>>> I need some help converting the code to produce a dll or something
>>> else in order to run this application from non .net environments.
>>>
>>> TIA
>>
>> What "non .net" environments do you mean?
>>
>> Do you mean from Windows directly?
>>
>> Do you mean from a non-Windows box on a private network?
>>
>> Do you mean from a non-Windows box across the web?
>>
>> You can write code in .NET that produces a .dll, and if you configure
>> that .dll properly, you can create a proxy that can be called from COM
>> objects, thus making your .NET .dll available to COM.
>>
>> If you want your .NET .dll available over the web, you should expose
>> the class as a Web Service, which would allow Windoss and non-Windows
>> platforms alike the ability to consume your class(es).
>>
>> But, if you want to strictly write .NET code that is immediately
>> available to non-.NET environments, that is not possible.
>>
>> -Scott
>>
>

I know I'm going to regret this, but...

Can't you call the web service from VB 6?

--
Mike
From: Mark Goldin on
I could but I decided to use native to SSRS web services environment - .Net.
Then use it in VB as a wrapper.

"Family Tree Mike" <FamilyTreeMike(a)ThisOldHouse.com> wrote in message
news:OXURT7yXKHA.3600(a)TK2MSFTNGP04.phx.gbl...
> Mark Goldin wrote:
>> The not.net environment is VB6.
>> I simply want to create an object, call its method and get results back.
>>
>> "Scott M." <s-mar(a)nospam.nospam> wrote in message
>> news:eyMQJJwXKHA.1232(a)TK2MSFTNGP05.phx.gbl...
>>>> I need some help converting the code to produce a dll or something else
>>>> in order to run this application from non .net environments.
>>>>
>>>> TIA
>>>
>>> What "non .net" environments do you mean?
>>>
>>> Do you mean from Windows directly?
>>>
>>> Do you mean from a non-Windows box on a private network?
>>>
>>> Do you mean from a non-Windows box across the web?
>>>
>>> You can write code in .NET that produces a .dll, and if you configure
>>> that .dll properly, you can create a proxy that can be called from COM
>>> objects, thus making your .NET .dll available to COM.
>>>
>>> If you want your .NET .dll available over the web, you should expose the
>>> class as a Web Service, which would allow Windoss and non-Windows
>>> platforms alike the ability to consume your class(es).
>>>
>>> But, if you want to strictly write .NET code that is immediately
>>> available to non-.NET environments, that is not possible.
>>>
>>> -Scott
>>>
>>
>
> I know I'm going to regret this, but...
>
> Can't you call the web service from VB 6?
>
> --
> Mike