Question Using DLL

Nommy

New member
Joined
Apr 29, 2009
Messages
3
Programming Experience
5-10
Hi Everyone,

I am developing a software that is interfaced with a RFID device. The RFID device manufacturer provides me with a DLL files that contains various functions to communicate with the device. One of the simplest function in the dll file is "CommOpen". This function opens the selected PC serial port.

I have tried my best to get this function executed using VB.net <DLLImport>. But all efforts proves to be unsuccessful. Following exception is encountered

"Unable to load DLL 'Reader.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"

Attacehed herewith is the a zip file that holds the code,dll file and the pdf file that shows the details of the functions and their prototypes.

Please let me know the solution to this problem.

Bye,

Nommy.
 

Attachments

  • MYVBDLL.zip
    279.7 KB · Views: 28
Invalid Return Value From Dll function

Hi,
As per your advice, coping the dll file into the folder where exe resides did solve the exception that was encontered i.e.

"Unable to load DLL 'Reader.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"

But now return value from the function is "-3". Although it should be 0.
Could you please check the code in the attached zip file. Maybe you might figure out the error in code.

Regard's,

Nommy.
 

Attachments

  • MYVBDLL.zip
    283.1 KB · Views: 20
Invalid Return Value From Dll function

The documentation of the function prototypes says that successful result from the function returns value 0 otherwise its an unsuccessful for other values.
I pdf file that in the attachment does contain the function prototypes. Can you please review it.

Regards,

Nommy
 
Back
Top