Click here to Skip to main content
15,892,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Where does VC++ save include path settings? Pin
Erudite_Eric13-Sep-11 0:24
Erudite_Eric13-Sep-11 0:24 
GeneralRe: Where does VC++ save include path settings? Pin
charlieg13-Sep-11 3:34
charlieg13-Sep-11 3:34 
GeneralRe: Where does VC++ save include path settings? Pin
Erudite_Eric13-Sep-11 4:01
Erudite_Eric13-Sep-11 4:01 
GeneralRe: Where does VC++ save include path settings? Pin
charlieg13-Sep-11 13:49
charlieg13-Sep-11 13:49 
GeneralRe: Where does VC++ save include path settings? Pin
Erudite_Eric13-Sep-11 22:53
Erudite_Eric13-Sep-11 22:53 
GeneralRe: Where does VC++ save include path settings? Pin
charlieg14-Sep-11 3:22
charlieg14-Sep-11 3:22 
GeneralRe: Where does VC++ save include path settings? Pin
Erudite_Eric14-Sep-11 20:21
Erudite_Eric14-Sep-11 20:21 
GeneralRe: Where does VC++ save include path settings? Pin
charlieg15-Sep-11 0:01
charlieg15-Sep-11 0:01 
AnswerRe: Where does VC++ save include path settings? Pin
bolivar12314-Sep-11 19:14
bolivar12314-Sep-11 19:14 
GeneralRe: Where does VC++ save include path settings? Pin
charlieg15-Sep-11 0:03
charlieg15-Sep-11 0:03 
QuestionDifference between Critical Sections over Mutex objects Pin
CodingLover12-Sep-11 19:13
CodingLover12-Sep-11 19:13 
AnswerRe: Difference between Critical Sections over Mutex objects PinPopular
వేంకటనారాయణ(venkatmakam)12-Sep-11 21:34
వేంకటనారాయణ(venkatmakam)12-Sep-11 21:34 
GeneralRe: Difference between Critical Sections over Mutex objects Pin
CodingLover13-Sep-11 0:13
CodingLover13-Sep-11 0:13 
AnswerRe: Difference between Critical Sections over Mutex objects Pin
ShilpiP13-Sep-11 1:05
ShilpiP13-Sep-11 1:05 
GeneralRe: Difference between Critical Sections over Mutex objects Pin
CodingLover13-Sep-11 1:22
CodingLover13-Sep-11 1:22 
GeneralRe: Difference between Critical Sections over Mutex objects Pin
ShilpiP13-Sep-11 2:17
ShilpiP13-Sep-11 2:17 
GeneralRe: Difference between Critical Sections over Mutex objects Pin
CodingLover13-Sep-11 17:39
CodingLover13-Sep-11 17:39 
GeneralRe: Difference between Critical Sections over Mutex objects Pin
ShilpiP13-Sep-11 18:39
ShilpiP13-Sep-11 18:39 
GeneralRe: Difference between Critical Sections over Mutex objects Pin
CodingLover13-Sep-11 21:21
CodingLover13-Sep-11 21:21 
QuestionProblem using IAccessible2 Pin
kartikdasani12-Sep-11 2:17
kartikdasani12-Sep-11 2:17 
Questionweb browser control difficulty Pin
doug2512-Sep-11 1:28
doug2512-Sep-11 1:28 
AnswerRe: web browser control difficulty Pin
CPallini12-Sep-11 2:16
mveCPallini12-Sep-11 2:16 
GeneralRe: web browser control difficulty Pin
doug2513-Sep-11 2:50
doug2513-Sep-11 2:50 
AnswerRe: web browser control difficulty Pin
krmed12-Sep-11 3:56
krmed12-Sep-11 3:56 
GeneralRe: web browser control difficulty Pin
doug2513-Sep-11 2:59
doug2513-Sep-11 2:59 
I understand this, I have been using the full path and file name.

I need to convert the string to a BSTR, I'm assuming i'm doing it correctly because as I say, the program works but only shows a web page when I run it from visual studio.
here's how:

C++
 char url[MAX_PATH];
 // _getcwd(url, MAX_PATH);
  GetModuleFileName(InstanceHandle, url, MAX_PATH);
  std::string file = url;
  file = file.substr(0, file.find_last_of("\\"));
  file += "\\Help.html";
  //file = "Help.html";

// show that the path is correct
  MessageBox(NULL, file.c_str(), NULL, NULL);

   OLECHAR* oleChar = NULL;
    oleChar = (OLECHAR*)calloc(file.length(), sizeof(OLECHAR));
    MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, file.c_str(), -1, oleChar, sizeof(WCHAR)*file.length());

  vURL.bstrVal = SysAllocString(oleChar);

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.