473,883 Members | 3,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

convert std:string to LPCTSTR

How can i do this?

i'd like to call the following code:

....
string url = <my urld>;
TCHAR* urlParams = GetParams( );
url.append( (char * ) urlParams );
GotoURL( ( LPCTSTR ) url ); <------THIS IS MY ISSUE
....
static BOOL GotoURL(LPCTSTR lpszUrl)
{
// Try to open hyperlink

SHELLEXECUTEINF O sei;

memset(&sei, 0, sizeof(SHELLEXE CUTEINFO));

sei.cbSize = sizeof(SHELLEXE CUTEINFO);
sei.fMask = SEE_MASK_FLAG_N O_UI;
sei.lpVerb = _T("open");
//sei.lpFile=_T(" iexplore.exe");
sei.lpFile = lpszUrl;
sei.nShow = SW_SHOWMAXIMIZE D;
//sei.lpParameter s=_T("you url here");

return ShellExecuteEx( &sei);
}

May 30 '06
10 25502

"Geo" <gg@remm.org> wrote in message
news:11******** **************@ c74g2000cwc.goo glegroups.com.. .

Jim Langston wrote:
"Geo" <gg@remm.org> wrote in message
news:11******** **************@ 38g2000cwa.goog legroups.com...
>
> Jim Langston wrote:
>> "farseer" <fa*****@optonl ine.net> wrote in message
>> news:11******** *************@j 73g2000cwa.goog legroups.com...
>> > How can i do this?
>> >
>> > i'd like to call the following code:
>> >
>> > ...
>> > string url = <my urld>;
>> > TCHAR* urlParams = GetParams( );
>> > url.append( (char * ) urlParams );
>> > GotoURL( ( LPCTSTR ) url ); <------THIS IS MY ISSUE
>>
>> Folling back the definition to LPCTSTR it is a const widechar pointer.
>>
>
> Is it? How can you tell?


In the IDE right click LPCTSTR and click "go to definition" which takes
us
to a definition of some other define. Then right click that and go to
definition til you get back to what it unltimately is defined as.


No, you're missing the point, the OP's code was incomplete, he could
have a definition of LPCTSTR earlier in his code that could be
anything. It seems you've made some unfounded assumptions, like you've
made above, I may not have and IDE, I may have nothing to click, I
could be typing this on my almost dead VAX terminal, writting my code
in EDT.


Oh, well, I actually didn't look at who I was replying to, and thought it
was the OP asking how I did it.

Reguardless, this is windows code, and that's how we can tell how LPCTSTR is
defined.

I think the question you wanted to know was, "how can I tell"
May 31 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
16446
by: Khuong Dinh Pham | last post by:
I have the contents of an image of type std::string. How can I make a CxImage object with this type. The parameters to CxImage is: CxImage(byte* data, DWORD size) Thx in advance
2
12210
by: Abhishek | last post by:
how to do convert a std::string to LPTSTR (chat *) datatype regards Abhishek
10
10147
by: Jeffrey Walton | last post by:
Hi All, I've done a little homework (I've read responses to similar from P.J. Plauger and Dietmar Kuehl), and wanted to verify with the Group. Below is what I am performing (Stroustrup's Appendix D recommendation won't compile in Microsoft VC++ 6.0). My question is in reference to MultiByte Character Sets. Will this code perform as expected? I understand every problem has a simple and elegant solution that is wrong.
3
40740
by: timor.super | last post by:
Hi group, how to convert a string to a vector of unsigned char ? I used to iterate trough the string to set the vector, but I think this is not the best way to do this. I'm a beginner with the STL How about allocating the vector ? should I know before the size ? And I would like to do then opposite conversion, from an unsigned char
3
11420
by: rsennat | last post by:
Hi, Converting enum to strings is simple. Just we can use the enum as the i ndex to get the string from an array of strings. But how do I convert string to enum. Should I need to compare with every string in the array and return the enum when it matches. Whats the efficient way to do this? Thanks rsennat
2
8481
by: Man4ish | last post by:
How can we convert std::string into basic string?
3
7024
by: BoneKeeper | last post by:
i need help to convert this: char Pointer; GetPrivateProfileString("GENERAL","PointerName",NULL, Pointer, 254,"./Settings.ini"); after i read the value of the setting file i can't convert it to DWORD, need help with this
0
9944
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9797
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10422
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9586
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7977
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7136
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5807
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3241
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.