RegisterServer( )

RegisterServer( )

Postby Natter » Fri Apr 24, 2009 11:23 am

Hi, All !

I tryed to do exapmle RibbonBar.prg (FWH 9.4) but RegisterServer( "Codejock.CommandBars.v12.1.1.ocx" ) is not work and I got error GPF
(file Codejock.CommandBars.v12.1.1.ocx exist in pholder of this example). What it ?
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: RegisterServer( )

Postby Antonio Linares » Fri Apr 24, 2009 5:51 pm

Natter,

Have you tried it with the CodeJock 13.0.0 demo version ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: RegisterServer( )

Postby Natter » Fri Apr 24, 2009 8:08 pm

Yes, I tried with 13 and 12 and 11 versions - it is not work. But if I istalled before full Codejock ActiveX then work fine
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: RegisterServer( )

Postby anserkk » Sat Apr 25, 2009 5:07 am

Hi,

I am also having similiar problem. With CodeJock ver 12.1.1, I am getting GPF. But with ver 13 Demo I am not getting the GPF. Everything works fine if CodeJock Setup.exe is run on the PC

viewtopic.php?f=3&t=15102&start=91

Everything works fine if CodeJock Setup.exe is run. But if you try to run the FWH application on a different PC (On a PC where CodeJock Setup is NOT installed), then I find the problem described as above

In both the version IsActivex("Codejock.CommandBars.v12.1.1.ocx") returns .F.
Code: Select all  Expand view
If IsActivex("Codejock.CommandBars.v12.1.1.ocx")
    MsgInfo("Activex is already Registerd")
else
    MsgInfo("Activex is NOT Registerd, Now it will Register")
    RegisterServer( "Codejock.CommandBars.v12.1.1.ocx" )
Endif


As I was busy with some other project, I did not investigate further. I just wanted to experience and learn the process of using a third party ocx in our application and the problems which we may face while distributing the application.

CodeJock Site says

You will need to provide the correct Product Id and Validate Code. This information can be found in the LIC file. The LIC file is located in the same location as the OCX file. By default, the location of the OCX and LIC file is the "..\Program Files\Codejock Software\ActiveX\Xtreme SuitePro ActiveX 2006 Q2\bin" for the Xtreme Suite installation. This code should be included before any controls are created, for example, in the Form_Initialize event of the main form for Visual Basic 6.0. For simplicity, the code below demonstrates how to embed the license information for the CommandBars only, you will need to do this for each control you use.

VB 6.0

Code: Select all  Expand view
Private Sub Form_Initialize()
    CommandBarsGlobalSettings.License = "CommandBars Control Copyright (c) " & _
    "2003-2006 Codejock Software" & vbCrLf & "PRODUCT-ID: " & _
    "Codejock.CommandBars.ActiveX.v10.20" & vbCrLf & _
    "VALIDATE-CODE: XXX-XXX-XXX-XXX"
End Sub


But I don't know how to access those properties thru FWH's Activate Window oWnd ON INIT ( )


Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: RegisterServer( )

Postby Natter » Sat Apr 25, 2009 8:48 am

Hi,

I do regsvr32 Codejock.CommandBars.v12.1.1.ocx - is sucsessfull, but ribbonbar not work

Yes, if CodeJock Setup.exe(any versions) is run then everything works fine
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: RegisterServer( )

Postby anserkk » Sat Apr 25, 2009 9:22 am

Hi Mr.Natter

Yes the same with me. I manualy registered the OCX successfully using the below given command
regsvr32 Codejock.CommandBars.v12.1.1.ocx

Code: Select all  Expand view
MsgInfo("About to call TActivex")
// Program gives GPF at the next line.
oAct := TActiveX():New( oWnd, "Codejock.CommandBarsFrame.12.1.1", 0, 0, 100, 100 )  


I beleive that it should be a licence issue, we may have to somehow set the licence key thru GlobalSettings, before the control is created as said in the website. But I don't know how to access CommandBar properties in FWH just before the control is created.

I even tried using the ON INIT, but no results

Code: Select all  Expand view
ACTIVATE WINDOW oWnd ;
     ON INIT (oSettings = oAct:GetProp( "CommandBarsGlobalSettings" ),;
     oSettings:License = "CommandBars Control Copyright (c) " + ;
    "2003-2006 Codejock Software" +CRLF+ "PRODUCT-ID: " + ;
    "Codejock.CommandBars.ActiveX.v12.1" + CRLF +;
    "VALIDATE-CODE: xxx-xxx-xx-xxx")


Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: RegisterServer( )

Postby Natter » Sat Apr 25, 2009 12:13 pm

I think that find solution:
files Codejock.CommandBars.v12.1.1.ocx and Codejock.CommandBars.v12.1.1.lic have to exist into one pholder

That all !!
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: RegisterServer( )

Postby anserkk » Sun Apr 26, 2009 1:55 pm

