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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -