wiaaut.dll in Nav2009/SP1

mklijberg
Member Posts: 5
I am currently trying to link a camera to NAV2009 (Windows 7 Enterprise) so users can photograph incoming items. I have found a code sample using wiaaut.dll:
Globals:
- DeviceManager Automation 'Microsoft Windows Image Acquisition Library v2.0'.DeviceManager
- DeviceInfo Automation 'Microsoft Windows Image Acquisition Library v2.0'.DeviceInfo
- Device Automation 'Microsoft Windows Image Acquisition Library v2.0'.Device
- Item Automation 'Microsoft Windows Image Acquisition Library v2.0'.Item
- ImageFile Automation 'Microsoft Windows Image Acquisition Library v2.0'.ImageFile
- Index Integer
OnRun()
// Create the WIA device manager
CREATE(DeviceManager);
// Return the device info for the first WIA-compatible device;
Index := 1;
DeviceInfo := DeviceManager.DeviceInfos.Item(Index);
// Connect to the first device
Device := DeviceInfo.Connect;
// Take picture
Item := Device.ExecuteCommand(wiaCommandTakePicture);
// Store the image file
ImageFile := Item.Transfer;
ImageFile.SaveFile('c:\temp\test.bmp');
procedure wiaCommandTakePicture() : Text[50]
EXIT('{AF933CAC-ACAD-11D2-A093-00C04F72DC3C}');
The sample runs just fine up until the 'store image' section. There, I get an error on the 'ImageFile := Item.Transfer' statement, saying that no instance of the automation variable has been created. I added the statement CREATE(Item), but this returns an error as well. Although I can select the Windows Image Acquisition v2.0 library in the automation list, the library doesn't show in the Custom Controls list, nor can I register wiaaut.dll there. Does anyone have an idea what is going on here?
Globals:
- DeviceManager Automation 'Microsoft Windows Image Acquisition Library v2.0'.DeviceManager
- DeviceInfo Automation 'Microsoft Windows Image Acquisition Library v2.0'.DeviceInfo
- Device Automation 'Microsoft Windows Image Acquisition Library v2.0'.Device
- Item Automation 'Microsoft Windows Image Acquisition Library v2.0'.Item
- ImageFile Automation 'Microsoft Windows Image Acquisition Library v2.0'.ImageFile
- Index Integer
OnRun()
// Create the WIA device manager
CREATE(DeviceManager);
// Return the device info for the first WIA-compatible device;
Index := 1;
DeviceInfo := DeviceManager.DeviceInfos.Item(Index);
// Connect to the first device
Device := DeviceInfo.Connect;
// Take picture
Item := Device.ExecuteCommand(wiaCommandTakePicture);
// Store the image file
ImageFile := Item.Transfer;
ImageFile.SaveFile('c:\temp\test.bmp');
procedure wiaCommandTakePicture() : Text[50]
EXIT('{AF933CAC-ACAD-11D2-A093-00C04F72DC3C}');
The sample runs just fine up until the 'store image' section. There, I get an error on the 'ImageFile := Item.Transfer' statement, saying that no instance of the automation variable has been created. I added the statement CREATE(Item), but this returns an error as well. Although I can select the Windows Image Acquisition v2.0 library in the automation list, the library doesn't show in the Custom Controls list, nor can I register wiaaut.dll there. Does anyone have an idea what is going on here?
0
Comments
-
[Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
It looks like Item.Transfer is returning NULL (no image). Thus ImageFile is uninitialized.0
-
Classic or RTC?0
-
Problem mentioned occurs with Classic client (haven't tried RTC because I don't expect RTC to 'see' the device).
"Item.Transfer is returning NULL": I gathered as much, question is why?
Thanks for your help.0 -
To find out whether it is a problem of NAV or not, you can try to use wiaaut.dll in VB.NET/C# program.
Hope this helps
Thomas0 -
This I would try.
Change Index to different Number
Change the code to
Device := DeviceManager.DeviceInfos.Item(Index).Connect;0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions