Click here to Skip to main content
15,907,149 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralOnInitialUpdate and CFormView problems Pin
Ceri15-Apr-03 2:39
Ceri15-Apr-03 2:39 
QuestionChange Parent? Pin
catchnine15-Apr-03 2:06
catchnine15-Apr-03 2:06 
GeneralGetting function declarations out of a .lib Pin
John Oliver15-Apr-03 1:46
John Oliver15-Apr-03 1:46 
GeneralRe: Getting function declarations out of a .lib Pin
Roger Allen15-Apr-03 1:53
Roger Allen15-Apr-03 1:53 
GeneralRe: Getting function declarations out of a .lib Pin
Mike Dimmick15-Apr-03 2:45
Mike Dimmick15-Apr-03 2:45 
GeneralRe: Getting function declarations out of a .lib Pin
John Oliver15-Apr-03 3:54
John Oliver15-Apr-03 3:54 
GeneralDefault browser Pin
Jump_Around15-Apr-03 1:23
Jump_Around15-Apr-03 1:23 
GeneralRe: Default browser Pin
Joaquín M López Muñoz15-Apr-03 2:31
Joaquín M López Muñoz15-Apr-03 2:31 
I happen to have written this a few days ago:
#include <iostream>
#include <string>
#include <windows.h>
#include <fcntl.h>
#include <io.h>
#include <sys/stat.h>
 
static bool encuentra_programa_asociado(
  std::string& programa_asociado,const char* extension)
{
  char temp_path[MAX_PATH];
  if(::GetTempPath(sizeof(temp_path),temp_path)==0)return false;
 
  std::string str=temp_path;
  str+="xxx.";
  str+=extension;
 
  int file=-1;
  if(::_access(str.c_str(),0)!=0){
    file=::_open(str.c_str(),_O_CREAT|_O_RDWR|_O_TEMPORARY,_S_IREAD|_S_IWRITE);
    if(file==-1)return false;
  }
 
  char buffer[MAX_PATH];
  if((DWORD)(::FindExecutable(str.c_str(),"",buffer))<=32){
    if(file!=-1)::_close(file);
    return false;
  }
  programa_asociado=buffer;
 
  if(file!=-1)::_close(file);
  return true;
}
 
static bool encuentra_browser_defecto(std::string& browser_defecto)
{
  return encuentra_programa_asociado(browser_defecto,"htm");
}
 
int main()
{
  std::cout<<"browser por defecto: ";
  std::string str;
  encuentra_browser_defecto(str);
  std::cout<<str<<std::endl;
  WinExec(str.c_str(),SW_SHOW);
 
  return 0;
}
It's in Spanish, but I guess you'll be able to figure it out anyway.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralMenu commands prompt strings Pin
Anonymous15-Apr-03 1:17
Anonymous15-Apr-03 1:17 
Generaluser or system process Pin
cubiq15-Apr-03 0:58
cubiq15-Apr-03 0:58 
GeneralADO problem Pin
Anonymous15-Apr-03 0:44
Anonymous15-Apr-03 0:44 
GeneralRe: ADO problem Pin
G. Steudtel15-Apr-03 5:05
G. Steudtel15-Apr-03 5:05 
GeneralRe: ADO problem Pin
Mr. Maan15-Apr-03 10:18
Mr. Maan15-Apr-03 10:18 
GeneralWhy this typedef not working Pin
John-theKing15-Apr-03 0:35
John-theKing15-Apr-03 0:35 
GeneralRe: Why this typedef not working Pin
Rage15-Apr-03 0:38
professionalRage15-Apr-03 0:38 
GeneralRe: Why this typedef not working Pin
John-theKing15-Apr-03 0:40
John-theKing15-Apr-03 0:40 
GeneralRe: Why this typedef not working Pin
Joaquín M López Muñoz15-Apr-03 2:24
Joaquín M López Muñoz15-Apr-03 2:24 
QuestionHow do I set the baud rate of a remote computer?? Pin
IrishSonic15-Apr-03 0:25
IrishSonic15-Apr-03 0:25 
AnswerRe: How do I set the baud rate of a remote computer?? Pin
Ceri15-Apr-03 2:45
Ceri15-Apr-03 2:45 
QuestionCScrollView center? Pin
-Dy15-Apr-03 0:25
-Dy15-Apr-03 0:25 
AnswerSolved Pin
-Dy15-Apr-03 0:55
-Dy15-Apr-03 0:55 
QuestionHow to draw a transparent circle? Pin
melwyn14-Apr-03 23:41
melwyn14-Apr-03 23:41 
AnswerRe: How to draw a transparent circle? Pin
jeremysay14-Apr-03 23:49
jeremysay14-Apr-03 23:49 
GeneralRe: How to draw a transparent circle? Pin
melwyn15-Apr-03 0:39
melwyn15-Apr-03 0:39 
GeneralDynamic Menus Pin
Dor14-Apr-03 23:22
Dor14-Apr-03 23:22 

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.