Thread: struct in function

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Ofcourse it does, which is why you'd want to call the c_str() function on your std::string objects.

    Code:
      HINSTANCE hRet = ShellExecute(
        HWND_DESKTOP, //Parent window
        "open",       //Operation to perform
        x->path.c_str(),       //Path to program
        x->par.c_str(),         //Parameters
        x->dir.c_str(),         //Default directory
        SW_SHOW);     //How to open
    
      if((LONG)hRet <= 32)
      {
        cout << "Wrong directory!!" << endl;
      }
    By the way, if I had to guess. I'd say your problem lies with the fact that you're casting to a LONG not a long and your compiler might not like that, but I could be wrong.
    Last edited by SlyMaelstrom; 03-02-2006 at 01:12 PM.
    Sent from my iPadŽ

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Link List math
    By t014y in forum C Programming
    Replies: 17
    Last Post: 02-20-2009, 06:55 PM
  2. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  3. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  4. Replies: 10
    Last Post: 05-18-2006, 11:23 PM
  5. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 10:18 AM