why AssocQueryString doesn't work?

why AssocQueryString doesn't work?

Post by David Lownde » Thu, 13 Jun 2002 20:37:01



Quote:>  i worked on windows 2000 professional english version,
>vc6, platform sdk(2001.2), i use AssocQueryString to
>retrieve the application associated with some document
>type, but it always return error code even if the .txt
>document. could anyone tell me why?

What does the HRESULT error code tell you the problem is?

Show a short example of your code, perhaps someone will then be able
to help you.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.

 
 
 

why AssocQueryString doesn't work?

Post by swl » Fri, 14 Jun 2002 13:00:37


//my code is:
DWORD dwBufLen = _MAX_FNAME;
TCHAR szAppName[_MAX_FNAME] = "\0";

// Get the application associated with the document type
HRESULT hResult = AssocQueryString(ASSOCF_OPEN_BYEXENAME,
        ASSOCSTR_EXECUTABLE,
        ".txt",
        NULL,
        szAppName,
        &dwBufLen) )

return value of AssocQueryString is 0x80070483. that is to
say:
No application is associated with the specified file for
this operation.

thanks for any suggestion!

Quote:>-----Original Message-----
>>  i worked on windows 2000 professional english version,
>>vc6, platform sdk(2001.2), i use AssocQueryString to
>>retrieve the application associated with some document
>>type, but it always return error code even if the .txt
>>document. could anyone tell me why?

>What does the HRESULT error code tell you the problem is?

>Show a short example of your code, perhaps someone will
then be able
>to help you.

>Dave
>--
>MVP VC++ FAQ: http://www.mvps.org/vcfaq
>My address is altered to discourage junk mail.
>Please post responses to the newsgroup thread,
>there's no need for follow-up email copies.
>.


 
 
 

why AssocQueryString doesn't work?

Post by David Lownde » Fri, 14 Jun 2002 20:29:48


Try this:

        HRESULT hResult = AssocQueryString(0,
                ASSOCSTR_EXECUTABLE,
                ".txt",
                NULL,
                szAppName,
                &dwBufLen);

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.

 
 
 

why AssocQueryString doesn't work?

Post by swl » Sat, 15 Jun 2002 16:16:39


it worked! but why?
Quote:>-----Original Message-----
>Try this:

>    HRESULT hResult = AssocQueryString(0,
>            ASSOCSTR_EXECUTABLE,
>            ".txt",
>            NULL,
>            szAppName,
>            &dwBufLen);

>Dave
>--
>MVP VC++ FAQ: http://www.mvps.org/vcfaq
>My address is altered to discourage junk mail.
>Please post responses to the newsgroup thread,
>there's no need for follow-up email copies.
>.

 
 
 

why AssocQueryString doesn't work?

Post by David Lownde » Tue, 18 Jun 2002 17:35:23


Quote:>it worked! but why?

Good question!

The documentation for AssocQueryString isn't particularly clear is it?

I suspect the documentation is meaningful to someone who's implemented
IQueryAssociations, but not to anyone else.

FWIW, I found what worked by trial and error! ;)

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.

 
 
 

1. Why option 'pages=' doesn't work in 'proc tree'?

Hi, everyone,

I got the tree data after running cluster procedure. I want to draw the tree
in several pages 'cause the number of clusters is very big. Showing just in
1 page is very unclear to read. But I can't get it when I use option pages=.
Why?

How to get a good presentation for the tree? Thanks a lot.

2. Fax dialing woes

3. Why doesn't my Snow White Work DVD work?

4. SOFTWARE DISTRIBUTION INSTALLATION LOG

5. Idiot with Umax Scanner - Why doesn't it work?

6. viewing remote process/CPU/memory

7. Why doesn't the light switch work any more?

8. Windows Update site hangs on download

9. Why doesn't a simple s-link setup work for me?

10. Microphone doesn't work...why?

11. Why doesn't this work?