TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

Reply To: Managed Data Source – .NET

Forums › TWAIN Classic › Managed Data Source – .NET › Reply To: Managed Data Source – .NET

April 13, 2009 at 2:04 am #24865
michaellwest
Participant
  • Topics - 1
  • Replies - 2
  • Total Posts - 3

Here is what I have so far (assume that I have already exported the function):

public static UInt16 DS_ENTRY(TwIdentity identity, TwDG dg, TwDAT dat,
TwMSG msg, ref IntPtr ptr) {}

where TwIdentity, TwDG, TwDAT, and TwMSG are structures.

Currently when I test using Twacker (Twack_32.exe) the above method is called. I have problems getting the identity to appear in the twain selection (it will eventually appear if I select another twain device and then open the selection again but the description is not correct).
This is what I do for Control -> Identity -> Get
int structSize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(TwIdentity));
ptr = System.Runtime.InteropServices.Marshal.AllocHGlobal(structSize);
System.Runtime.InteropServices.Marshal.StructureToPtr(identity, ptr, true);

based on the sample program on Sourceforge.net, the above lines are my attempt to replace memcpy.

Any suggestions on how to better implement this?

Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • Hello world
  • Girls of Desire: All babes in one place, crazy, art
  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in