AnsweredAssumed Answered

vrf use dll

Question asked by VRFuser on Nov 15, 2005
> Is the int32 the korrekt type?

Not really, but it will work.

> Is the Problem the cyHandle?

Nope. I just looked at the call, and it's HANDLE, LPVOID, LPBYTE and BOOL.
LPBYTE is quite interesting. Almost inexplicable. It really should be long,
but I guess since they're limiting the return buffer size to 126 chars they
figured they'd be cheap about it and use a byte param. Of course since it's
a pointer you're pushing four bytes anyway and there's no savings. Even if
it was a byte it would be slower than four. As I said, it's almost
inexplicable. Perhaps the author is more familiar with RISC processors than
CISC processors.

Anyway, this one would go like this:

int __stdcall CP210x_GetDeviceProductString(
  int cyHandle, char *lpProduct, char *lpbLength, int bConvertToASCII);

The lpProduct parameter *must* point to a buffer of no more than 126 bytes
and lpbLength *must* point to a string containing a single byte that is the
length of that buffer. The easiest way I can think of to do that is:

lpProduct = " " * 126;
lpbLength = intToChar(126);

> Is it generally possible to integrate all dll into VEE?

I've yet to run across a call I can't make work.

> Or are there some dlls which can be included but although dont work?

C++ objects are very difficult to use, but everybody who writes APIs knows
that so no one in their right mind would expose a public API in C++ objects
unless the target language was intended to be C++.

Read up on Type Spoofing.
You're going to have a lot of fun using BAUD_CONFIG and PORT_CONFIG.
-SHAWN-



---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".

Outcomes