COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 11-22-2018, 02:24 AM   #1
Yomi
Human being with feelings
 
Join Date: Nov 2016
Posts: 2
Default Convert a WDL_String into std::string

I'm trying to convert a WDL_String from the IFileSelectorControl into a std::string to send it to a function from an external library.
I've tried the suggestion from this thread https://forum.cockos.com/showthread.php?t=173135
Code:
WDL_String filePath;
std::string filePathStr;

mFileDialog->GetLastSelectedFileForPlug(&filePath);

filePathStr = filepath.Get();
But nothing is seems to pass to filePathStr.
How can I make this conversion?
Yomi is offline   Reply With Quote
Old 11-22-2018, 06:10 AM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Have you checked the file dialog method properly sets the WDL_String to a valid string?
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 11-22-2018, 06:54 AM   #3
Yomi
Human being with feelings
 
Join Date: Nov 2016
Posts: 2
Default

It turns out I had to use a const char* instead of a string.
Code:
WDL_String filePath;
const char *filePathStr;

mFileDialog->GetLastSelectedFileForPlug(&filePath);

filePathStr = filepath.Get();
working fine now.
Yomi is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.