
Passing Structure Containing Strings From VB to C/C++ DLL and Printer Object
Vitus -
In passing a Type, you have to distinguish between a Type containing "As
String" fields, which are BSTRs, and one containing "As String * NN", which
are char[] fields (and not natively null-terminated). Which do you want to
do?
Rather than pass a structure, you could pass an array of strings. The C
DLL would receive a SafeArray of BSTR (both OLE concepts) which it can access
with no problems.
-- Jim
Quote:
> Can someone tell me how to pass a structure containing strings (Type in
> VB terms) from VB to C/C++ DLL? I have a need to print a number of
> strings to the printer. Speed is paramount. I found that I can achieve
> the speed by setting the printer.PrintQuality to Draft Mode. However,
> things get funny. The strings are all printed with the wrong font size
> and I ended up with a completely useless print out. Any ideas. BTW, I
> make a lot of fontsize and font attributes changes along the way.
> Everything looks fine if I print it to the screen. That's why I am
> considering passing the strings to C/C++ DLL to print which I already
> have these functions all ready to go.