Print Page | Close Window

[solved] RibbonSample not working in VS2017

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
Printed Date: 20 January 2019 at 6:44am

Topic: [solved] RibbonSample not working in VS2017
Posted By: achar
Subject: [solved] RibbonSample not working in VS2017
Date Posted: 12 April 2018 at 10:04am
I try to run a sample for the ribbon found in:
C:\Program Files (x86)\Codejock Software\ActiveX\Xtreme SuitePro ActiveX v18.3.0\Samples\CommandBars\VB.NET\RibbonSample

When I hit run, i get the following error:

System.NullReferenceException: 'Object reference not set to an instance of an object.'

found at:

    Private Sub CommandBars_ResizeClient(ByVal sender As Object, ByVal e As AxXtremeCommandBars._DCommandBarsEvents_ResizeClientEvent) Handles CommandBars.ResizeClient
    End Sub

among other "Exception thrown: 'System.NullReferenceException' in RibbonSample.exe"

It must be something very obvious, but I cannot get it to work. It migrated from a previous version, but I don't think this is the issue. Any ideas?

Posted By: olebed
Date Posted: 14 April 2018 at 4:19am

Make sure older versions of SuitePro uninstalled and unregistered properly.

Also try to change in Configuration Manager  Platform from "Any CPU"/"x64"  to x86 then rebuild solution.

 Oleksandr Lebed

Posted By: achar
Date Posted: 15 April 2018 at 10:04am
Thank you for your reply,

I did all that but the problem remains. Actually, the program crashes alltogether when I run it ("RibbonSample has stopped working"), and I cannot find the point where it crashes to put a breakpoint. It seems this happens when the window tries to paint the Ribbon.

After modifying a RibbonSample a lot, and randomly playing around with configurations, I found that commenting out the following snippet in the CreateRibbonBar() method allows the program to start, although the ribbon is probably not drawn properly:

        'this crashes
        'ControlFile = RibbonBar.AddSystemButton()
        'ControlFile.IconId = ID_SYSTEM_ICON
        'ControlFile.Caption = "&File"
        'ControlFile.Style = XtremeCommandBars.XTPButtonStyle.xtpButtonCaption

Posted By: olebed
Date Posted: 15 April 2018 at 10:16am
Try to run C# RibbonSample.

Posted By: achar
Date Posted: 15 April 2018 at 2:08pm
I get the following error:

System.Runtime.InteropServices.COMException: 'Class is not licensed for use (Exception from HRESULT: 0x80040112)'

at frmMain.cs

private void CommandBars_ResizeClient(object sender, AxXtremeCommandBars._DCommandBarsEvents_ResizeClientEvent e)
Refresh(); <<<<<<here

I have installed the whole bundle normally, and I have worked with other controls such as chart, datepicker, etc without any problems.

Posted By: olebed
Date Posted: 16 April 2018 at 10:33am

I can't find any similar problems on our support site or this forum. Problem can be in some little detail.
Please create support ticket on  (see this page" rel="nofollow - )

Then we can contact by TeamViewer.

 Oleksandr Lebed

Posted By: achar
Date Posted: 16 April 2018 at 11:26am
I am aware that there are no similar problems in the forum, which probably means that it is something stupid on my part.

I have just found that running the sample in situ (C:\Program Files (x86)\Codejock Software\ActiveX\Xtreme SuitePro ActiveX v18.3.0\Samples\CommandBars\VB.NET\RibbonSample) works OK!!!

But if I copy the whole RibbonSample folder in a temp folder (which I have done so far for backup reasons - it migrates from a previous version), the project compiles successfully but doesn't work as described earlier. 

Is this any help?

Posted By: olebed
Date Posted: 17 April 2018 at 3:40am
I have found reason.
System.NullReferenceException  is about missing theme DLL. They allocated in 
c:\Program Files (x86)\Codejock Software\ActiveX\Xtreme SuitePro ActiveX v18.3.0\Samples\Styles\

you can just change method  
StylesPath()  in frmMain.vb  to get correct path and copy that DLLs to correct path.

Posted By: achar
Date Posted: 17 April 2018 at 6:53am
That was it, thank you!

Print Page | Close Window