For Programmers: Free Programming Magazines  


Home > Archive > Cobol > April 2007 > Windows Service using Fujitsu Cobol for WIndows









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Windows Service using Fujitsu Cobol for WIndows
AAD

2007-03-19, 6:55 pm

We are converting from Micro Focus COBOL to Fujitsu because of the new
licensing fees.

We have a number of Windows Services (NT Services) and need to convert
them.

When I talked to Fujitsu, they said we could not convert them. Then,
we thought that we could write a Driver in C# (.Net) that would call
the Cobol program with "pinvoke"-

That works, except, when C# calls Cobol wwhich then calls Cobol- (both
Cobol being non .Net)- the second Cobol program does not retain in
Working Storage.

When I reported this to Fujitsu, they said "Yes, that is correct".

Has anyone been successful in getting Widnwos Sewrvices to run using
Fujitsu Cobol for Windows?

thanks for any information or help-

Pete Dashwood

2007-03-20, 7:55 am


"AAD" <anthonydyer@frontiernet.net> wrote in message
news:1174321250.534238.79410@l77g2000hsb.googlegroups.com...
> We are converting from Micro Focus COBOL to Fujitsu because of the new
> licensing fees.
>
> We have a number of Windows Services (NT Services) and need to convert
> them.
>
> When I talked to Fujitsu, they said we could not convert them. Then,
> we thought that we could write a Driver in C# (.Net) that would call
> the Cobol program with "pinvoke"-
>
> That works, except, when C# calls Cobol wwhich then calls Cobol- (both
> Cobol being non .Net)- the second Cobol program does not retain in
> Working Storage.
>
> When I reported this to Fujitsu, they said "Yes, that is correct".
>
> Has anyone been successful in getting Widnwos Sewrvices to run using
> Fujitsu Cobol for Windows?
>
> thanks for any information or help-
>


I wouldn't do it with pinvoke - use Interop Services and call your COBOL as
unmanaged code. (I have Fujitsu COBOL components that I activate in this
way). This works extremely well. I haven't tried getting COBOL to run as a
windows service, though in theory it should be fairly strightforward to set
up a windows service in C# and have that invoke your COBOL through Interop
Services.

Basically, wrap your COBOL .dll as a COM component (Fujitsu will do this for
you), then make that COM component known to C# through the COM tab on the
Add Reference menu option in VS 2005. Once your project has the reference,
it has no difficulty in invoking the methods and properties of your COBOL
code. (All of the nterfacing through Interop Services is transparent; just
make sure you have Interop Services referenced in your project.) If you tell
the C# to run as a Windows service, I'm pretty sure it will, but I haven't
tried it.

I'm working on getting COBOL to run as a wrapped web service under ASP.NET
at the moment, but if I have some time I'll have a look at how a windows
service might be implemented.

Pete.


Erencetard7

2007-03-20, 9:34 am

Catherine Zeta Jone Throatjob!
http://Catherine-Zeta-Jone-Throatjo...hp?movie=148803
Fatinha

2007-04-07, 9:10 am

Lindsay Lohan Doing A Hung Guy!
http://Lindsay-Lohan-Doing-A-Hung-G...hp?movie=148803
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com