Print Page | Close Window

[solved] RibbonSample vb.net not working in VS2017

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=23625
Printed Date: 27 April 2024 at 12:23am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [solved] RibbonSample vb.net not working in VS2017
Posted By: achar
Subject: [solved] RibbonSample vb.net 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
        Refresh()
    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?



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

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.

Regards,
 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.

EDIT:
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
        'CreateBackstageView()



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
Hello,

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 support.codejock.com  (see this page http://www.codejock.com/support/" rel="nofollow - https://www.codejock.com/support/ )

Then we can contact by TeamViewer.

Regards,
 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

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net