in reply to Variable Width Printing on XP

Re (1):

The .NET call appears to be Graphics.MeasureString. You should be able to access it through Win32::OLE.

In MFC, it was CDC::GetTextExtent or CDC::GetOutputTextExtent.

I can't find the corresponding system call, which could have been accessed via Win32::API.

Replies are listed 'Best First'.
Re^2: Variable Width Printing on XP
by gellyfish (Monsignor) on Apr 05, 2005 at 10:31 UTC

    Unfortunately you can't access the .NET methods directly via OLE without creating an intermediate class that is registered for COM interop.

    The Windows API that provides this information is probably found in GDI.

    /J\

      Thre you go. It's GetTextExtentPoint32. Now the OP has to find out how to get the proper Device Context X_X.