Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - passing CString arguments to dll functions
  FAQ FAQ  Forum Search   Register Register  Login Login

passing CString arguments to dll functions

 Post Reply Post Reply
Author
Message
WendellSmith View Drop Down
Beginner
Beginner


Joined: 10 Feb 14
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote WendellSmith Quote  Post ReplyReply Direct Link To This Post Topic: passing CString arguments to dll functions
    Posted: 10 Feb 14 at 3:32PM
I am hoping this is easy -- Is there an easy way to convert a CString to the type required for the dll calls (wchar_t *)?

I have tried a bunch of things but not found the magic code :)

CString Label = "xx";

ConvertedLabel = ??; // how to get the CString Label into a format to pass into functions?

QP.DrawText(100, 500,  ConvertedLabel); // this  does not work.

Does anyone have a suggestion how to do this?  [we are using MSVC6]

Thanks

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 11 Feb 14 at 7:59AM
Hi Wendel!
 
Microsoft will help:
I think there'll be a similar page in english, too ;-)
 
Cheers and welcome here,
Ingo
 
Cheers,
Ingo

Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 11 Feb 14 at 1:17PM
Wendell,

Can you try calling QP.DrawTextA  - 'A' is for the Ansi string version.  It should get you started.


Have you tried using CStringW ?

Here is some code that compiles and runs in an VS2010 MFC project.

if (QP->UnlockKey(_T("<<< insert license key here >>>")) == 1)
{
int ret;

QP->AddTrueTypeFont(L"Wingdings", 0);
                QP->SetOrigin(1);
                QP->DrawText(100, 20, L"Hello World");
                QP->SetTextSize(18);

ret = QP->DrawText(100, 500, _T("Hello world"));
ret = QP->SaveToFile(_T("HelloFromDLL.pdf"));

CStringW  filename = L"f:\\downloads\\1.pdf";
ret = QP->LoadFromFile(filename, L"");

delete QP;
}

Andrew.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store