- This topic has 0 replies, 1 voice, and was last updated 14 years, 2 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
Forums › TWAIN Classic › [VC++] Size of a "twain message"
Hi everybody,
I’m working on a wrapper for a twain driver building a virtual twain driver that open when an open msg comes another twain driver. It seems that is impossibile that a twain source open another twain source (I posted many posts about this argument).
What to do? Well when the triplet comes on me source, I write her value into a binary file. An external program that is waiting for this file read it and make a call to the DSMEnty(dg, dat, msg, lpData) (this is an example). I read the resoult and I write it into another binary file that i read from the source will read and gived to the application calling.
Well … the problem is that the lpData value is a TW_MEMREF (that is a LPVOID). My idea is to convert it into a string and write the string into a file.
But the problem is that now I allocate up to 1mb to a string because I don’t know the exact size of the lpData variable.
Is there in Windows (API with VC++ 6.0) a function that give me the exact size of a variable in memory?
Thank you a lot, and excuse me for my maccheroni-english … I’m Italian!