Call from ASP.net cobol form to dll native project

[Migrated content. Thread originally posted on 31 January 2012]

Hello I could not call dll native cobol from asp.net, the dll exists but the asp.net cobol program does not find it, I used asp.net with windows .net class link in order to link dll native, asp.net works well with .net windows program but I have te same problem because I can not link .net windows program with dll native in this solution, the dll exists and compile but it does not work.

Thanks for your help

Francisco Zambrano

Parents
  • When doing a Platform Invoke (P/Invoke) from a managed code application to an unmanaged native .dll, the native .dll should be placed into the same bin folder where the calling .exe resides.

    You can do this by making the output folder of the native project to point to the same location as the bin folder of the main project.

    If the name of the .dll is different than the name of the entry point that you are calling then you need to load the .dll first. You can do this by using a procedure-pointer as follows:

    01 proc-pointer procedure-pointer.
    procedure division.

    set proc-pointer to entry "mydll"
    call "nativeentry" using...

    Also, in order for the ASP.NET program to be able to find the native .dll you may also need to add its location to your system PATH using Control Panel-->System-->Advanced-->Environment Variables. After doing this you will either need to restart IIS, under Windows XP or reboot the computer under Windows 7 in order for IIS to pick up the changed variable.

    Thanks.



Reply
  • When doing a Platform Invoke (P/Invoke) from a managed code application to an unmanaged native .dll, the native .dll should be placed into the same bin folder where the calling .exe resides.

    You can do this by making the output folder of the native project to point to the same location as the bin folder of the main project.

    If the name of the .dll is different than the name of the entry point that you are calling then you need to load the .dll first. You can do this by using a procedure-pointer as follows:

    01 proc-pointer procedure-pointer.
    procedure division.

    set proc-pointer to entry "mydll"
    call "nativeentry" using...

    Also, in order for the ASP.NET program to be able to find the native .dll you may also need to add its location to your system PATH using Control Panel-->System-->Advanced-->Environment Variables. After doing this you will either need to restart IIS, under Windows XP or reboot the computer under Windows 7 in order for IIS to pick up the changed variable.

    Thanks.



Children
No Data