Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / September 2006

Tip: Looking for answers? Try searching our database.

Can't access COBOL DLL from C# program

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Parrot - 01 Sep 2006 23:10 GMT
I cannot get my C# program to access a DLL program written in COBOL. I use
the following code to represent the program:

[DllImport("readmf.dll")]
public static extern void CYREAD(string linkfile, linkdata ld);

I use the following statement
CYREAD(linkfile, ld)
and it said that the program readmf.dll cannot be found even though I have the
DLL in my bin, debug, and root directory along with the .LIB file. I then
tried
to add a reference to it but when I clicked on the DLL to add it I receive a
message that says the file could not be added. I was able to access a COBOL
DLL using C++. What am I doing wrong in C#?
Mattias Sjögren - 03 Sep 2006 02:04 GMT
>and it said that the program readmf.dll cannot be found even though I have the
>DLL in my bin, debug, and root directory

Have you tried placing it in the Windows System directory?

Mattias

Signature

Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Parrot - 03 Sep 2006 02:14 GMT
Hi Mattias;
Thanks for your reply.  I did place the DLL program in the Windoows/System32
directory and it still gave me the message that it can't find the program.  
Anyplace else I should put it?
Dave Uphoff

> >and it said that the program readmf.dll cannot be found even though I have the
> >DLL in my bin, debug, and root directory
>
> Have you tried placing it in the Windows System directory?
>
> Mattias
Scott M. - 04 Sep 2006 21:17 GMT
I don't think it is a matter of where the COBOL dll is.  You need a RCW
(runtime callable wrapper) and VS.NET usually creates this automatically for
you when you make a reference to a COM component.  Now, I don't have a lot
of experience in COBOL, but aren't COBOL files host files (and not COM
components)?

So, if that is the case, you would need some translation or gateway
component to bridge the gap between your .NET code and your COBOL code.

> Hi Mattias;
> Thanks for your reply.  I did place the DLL program in the
[quoted text clipped - 10 lines]
>>
>> Mattias

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.