Has anyone had any luck opening a pcanywhere chf file within cpp. I've tried Shellexecute(Handle,"open","c:\pathtofile\file.chf",NULL,NULL,SW_SHOWNORMAL). With no luck, any suggestions.
This is a helpdesk program, on each client I need to have the chf file associated with them, so I'm posting to the clients table the path to the chf file. I need the shellexecute to be a able to read the path from a table column. For example the path to a chf file is DM->tblClientspcanywhere_chf is posted in this column for what ever record your own.
What's preventing you from getting the DM->tblClientspcanywhere_chf into a string? You can then use the string in the ShellExecute call.
James P. Cottingham
----------------------------------------- To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.
What am I missing now, when I debug it, it shows the full path of the string in DM->tblClientspcanywhere_chf->AsString; When it gets to ShellExecute it just skips over it and does nothing.
String PcanyPath;
PcanyPath = DM->tblClientspcanywhere_chf->AsString;
ShellExecute(NULL,NULL,PcanyPath.c_str(),NULL,NULL,SW_SHOW); // Note the c_str()
Your example was using the string "PcanyPath" and not the contents of PcanyPath. The c_str() converts the AnsiString to a NULL terminated character array.
James P. Cottingham
----------------------------------------- To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.
James P. Cottingham
----------------------------------------- To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.