Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - [solved] RibbonSample vb.net not working in VS2017
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[solved] RibbonSample vb.net not working in VS2017

 Post Reply Post Reply
Author
Message
achar View Drop Down
Groupie
Groupie


Joined: 12 April 2018
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote achar Quote  Post ReplyReply Direct Link To This Post Topic: [solved] RibbonSample vb.net not working in VS2017
    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?
Back to Top
olebed View Drop Down
Admin Group
Admin Group
Avatar

Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 836
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
achar View Drop Down
Groupie
Groupie


Joined: 12 April 2018
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote achar Quote  Post ReplyReply Direct Link To This Post 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()

Back to Top
olebed View Drop Down
Admin Group
Admin Group
Avatar

Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 836
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 15 April 2018 at 10:16am
Try to run C# RibbonSample.
Back to Top
achar View Drop Down
Groupie
Groupie


Joined: 12 April 2018
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote achar Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
olebed View Drop Down
Admin Group
Admin Group
Avatar

Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 836
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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 https://www.codejock.com/support/)

Then we can contact by TeamViewer.

Regards,
 Oleksandr Lebed
Back to Top
achar View Drop Down
Groupie
Groupie


Joined: 12 April 2018
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote achar Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
olebed View Drop Down
Admin Group
Admin Group
Avatar

Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 836
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
achar View Drop Down
Groupie
Groupie


Joined: 12 April 2018
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote achar Quote  Post ReplyReply Direct Link To This Post Posted: 17 April 2018 at 6:53am
That was it, thank you!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.078 seconds.