In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Obtaining registry key
-
- Mensajes: 305
- Registrado: Jue Nov 30, 2006 12:17 am
Obtaining registry key
Hi,
I need to check in my program if a a certain ActiveX component is
registered. I use - unsuccessfully - the following code:
//---------------------------------------------------------- --------------------
STATIC FUNCTION RegisterRMChartX()
LOCAL cRegPath :=
" HKEY_CLASSES_ROOTCLSID{8E2EA06D-6ACA-4E52-9D5D-3CE2A89A15B E}ProgID "
LOCAL oReg := TRegistry():New()
LOCAL cValue
cValue := oReg:GetString(cRegPath)
// the return value is an empty string where it should be
"RMChart.RMChartX"
IF cValue != "RMChart.RMChartX"
// register component
ENDIF
RETURN Nil
Can some help me out here?
Regards,
Stephan
I need to check in my program if a a certain ActiveX component is
registered. I use - unsuccessfully - the following code:
//---------------------------------------------------------- --------------------
STATIC FUNCTION RegisterRMChartX()
LOCAL cRegPath :=
" HKEY_CLASSES_ROOTCLSID{8E2EA06D-6ACA-4E52-9D5D-3CE2A89A15B E}ProgID "
LOCAL oReg := TRegistry():New()
LOCAL cValue
cValue := oReg:GetString(cRegPath)
// the return value is an empty string where it should be
"RMChart.RMChartX"
IF cValue != "RMChart.RMChartX"
// register component
ENDIF
RETURN Nil
Can some help me out here?
Regards,
Stephan
Obtaining registry key
Stephan,
> I need to check in my program if a a certain ActiveX component is
> registered. I use - unsuccessfully - the following code:
this should do the trick:
METHOD Button1Click( oSender ) CLASS TForm1
LOCAL cValue
WITH OBJECT TRegistry():New()
:Root := HKEY_CLASSES_ROOT
IF :OpenKey( "RMChart.RMChartXClsid" ) == 0
cValue := :GetString( "" ) // Gets the default value
IF Empty( cValue )
DllRegisterServer( "<path>rmchart.ocx" )
ENDIF
:CloseKey()
ENDIF
END
RETURN Nil
Let me know if it helps.
Regards,
José Lalín
> I need to check in my program if a a certain ActiveX component is
> registered. I use - unsuccessfully - the following code:
this should do the trick:
METHOD Button1Click( oSender ) CLASS TForm1
LOCAL cValue
WITH OBJECT TRegistry():New()
:Root := HKEY_CLASSES_ROOT
IF :OpenKey( "RMChart.RMChartXClsid" ) == 0
cValue := :GetString( "" ) // Gets the default value
IF Empty( cValue )
DllRegisterServer( "<path>rmchart.ocx" )
ENDIF
:CloseKey()
ENDIF
END
RETURN Nil
Let me know if it helps.
Regards,
José Lalín
Obtaining registry key
Stephan,
> I need to check in my program if a a certain ActiveX component is
> registered. I use - unsuccessfully - the following code:
this should do the trick:
METHOD Button1Click( oSender ) CLASS TForm1
LOCAL cValue
WITH OBJECT TRegistry():New()
:Root := HKEY_CLASSES_ROOT
IF :OpenKey( "RMChart.RMChartXClsid" ) == 0
cValue := :GetString( "" ) // Gets the default value
IF Empty( cValue )
DllRegisterServer( "<path>rmchart.ocx" )
ENDIF
:CloseKey()
ENDIF
END
RETURN Nil
Let me know if it helps.
Regards,
José Lalín
> I need to check in my program if a a certain ActiveX component is
> registered. I use - unsuccessfully - the following code:
this should do the trick:
METHOD Button1Click( oSender ) CLASS TForm1
LOCAL cValue
WITH OBJECT TRegistry():New()
:Root := HKEY_CLASSES_ROOT
IF :OpenKey( "RMChart.RMChartXClsid" ) == 0
cValue := :GetString( "" ) // Gets the default value
IF Empty( cValue )
DllRegisterServer( "<path>rmchart.ocx" )
ENDIF
:CloseKey()
ENDIF
END
RETURN Nil
Let me know if it helps.
Regards,
José Lalín
-
- Mensajes: 305
- Registrado: Jue Nov 30, 2006 12:17 am
Obtaining registry key
Thanks a lot José (for great support, again),
after moving the the three lines of your code it worked perfectly.
Not the code is:
LOCAL cValue
WITH OBJECT TRegistry():New()
:Root := HKEY_CLASSES_ROOT
IF :OpenKey("RMChart.RMChartXClsid") == 0
cValue := :GetString("") // Gets the default value
:CloseKey()
ENDIF
IF Empty(cValue)
DllRegisterServer(GetPathFile(Application:cFilename) +
"rmchart.ocx")
ENDIF
END
:OpenKey("RMChart.RMChartXClsid") == 0 is only TRUE if the component is
registered.
Regards,
Stephan
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46d2b8c3@ozsrv2.ozlan.local...]46d2b8c3@ozsrv2.ozlan.local...[/email]
>
> Stephan,
>
>> I need to check in my program if a a certain ActiveX component is
>> registered. I use - unsuccessfully - the following code:
>
> this should do the trick:
>
> METHOD Button1Click( oSender ) CLASS TForm1
>
> LOCAL cValue
>
> WITH OBJECT TRegistry():New()
> :Root := HKEY_CLASSES_ROOT
> IF :OpenKey( "RMChart.RMChartXClsid" ) == 0
> cValue := :GetString( "" ) // Gets the default value
> IF Empty( cValue )
> DllRegisterServer( "<path>rmchart.ocx" )
> ENDIF
> :CloseKey()
> ENDIF
> END
>
> RETURN Nil
>
> Let me know if it helps.
>
> Regards,
> José Lalín
after moving the the three lines of your code it worked perfectly.
Not the code is:
LOCAL cValue
WITH OBJECT TRegistry():New()
:Root := HKEY_CLASSES_ROOT
IF :OpenKey("RMChart.RMChartXClsid") == 0
cValue := :GetString("") // Gets the default value
:CloseKey()
ENDIF
IF Empty(cValue)
DllRegisterServer(GetPathFile(Application:cFilename) +
"rmchart.ocx")
ENDIF
END
:OpenKey("RMChart.RMChartXClsid") == 0 is only TRUE if the component is
registered.
Regards,
Stephan
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46d2b8c3@ozsrv2.ozlan.local...]46d2b8c3@ozsrv2.ozlan.local...[/email]
>
> Stephan,
>
>> I need to check in my program if a a certain ActiveX component is
>> registered. I use - unsuccessfully - the following code:
>
> this should do the trick:
>
> METHOD Button1Click( oSender ) CLASS TForm1
>
> LOCAL cValue
>
> WITH OBJECT TRegistry():New()
> :Root := HKEY_CLASSES_ROOT
> IF :OpenKey( "RMChart.RMChartXClsid" ) == 0
> cValue := :GetString( "" ) // Gets the default value
> IF Empty( cValue )
> DllRegisterServer( "<path>rmchart.ocx" )
> ENDIF
> :CloseKey()
> ENDIF
> END
>
> RETURN Nil
>
> Let me know if it helps.
>
> Regards,
> José Lalín
-
- Mensajes: 305
- Registrado: Jue Nov 30, 2006 12:17 am
Obtaining registry key
Thanks a lot José (for great support, again),
after moving the the three lines of your code it worked perfectly.
Not the code is:
LOCAL cValue
WITH OBJECT TRegistry():New()
:Root := HKEY_CLASSES_ROOT
IF :OpenKey("RMChart.RMChartXClsid") == 0
cValue := :GetString("") // Gets the default value
:CloseKey()
ENDIF
IF Empty(cValue)
DllRegisterServer(GetPathFile(Application:cFilename) +
"rmchart.ocx")
ENDIF
END
:OpenKey("RMChart.RMChartXClsid") == 0 is only TRUE if the component is
registered.
Regards,
Stephan
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46d2b8c3@ozsrv2.ozlan.local...]46d2b8c3@ozsrv2.ozlan.local...[/email]
>
> Stephan,
>
>> I need to check in my program if a a certain ActiveX component is
>> registered. I use - unsuccessfully - the following code:
>
> this should do the trick:
>
> METHOD Button1Click( oSender ) CLASS TForm1
>
> LOCAL cValue
>
> WITH OBJECT TRegistry():New()
> :Root := HKEY_CLASSES_ROOT
> IF :OpenKey( "RMChart.RMChartXClsid" ) == 0
> cValue := :GetString( "" ) // Gets the default value
> IF Empty( cValue )
> DllRegisterServer( "<path>rmchart.ocx" )
> ENDIF
> :CloseKey()
> ENDIF
> END
>
> RETURN Nil
>
> Let me know if it helps.
>
> Regards,
> José Lalín
after moving the the three lines of your code it worked perfectly.
Not the code is:
LOCAL cValue
WITH OBJECT TRegistry():New()
:Root := HKEY_CLASSES_ROOT
IF :OpenKey("RMChart.RMChartXClsid") == 0
cValue := :GetString("") // Gets the default value
:CloseKey()
ENDIF
IF Empty(cValue)
DllRegisterServer(GetPathFile(Application:cFilename) +
"rmchart.ocx")
ENDIF
END
:OpenKey("RMChart.RMChartXClsid") == 0 is only TRUE if the component is
registered.
Regards,
Stephan
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46d2b8c3@ozsrv2.ozlan.local...]46d2b8c3@ozsrv2.ozlan.local...[/email]
>
> Stephan,
>
>> I need to check in my program if a a certain ActiveX component is
>> registered. I use - unsuccessfully - the following code:
>
> this should do the trick:
>
> METHOD Button1Click( oSender ) CLASS TForm1
>
> LOCAL cValue
>
> WITH OBJECT TRegistry():New()
> :Root := HKEY_CLASSES_ROOT
> IF :OpenKey( "RMChart.RMChartXClsid" ) == 0
> cValue := :GetString( "" ) // Gets the default value
> IF Empty( cValue )
> DllRegisterServer( "<path>rmchart.ocx" )
> ENDIF
> :CloseKey()
> ENDIF
> END
>
> RETURN Nil
>
> Let me know if it helps.
>
> Regards,
> José Lalín
Obtaining registry key
Stephan,
> Thanks a lot José (for great support, again),
You are welcome !
> after moving the the three lines of your code it worked perfectly.
Ok.
> :OpenKey("RMChart.RMChartXClsid") == 0 is only TRUE if the component is
> registered.
OpenKey returns TRUE if the key exists and the caller has enough permission
to open it. To check if registered just check is cValue is not empty.
Regards,
José Lalín
> Thanks a lot José (for great support, again),
You are welcome !
> after moving the the three lines of your code it worked perfectly.
Ok.
> :OpenKey("RMChart.RMChartXClsid") == 0 is only TRUE if the component is
> registered.
OpenKey returns TRUE if the key exists and the caller has enough permission
to open it. To check if registered just check is cValue is not empty.
Regards,
José Lalín
Obtaining registry key
Stephan,
> Thanks a lot José (for great support, again),
You are welcome !
> after moving the the three lines of your code it worked perfectly.
Ok.
> :OpenKey("RMChart.RMChartXClsid") == 0 is only TRUE if the component is
> registered.
OpenKey returns TRUE if the key exists and the caller has enough permission
to open it. To check if registered just check is cValue is not empty.
Regards,
José Lalín
> Thanks a lot José (for great support, again),
You are welcome !
> after moving the the three lines of your code it worked perfectly.
Ok.
> :OpenKey("RMChart.RMChartXClsid") == 0 is only TRUE if the component is
> registered.
OpenKey returns TRUE if the key exists and the caller has enough permission
to open it. To check if registered just check is cValue is not empty.
Regards,
José Lalín
-
- Mensajes: 305
- Registrado: Jue Nov 30, 2006 12:17 am
Obtaining registry key
Oke, thanks for the explanation!
Regards,
Stephan
"José Lalín" <notengo@correo.com> wrote in message
news:46d2ca1d$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>
> Stephan,
>
>> Thanks a lot José (for great support, again),
>
> You are welcome !
>
>> after moving the the three lines of your code it worked perfectly.
>
> Ok.
>
>> :OpenKey("RMChart.RMChartXClsid") == 0 is only TRUE if the component is
>> registered.
>
> OpenKey returns TRUE if the key exists and the caller has enough
> permission to open it. To check if registered just check is cValue is not
> empty.
>
> Regards,
> José Lalín
Regards,
Stephan
"José Lalín" <notengo@correo.com> wrote in message
news:46d2ca1d$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>
> Stephan,
>
>> Thanks a lot José (for great support, again),
>
> You are welcome !
>
>> after moving the the three lines of your code it worked perfectly.
>
> Ok.
>
>> :OpenKey("RMChart.RMChartXClsid") == 0 is only TRUE if the component is
>> registered.
>
> OpenKey returns TRUE if the key exists and the caller has enough
> permission to open it. To check if registered just check is cValue is not
> empty.
>
> Regards,
> José Lalín
-
- Mensajes: 305
- Registrado: Jue Nov 30, 2006 12:17 am
Obtaining registry key
Oke, thanks for the explanation!
Regards,
Stephan
"José Lalín" <notengo@correo.com> wrote in message
news:46d2ca1d$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>
> Stephan,
>
>> Thanks a lot José (for great support, again),
>
> You are welcome !
>
>> after moving the the three lines of your code it worked perfectly.
>
> Ok.
>
>> :OpenKey("RMChart.RMChartXClsid") == 0 is only TRUE if the component is
>> registered.
>
> OpenKey returns TRUE if the key exists and the caller has enough
> permission to open it. To check if registered just check is cValue is not
> empty.
>
> Regards,
> José Lalín
Regards,
Stephan
"José Lalín" <notengo@correo.com> wrote in message
news:46d2ca1d$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>
> Stephan,
>
>> Thanks a lot José (for great support, again),
>
> You are welcome !
>
>> after moving the the three lines of your code it worked perfectly.
>
> Ok.
>
>> :OpenKey("RMChart.RMChartXClsid") == 0 is only TRUE if the component is
>> registered.
>
> OpenKey returns TRUE if the key exists and the caller has enough
> permission to open it. To check if registered just check is cValue is not
> empty.
>
> Regards,
> José Lalín