![]() |
|
مشكلة عند تنفيذ البرنامج يتخاطب مع ملف dll - نسخة قابلة للطباعة +- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum) +-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3) +--- قسم : سؤال و جواب حول دلفي (https://delphi4arab.net/forum/forumdisplay.php?fid=15) +--- الموضوع : مشكلة عند تنفيذ البرنامج يتخاطب مع ملف dll (/showthread.php?tid=5549) |
مشكلة عند تنفيذ البرنامج يتخاطب مع ملف dll - hytham100sy - 13-09-2013 لدي برنامج يقوم بالاتصال مع قارئ تصويري وعند التصوير نحصل على صورة من البفر بعد الحصول على رسائل من ملف ال DLL هنا الوصف لكيفية ارسال الرسائل من مكتبة ال DLL: كود : Data Returned by DLL
The host application should allocate a destination data buffer for use by the DLL. When the scanner sends
data to the DLL, the destination buffer is filled with the scanner's data.
Once the destination buffer is filled by the DLL (if a buffer was set), the application is sent a WM_xxx message
with the number of bytes of data that were stored indicated in the WPARAM.
If the buffer was not large enough to hold all the data, the last two bits of WPARAM are set to zero. If no buffer
was given to the DLL for the data to be stored in, the last two bits of WPARAM are 01. If the data was stored
correctly, the last two bits of WPARAM are 11.
The following #defines are provided for this purpose:
• BUFFERSIZE_MASK – 0x0003
• BUFFERSIZE_GOOD – 0x0003
• BUFFERSIZE_ERROR – 0x0000
• NOBUFFER_ERROR – 0x0001
After the message is sent, the DLL marks the buffer as NULL indicating no user buffer is available for storage.
The host application should reset the buffer after a WM_xxx message occurs.
A second call to set the data buffer causes the new buffer to be used for incoming data. For example, after a
WM_DECODE message is sent to the application, the application should handle the message and process the
data in the destination buffer, then call SNAPI_SetDecodeBuffer again.كود : Message WM_XFERSTATUS
Description Image data is transferring from the scanner.
Value WM_APP+7
Parameters • wParam – Pointer to DWPARAM structure (cast to DWPARAM *).
• LODWORD (wparam) – The total number of bytes received so far.
• HIDWORD (wparam) – The total number of bytes expected.
• lParam – Handle to the device for which the message was postedوهنا وصف الرسالة التي تعطي الصورة: كود : Message WM_IMAGE
Description Image data is available from the scanner and is stored in the buffer provided by a previous call
to SNAPI_SetImageBuffer.
Value WM_APP+2
Parameters • wParam – Pointer to DWPARAM structure (cast to DWPARAM *)
• LODWORD (wparam) – The buffer status of the data stored
• HIDWORD (wparam) – The length of the data in bytes
• lParam – Handle to the device for which the message was posted
Data Format Actual image data.وهذا الكود الذي استخدمه: PHP كود : unit Unit2;المشكلة عند القيام بالتصوير والوصول إلى الرسالة WM_XFERSTATUS يعطي خطأ ويغلق البرنامج |