How to use a variable inside a _T wrapper?
Posted
by
karikari
on Stack Overflow
See other posts from Stack Overflow
or by karikari
Published on 2010-12-23T02:05:45Z
Indexed on
2010/12/23
2:54 UTC
Read the original article
Hit count: 153
I want to make the hostname part of this string to be variable.. Currently, it is only fix to this URL:
_T(" --url=http://www.myurl.com/ --out=c:\\current.png");
I want to make something like this, so the URL is changeable..
_T(" --url=http://www." + myurl + "/ --out=c:\\current.png");
update. Below is my latest attempt:
CString one = _T(" --url=http://www.");
CString two(url->bstrVal);
CString three = _T("/ --out=c:\\current.png");
CString full = one + two + three;
ShellExecute(0,
_T("open"), // Operation to perform
_T("c:\\IECapt"), // Application name
_T(full),// Additional parameters
0, // Default directory
SW_HIDE);
The error is : Error 1 error C2065: 'Lfull' : undeclared identifier c:\test.cpp
© Stack Overflow or respective owner