Hi,
I have an application , it does not register itself to windows file manager
( I mean , if I double click on a document of my application type, it does
not open)
How can I make it register itself,

Thanks,

Re: My application does not register itself to windows file manager by M

M
Mon Apr 14 04:40:53 CDT 2008

CWinApp::RegisterShellFileTypes() is the answer. You would also need to call
EnableShellOpen before calling RegisterShellFileTypes().

Check MSDN for more details:
http://msdn2.microsoft.com/en-us/library/538tbk4a(VS.80).aspx

Regards,
Shoaib.

"behzad" <bn at yahoo.com> wrote in message
news:%23F4AZmgnIHA.5472@TK2MSFTNGP03.phx.gbl...
> Hi,
> I have an application , it does not register itself to windows file
> manager ( I mean , if I double click on a document of my application type,
> it does not open)
> How can I make it register itself,
>
> Thanks,
>



Re: My application does not register itself to windows file manager by Igor

Igor
Mon Apr 14 07:00:53 CDT 2008

"behzad" <bn at yahoo.com> wrote in message
news:%23F4AZmgnIHA.5472@TK2MSFTNGP03.phx.gbl
> I have an application , it does not register itself to windows file
> manager ( I mean , if I double click on a document of my application
> type, it does not open)
> How can I make it register itself,

http://msdn2.microsoft.com/en-us/library/cc147473.aspx
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925



Re: My application does not register itself to windows file manager by behzad

behzad
Mon Apr 14 07:48:19 CDT 2008

I already have these lines, what else could be the problem ?

Thanks,

"M. Shoaib Surya" <shoaibsurya@hotmail.com> wrote in message
news:OHh0$RhnIHA.1212@TK2MSFTNGP05.phx.gbl...
> CWinApp::RegisterShellFileTypes() is the answer. You would also need to
> call EnableShellOpen before calling RegisterShellFileTypes().
>
> Check MSDN for more details:
> http://msdn2.microsoft.com/en-us/library/538tbk4a(VS.80).aspx
>
> Regards,
> Shoaib.
>
> "behzad" <bn at yahoo.com> wrote in message
> news:%23F4AZmgnIHA.5472@TK2MSFTNGP03.phx.gbl...
>> Hi,
>> I have an application , it does not register itself to windows file
>> manager ( I mean , if I double click on a document of my application
>> type, it does not open)
>> How can I make it register itself,
>>
>> Thanks,
>>
>
>



Re: My application does not register itself to windows file manager by David

David
Mon Apr 14 08:19:17 CDT 2008

behzad wrote:
> I already have these lines, what else could be the problem ?

Did you define your document string (IDR_MAINFRAME)?

--
David Wilkinson
Visual C++ MVP

Re: My application does not register itself to windows file manager by behzad

behzad
Mon Apr 14 08:57:14 CDT 2008

Yes

IDR_MAINFRAME "STM\n\nSTM\nSTM Files
(*.stm)\n.stm\nSTM.Document\nSTM Document"

Behzad

"David Wilkinson" <no-reply@effisols.com> wrote in message
news:OfjbnIjnIHA.3636@TK2MSFTNGP02.phx.gbl...
> behzad wrote:
>> I already have these lines, what else could be the problem ?
>
> Did you define your document string (IDR_MAINFRAME)?
>
> --
> David Wilkinson
> Visual C++ MVP
>



Re: My application does not register itself to windows file manager by SvenC

SvenC
Mon Apr 14 09:26:17 CDT 2008

Hi behzad,

>> CWinApp::RegisterShellFileTypes() is the answer. You would also need to
>> call
>> EnableShellOpen before calling RegisterShellFileTypes().

> I already have these lines, what else could be the problem ?

Is you app running on vista? I guess the user does not have enough rights
to modify the registry. Run it once as admin: right click on the program
icon
which starts your app and choose "Run ad administrator". Now the
registration
should succeed.

The correct approach would be that your setup writes that information
so that only the setup needs to be run as admin.

--
SvenC


Re: My application does not register itself to windows file manager by M

M
Mon Apr 14 09:24:31 CDT 2008

The File Type "STM" is probably already be registered on your system. Try
with some different extension.

- Shoaib

"behzad" <bn at yahoo.com> wrote in message
news:%23mxF1djnIHA.5280@TK2MSFTNGP06.phx.gbl...
> Yes
>
> IDR_MAINFRAME "STM\n\nSTM\nSTM Files
> (*.stm)\n.stm\nSTM.Document\nSTM Document"
>
> Behzad
>
> "David Wilkinson" <no-reply@effisols.com> wrote in message
> news:OfjbnIjnIHA.3636@TK2MSFTNGP02.phx.gbl...
>> behzad wrote:
>>> I already have these lines, what else could be the problem ?
>>
>> Did you define your document string (IDR_MAINFRAME)?
>>
>> --
>> David Wilkinson
>> Visual C++ MVP
>>
>
>



Re: My application does not register itself to windows file manager by David

David
Mon Apr 14 11:01:20 CDT 2008

SvenC wrote:
> Is you app running on vista? I guess the user does not have enough rights
> to modify the registry. Run it once as admin: right click on the program
> icon
> which starts your app and choose "Run ad administrator". Now the
> registration
> should succeed.
>
> The correct approach would be that your setup writes that information
> so that only the setup needs to be run as admin.

Yes, if this is not changed in VS2008 (I don't have it here), I would have to
say this is a 'bug" in MFC. RegisterShellFileTypes() is pretty much useless
these days (at least as written).

--
David Wilkinson
Visual C++ MVP

Re: My application does not register itself to windows file manager by behzad

behzad
Tue Apr 15 01:32:44 CDT 2008

Thanks,

I still use XP !
I made other applications for test. After 1st run, they register
automatically. I just do not understand what is the problem with this
application or maybe the externsion Iuse (STM)

Behzad


"David Wilkinson" <no-reply@effisols.com> wrote in message
news:exFUKjknIHA.944@TK2MSFTNGP05.phx.gbl...
> SvenC wrote:
>> Is you app running on vista? I guess the user does not have enough rights
>> to modify the registry. Run it once as admin: right click on the program
>> icon
>> which starts your app and choose "Run ad administrator". Now the
>> registration
>> should succeed.
>>
>> The correct approach would be that your setup writes that information
>> so that only the setup needs to be run as admin.
>
> Yes, if this is not changed in VS2008 (I don't have it here), I would have
> to say this is a 'bug" in MFC. RegisterShellFileTypes() is pretty much
> useless these days (at least as written).
>
> --
> David Wilkinson
> Visual C++ MVP
>



Re: My application does not register itself to windows file manager by SvenC

SvenC
Tue Apr 15 01:46:16 CDT 2008

Hi behzad,

> I still use XP !
> I made other applications for test. After 1st run, they register
> automatically. I just do not understand what is the problem with this
> application or maybe the externsion Iuse (STM)

Please use ProcessMonitor from sysinternals to monitor the
registry access when your app starts. See if you find e.g any
access denied errors.

If it also does not register on your machine you might as well
debug into the mfc code and see where it fails.

--
SvenC