c++ - ShellExecute doesn't work for other computer -


i made program using win32api. in program, has "shellexecute" phrase in order execute chrome searching. following abstraction fo wrote.

#include <windows.h> #include <shellapi.h> int main () {     shellexecute(null, l"open", searching_url, null, null, sw_showmaximized); } 

it works in computer. but, sent windows app other people , said doesn't work. mean shellexecute doesn't work. cannot catch start figuring out what's wrong here.

would please suggest how figure out in structured way? thanks.

two things try:

  • shellexecute can require com initialized under circumstances. docs shellexecute function explain why in more detail. should call coinitializeex(null, coinit_apartmentthreaded | coinit_disable_ole1dde) before call shellexecute , couninitialize() afterwards.
  • instead of using l"open" verb, should use null. null give "default" action object (equivalent double-clicking it) not "open".

Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -