DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Need a DLL

  1. #1
    Jason West Guest

    Need a DLL


    We have a card that plugs into a PCI slot. The purpose of this card is to
    communicate to a piece of equipment via a non-standard communication. We
    have a device driver for it. The device driver has the following functions;
    CreateFile, ReadFile, WriteFile, DeviceIoControl. Is this enough information
    to find an existing DLL for VB6? If this is not enough info what else needs
    to be known to find an existing DLL or to write a DLL? Does anyone have any
    suggestions? I have already contacted the company that provided the board
    and device driver but they don't do VB.

    Regards,
    Jason

  2. #2
    Ralph Guest

    Re: Need a DLL


    "Jason West" <jvwest@northstate.net> wrote:
    >
    >We have a card that plugs into a PCI slot. The purpose of this card is to
    >communicate to a piece of equipment via a non-standard communication. We
    >have a device driver for it. The device driver has the following functions;
    >CreateFile, ReadFile, WriteFile, DeviceIoControl. Is this enough information
    >to find an existing DLL for VB6? If this is not enough info what else needs
    >to be known to find an existing DLL or to write a DLL? Does anyone have

    any
    >suggestions? I have already contacted the company that provided the board
    >and device driver but they don't do VB.
    >
    >Regards,
    >Jason


    It depends on how these functions are exposed from the device driver. If
    they are _cdecl in a lib, you are out of luck. If they are _stdcall (PASCAL)
    in a DLL then you merely have to define the API calls in a VB module.

    It doesn't sound like the later is the case, because if they provided one,
    we wouldn't be having this discussion. <g>

    The easiest, most practical solution, is to use a C/C++ compiler to create
    a COM wrapper for the exposed functions and use that in your VB programs.
    This has the advantage of providing a typelib for ease in coding, and will
    allow you to create additional higher-level service calls.

    If it is a popular driver I would haunt a couple of the Hardware newsgrps,
    as someone may have already done that. If you don't have access to a compiler,
    to 'roll-ur-own', I am sure you can find a VC++ programmer that can create
    one for you rather quickly.

  3. #3
    Jason West Guest

    Re: Need a DLL


    Thanks.

    Jason



    "Ralph" <nt_consulting32@hotmail.com> wrote:
    >
    >"Jason West" <jvwest@northstate.net> wrote:
    >>
    >>We have a card that plugs into a PCI slot. The purpose of this card is

    to
    >>communicate to a piece of equipment via a non-standard communication. We
    >>have a device driver for it. The device driver has the following functions;
    >>CreateFile, ReadFile, WriteFile, DeviceIoControl. Is this enough information
    >>to find an existing DLL for VB6? If this is not enough info what else needs
    >>to be known to find an existing DLL or to write a DLL? Does anyone have

    >any
    >>suggestions? I have already contacted the company that provided the board
    >>and device driver but they don't do VB.
    >>
    >>Regards,
    >>Jason

    >
    >It depends on how these functions are exposed from the device driver. If
    >they are _cdecl in a lib, you are out of luck. If they are _stdcall (PASCAL)
    >in a DLL then you merely have to define the API calls in a VB module.
    >
    >It doesn't sound like the later is the case, because if they provided one,
    >we wouldn't be having this discussion. <g>
    >
    >The easiest, most practical solution, is to use a C/C++ compiler to create
    >a COM wrapper for the exposed functions and use that in your VB programs.
    >This has the advantage of providing a typelib for ease in coding, and will
    >allow you to create additional higher-level service calls.
    >
    >If it is a popular driver I would haunt a couple of the Hardware newsgrps,
    >as someone may have already done that. If you don't have access to a compiler,
    >to 'roll-ur-own', I am sure you can find a VC++ programmer that can create
    >one for you rather quickly.



  4. #4
    Willy Van den Driessche Guest

    Re: Need a DLL


    "Ralph" <nt_consulting32@hotmail.com> wrote:
    >
    >"Jason West" <jvwest@northstate.net> wrote:
    >>
    >>We have a card that plugs into a PCI slot. The purpose of this card is

    to
    >>communicate to a piece of equipment via a non-standard communication. We
    >>have a device driver for it. The device driver has the following functions;
    >>CreateFile, ReadFile, WriteFile, DeviceIoControl. Is this enough information
    >>to find an existing DLL for VB6? If this is not enough info what else needs
    >>to be known to find an existing DLL or to write a DLL? Does anyone have

    >any
    >>suggestions? I have already contacted the company that provided the board
    >>and device driver but they don't do VB.
    >>
    >>Regards,
    >>Jason

    >
    >It depends on how these functions are exposed from the device driver. If
    >they are _cdecl in a lib, you are out of luck. If they are _stdcall (PASCAL)
    >in a DLL then you merely have to define the API calls in a VB module.
    >
    >It doesn't sound like the later is the case, because if they provided one,
    >we wouldn't be having this discussion. <g>
    >
    >The easiest, most practical solution, is to use a C/C++ compiler to create
    >a COM wrapper for the exposed functions and use that in your VB programs.
    >This has the advantage of providing a typelib for ease in coding, and will
    >allow you to create additional higher-level service calls.
    >
    >If it is a popular driver I would haunt a couple of the Hardware newsgrps,
    >as someone may have already done that. If you don't have access to a compiler,
    >to 'roll-ur-own', I am sure you can find a VC++ programmer that can create
    >one for you rather quickly.


    If you absolutely don't want to write a wrapper (which is sound advice from
    Raplh and what I would do myself), Matthew Curlands book (www.powervb.com)
    provides some information on calling cdecl functions directly from VB.

    Willy Van den Driessche.

  5. #5
    Patrick Ireland Guest

    Re: Need a DLL


    Jason,

    These other posts are correct in recommendations. However, when I was
    face with a PCI driver problem, similar to yours I choose to write
    a C/C++ DLL rather than a COM object. I may be biased, but I general
    don't use COM objects because they need to be registered in the Registry
    on each machine where as DLLs don't. That said COM objects can be viewed
    as controls but DLLs can not. Choice is yours on which way to go.

    Pat

    "Willy Van den Driessche" <Willy.van.den.driessche@skynet.be> wrote:
    >
    >"Ralph" <nt_consulting32@hotmail.com> wrote:
    >>
    >>"Jason West" <jvwest@northstate.net> wrote:
    >>>
    >>>We have a card that plugs into a PCI slot. The purpose of this card is

    >to
    >>>communicate to a piece of equipment via a non-standard communication.

    We
    >>>have a device driver for it. The device driver has the following functions;
    >>>CreateFile, ReadFile, WriteFile, DeviceIoControl. Is this enough information
    >>>to find an existing DLL for VB6? If this is not enough info what else

    needs
    >>>to be known to find an existing DLL or to write a DLL? Does anyone have

    >>any
    >>>suggestions? I have already contacted the company that provided the board
    >>>and device driver but they don't do VB.
    >>>
    >>>Regards,
    >>>Jason

    >>
    >>It depends on how these functions are exposed from the device driver. If
    >>they are _cdecl in a lib, you are out of luck. If they are _stdcall (PASCAL)
    >>in a DLL then you merely have to define the API calls in a VB module.
    >>
    >>It doesn't sound like the later is the case, because if they provided one,
    >>we wouldn't be having this discussion. <g>
    >>
    >>The easiest, most practical solution, is to use a C/C++ compiler to create
    >>a COM wrapper for the exposed functions and use that in your VB programs.
    >>This has the advantage of providing a typelib for ease in coding, and will
    >>allow you to create additional higher-level service calls.
    >>
    >>If it is a popular driver I would haunt a couple of the Hardware newsgrps,
    >>as someone may have already done that. If you don't have access to a compiler,
    >>to 'roll-ur-own', I am sure you can find a VC++ programmer that can create
    >>one for you rather quickly.

    >
    >If you absolutely don't want to write a wrapper (which is sound advice from
    >Raplh and what I would do myself), Matthew Curlands book (www.powervb.com)
    >provides some information on calling cdecl functions directly from VB.
    >
    >Willy Van den Driessche.



  6. #6
    Willy Van den Driessche Guest

    Re: Need a DLL

    "Patrick Ireland" <ireland@airmail.net> wrote in message
    news:3bacb592$1@news.devx.com...
    >
    > Jason,
    >
    > These other posts are correct in recommendations. However, when I was
    > face with a PCI driver problem, similar to yours I choose to write
    > a C/C++ DLL rather than a COM object. I may be biased, but I general
    > don't use COM objects because they need to be registered in the Registry
    > on each machine where as DLLs don't. That said COM objects can be viewed
    > as controls but DLLs can not. Choice is yours on which way to go.
    >
    > Pat


    Pat,
    your point is well taken. However, you're wrong to say that COM servers
    need to be registred to be used. As you know, a COM DLL contains a
    DLLGetClassObject function that returns an iClassFactory (or
    iClassFactory2 -or maybe more later) that allows you to instantiate an
    object inside the server. This technique is -also -explained in Matthew
    Curlands book (www.powervb.com).
    Of course, if you're willing to bypass the registry to instantiate wrappers,
    then you might just as well forget about the wrappers alltogether and call
    the DLL directly. This brings me to the conclusion that although in theory
    you're not right, in practice you're very right.

    --
    Van den Driessche Willy
    For a work in progress :
    http://users.skynet.be/wvdd2/index.html
    In theory there is no difference between theory and practice. In practice,
    however, there is.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center