Passing Structure Containing Strings From VB to C/C++ DLL and Printer Object 
Author Message
 Passing Structure Containing Strings From VB to C/C++ DLL and Printer Object

Hi,

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.

Can you please  this poor soul here?  Thanks.



Sun, 16 Apr 2000 03:00:00 GMT  
 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.



Wed, 19 Apr 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Passing user defined structures from VB to C++ DLL

2. Passing an array of structures from VB to a C++ DLL

3. Problems calling a DLL with structure containing a string pointer in VB3.0

4. Help: VB DLL passing string to C++

5. VB passing strings to C++ DLL

6. Passing strings back to VB from Visual C++ DLL

7. Passing Strings from VB to a C++ DLL.

8. How to pass a string Array from VB to a C++ DLL

9. Passing a string from VB to C++ DLL

10. Passing string to C/C++ dll from VB problem

11. call VC DLL with structure contains pointer of the structure to next

12. call VC DLL with structure contains pointer of the structure to next

 

 
Powered by phpBB® Forum Software