Question about DLL - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Question about DLL

Hello
I am provided with a DLL which was compiled to run on Win31/NT/Win95 OSes. I need to use it for WinXP as the target OS now. i am getting unexpected return codes from functions, that I access in Java via JNA. JNA works as expected with examples.

So, my question is is a DLL for Win31/NT/Win95 usable on WinXP ?
If it can be, what could be the cause of the invalid return codes and no action in response to certain functions? The DLL is for controlling a printer via a serial port connection by issueing the commands from the DLL functions. Is WinXP disabling direct access via RS232?

Thanks

AK

Comments

  • SephirothSephiroth Fayetteville, NC, USAPosts: 1,035Member
    Is this a 16bit DLL? If it ran on Windows 3.11, it almost assuredly is. If this is the case, your program may have to be 16bit. I have never tried using 16bit DLLs with a 32bit executable. It may be possible, but if so you would need to type-cast access to that DLL as 16bit variable types.

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
  • ak08820ak08820 Posts: 2Member
    Hello
    One of the items in PE Viewer output is as follows.

    PE Format:PE32

    Wonder if that means 32 bit.

    Thanks


    File Headers
    DOS EXE:true
    NT EXE:true
    Dos STUB size:64 bytes
    DOS Header
    e_magic:5a4dh (23,117)
    e_cblp:90h (144)
    e_cp:3h (3)
    e_crlc:0h (0)
    e_cparhdr:4h (4)
    e_minalloc:0h (0)
    e_maxalloc:ffffh (65,535)
    e_ss:0h (0)
    e_sp:b8h (184)
    e_csum:0h (0)
    e_ip:0h (0)
    e_cs:0h (0)
    e_lfarlc:40h (64)
    e_ovno:0h (0)
    e_res:0h (0)
    e_oemid:0h (0)
    e_oeminfo:0h (0)
    e_res2:0h (0)
    e_lfanew:80h (128)

    COFF File Header (Object & Image)
    Machine:Intel 386 or later, and compatible processors
    NumberOfSections:6h (6)
    TimeDateStamp:Thu May 25 08:04:20 EDT 2000
    PointerToSymbolTable:0h (0)
    NumberOfSymbols:0h (0)
    SizeOfOptionalHeader:e0h (224)
    Characteristics:IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LINE_NUMS_STRIPPED, IMAGE_FILE_LOCAL_SYMS_STRIPPED, IMAGE_FILE_32BIT_MACHINE, IMAGE_FILE_DLL

    Optional Header (Usually Image Only)
    PE Format:PE32
    Standard fields
    MajorLinkerVersion:5h (5)
    MinorLinkerVersion:0h (0)
    SizeOfCode:6a00h (27,136)
    SizeOfInitializedData:5e00h (24,064)
    SizeOfUninitializedData:0h (0)
    AddressOfEntryPoint:4c70h (19,568)
    BaseOfCode:1000h (4,096)
    BaseOfData:8000h (32,768)
    NT additional fields
    ImageBase:10000000h (268,435,456)
    SectionAlignment:1000h (4,096)
    FileAlignment:200h (512)
    MajorOperatingSystemVersion:4h (4)
    MinorOperatingSystemVersion:0h (0)
    MajorImageVersion:0h (0)
    MinorImageVersion:0h (0)
    MajorSubsystemVersion:4h (4)
    MinorSubsystemVersion:0h (0)
    SizeOfImage:10000h (65,536)
    SizeOfHeaders:400h (1,024)
    CheckSum:0h (0)
    Subsystem:Image runs in the Windows
  • SephirothSephiroth Fayetteville, NC, USAPosts: 1,035Member
    It may, but I don't know. If that is a 32bit DLL then I doubt it would run on 16bit Windows (Win3.11 and prior). You may need the help of a Windows guru here for this problem. I've personally never run into it with the same style architecture (ie: 32bit with 32bit or 64bit with 64bit).

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
Sign In or Register to comment.