Articles:  VMWare review  Useful software

This weblog has moved! You shall get redirected. If not, please just go to a new place yourself: blog.kowalczyk.info

Krzysztof Kowalczyk's Weblog
Blog or you'll be blogged.


daily link  Tuesday, August 06, 2002


Performance, profiles. Some info about performance (in the context of programming languages) on this page. Main take away is that there are 3 ways to get good performance: profile, profile, profile. Sadly, I don't know any good profilers (notice "good").   permalink  

Imagine you want to launch a web browser from within your program and make it go to a specific site. You can do it the easy way:
void LaunchIE(char *site)
{
    ShellExecute( GetDesktopWindow(), "", "iexplore", site, NULL, SW_SHOWNORMAL );
}
There's one problem with this code: it doesn't run on Windows 95 and 98 and those are still very popular. Fortunately, there is another way to do almost the same:
HANDLE JustCreateProcess(char *cmd, char *dir)
{
  PROCESS_INFORMATION ProcInfo={0,};
  STARTUPINFO StartUp={0,};
  StartUp.cb=sizeof(StartUp);
  if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, dir, 
&StartUp, &ProcInfo))
    return NULL;
  if (NULL != ProcInfo.hThread) CloseHandle( ProcInfo.hThread );
  return ProcInfo.hProcess;
}

void LaunchIE(char *site) { assert(site); std::string fullStr( "c:\\Program Files\\Internet Explorer\\IEXPLORE.EXE" ); fullStr.append( " " ); fullStr.append( site ); HANDLE hProc; hProc = JustCreateProcess( (char*) fullStr.c_str(), "c:\\Program Files\\Internet Explorer" ); if (hProc) CloseHandle(hProc); }

   permalink  

 
August 2002
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Jul   Sep


Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

pine street



Copyright 2002 © Krzysztof Kowalczyk.
Last update: 9/20/2002; 11:48:24 PM.