Hi Mr.Natter,

Good to know that you solved the problem. So how do we distribute the application on client PC's. CodeJockCommandBars.lic file is a simple text file containing the licence key, which means that anybody can read the licence key. I believe that there should be someother way to solve this issue.

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: RegisterServer( )

Postby Natter » Sun Apr 26, 2009 8:38 pm

You can distributed for users files Codejock.CommandBars.v12.1.1.ocx and Codejock.CommandBars.v12.1.1.lic.
Then, for first run you application, do :
regsvr32 /s Codejock.CommandBars.v12.1.1.ocx
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: RegisterServer( )

Postby anserkk » Mon Apr 27, 2009 5:33 am

You can distributed for users files Codejock.CommandBars.v12.1.1.ocx and Codejock.CommandBars.v12.1.1.lic.


Hi Mr.Natter,

If we distribute the license key file (that too in a plain text Ascii file), then if somebody has access to the license key at our client PC's then we don't have any control on the CodeJock's License. I am looking for a solution to set the license key programatically so that nobody else can use the CodeJock Control other than the one who knows/purchased the license key.

Then, for first run you application, do :
regsvr32 /s Codejock.CommandBars.v12.1.1.ocx


I don't know why IsActivex() always returning .F. in my PC, eventhough it is registered
Code: Select all  Expand view
CoInitialize()
If IsActivex("Codejock.CommandBars.v12.1.1.ocx")
    MsgInfo("Activex is already Registerd")
else
    MsgInfo("Activex is NOT Registerd yet, Now FWH is going to Register this Activex")
    RegisterServer( "Codejock.CommandBars.v12.1.1.ocx" )
Endif

// See the next statements. IsActivex() always returns .F.
CoInitialize()
If IsActivex("Codejock.CommandBars.v12.1.1.ocx")
    MsgInfo("Activex is Successful")
else  // Not Registered
    MsgInfo("Unable to register the Activex")
Endif
 
Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: RegisterServer( )

Postby Antonio Linares » Mon Apr 27, 2009 9:39 am

Anser,

I don't know why IsActivex() always returning .F. in my PC


FWH IsActiveX() checks if a CLSID exists for a given PROGID:
http://en.wikipedia.org/wiki/ProgID
if not found, then .F. is returned.

The question is: why sometimes the CLSID is not found for a certain PROGID ? :(
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: RegisterServer( )

Postby anserkk » Mon Apr 27, 2009 9:55 am

Dear Mr.Antonio,

The question is: why the CLSID is not found for a certain PROGID ? :(


Thankyou for clearing my confusion regarding the IsActivex() :)

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: RegisterServer( )

Postby StefanHaupt » Mon Apr 27, 2009 9:17 pm

Anser,

in my tests
Code: Select all  Expand view
IsActiveX("Codejock.CommandBars.12.1.1")
or
Code: Select all  Expand view
IsActiveX ("Codejock.CommandBarsFrame.12.1.1")

is working and returns .t. if registered. It seems, there is more than one control in the .ocx file (is that possible ? )
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: RegisterServer( )

Postby anserkk » Tue Apr 28, 2009 4:22 am

Dear Mr.Stefan,

I have tested only on Windows XP SP3. What is the OS used in your PC ?

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: RegisterServer( )

Postby anserkk » Tue Apr 28, 2009 7:00 am

Dear Mr.Antonio,Mr.Stephan & Mr.Natter

IsActivex() is working now as expected. I found out my mistake

The Parameter to IsActivex which I used was wrong
IsActivex("Codejock.CommandBars.v12.1.1.ocx") // wrong one

The parameter should be
IsActivex("Codejock.CommandBars.12.1.1")

or you can use the class id of Activex
IsActivex("{D696C90D-2836-4CEA-A1A5-F9C7ADCA5BF2}")

To find out the right parameter to be used with IsActivex() you can check the Registery path.
Eg.1
HKEY_CLASSES_ROOT\Codejock.CommandBars.12.1.1

Eg.2 - ClassID
HKEY_CLASSES_ROOT\Codejock.CommandBars.12.1.1\CLSID

Has anybody here used CodeJock in your FWH app. and distributed it in your client PC's. I still have not found a solution to activate the licence through code. ( For the time being, it is working, if I distribute the .lic license file along with the OCX control. Thanks to Mr.Natter) But using VB and other prog.lang we can access the members of the control even before the control is initialised. I don't know how to do that using FWH.

It appears that the problem I'm having is that you can't access the public members of CommandBars until after the control is fully initialized. Trying to access them before full initialization throws an error. However, when you finalize the control, it looks for the license. It appears I'm stuck! I can't set the license before initialization without throwing an error, and I can't initialize the control without a license.

Regards
Anser
Last edited by anserkk on Tue Apr 28, 2009 7:42 am, edited 2 times in total.
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 112 guests