Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pcanywhere .chf 1

Status
Not open for further replies.

heydyrtt

Programmer
Dec 12, 2001
63
US
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.


Thanks


Heydyrtt
 
I get this to work, but it's really not what I need,

ShellExecute(NULL, NULL,"c:\\docume~1\\alluse~1\\applic~1\\symantec\\pcanyw~1\\Bonner.chf",NULL,NULL, SW_SHOWNORMAL);

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.

Any help

Heydyrtt
 
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
-----------------------------------------
[sup]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.[/sup]
 
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",NULL,NULL,SW_SHOW);

Or is this what your talking about.

Thanks


Heydyrtt
 
Try:
Code:
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
-----------------------------------------
[sup]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.[/sup]
 
Glad I could help.


James P. Cottingham
-----------------------------------------
[sup]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.[/sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top