When I try to open or create a new model I get this error from Anylogic software:
could not initialize class com.anylogic.objectmodel.metadata.util.HideDisableValue.
Also, I got a problem with the palette:
Plug-in com.anylogic.graphicaleditor was unable to load class com.anylogic.views.palette.GEPaletteView.
Related
I have derived my own component based on class TCustomControl. I need to embedd into component bitmap resource stored in .png format. I added to project file resources.rc with this content:
AP_LOGO RCDATA .\AP_logo_RGB_transparent.png
Compilation was successfull. Component is statically linked to project. When I run the application it throws following error when trying to access embedded resource:
Project raised exception class EResNotFound with message 'Resource AP_LOGO not found'.
The following lines in source code access bitmap resource:
Graphics::TBitmap *bmp = new Graphics::TBitmap();
HINST handle = FindClassHInstance(__classid(TVctDiag2));
bmp->LoadFromResourceName(handle, L"AP_LOGO"); // <----- exception apppers there
When I open executable with resource editor there isnt any resource named 'AP_LOGO'. Why?
It does not work because the TBitmap::LoadFromResource...() methods look for BITMAP resources only, but you have defined an RCDATA resource instead. If you don't change your resource type then you will have to use TResourceStream instead, eg:
HINST handle = FindClassHInstance(__classid(TVctDiag2));
TResourceStream *strm = new TResourceStream(handle, L"AP_LOGO", RT_RCDATA);
Graphics::TBitmap *bmp = new Graphics::TBitmap();
bmp->LoadFromStream(strm);
delete strm;
With that saif, you cannot load a PNG resource into a TBitmap to begin with. If you must use a PNG resource then you have to use a PNG class instead, like TPngImage.
As part of my ongoing JDBC/Oracle saga, I solicited the help of one of our Java/JDBC experts and after receiving some more input via my last question "For JDBC in XPages, how does the server know the connection information?" we imbarked on creating a plugin for my ojdbc14.jar file. We got the plugin created and tried to complile it. It complained that it could not find the JDBCProvider Interface. My question is where do I find this? Is this part of the Extension Library files on the Server or is this something completely different?
As always, any help will be greatly appreciated.
Thanks,
MJ
You'll want to pick com.ibm.commons.Extension in the Extension Point dialog, and then set the type as com.ibm.commons.jdbcprovider. Set the class to your JDBC driver provider class (named com.ZetaOne.JDBC.drivers.DB2.DB2DriverProvider for example) which i've provided sample code for below that looks like this (customized to your particular driver, etc)
package com.ZetaOne.JDBC.drivers.DB2;
import java.sql.Driver;
import java.sql.SQLException;
import com.ibm.commons.jdbc.drivers.IJDBCDriverAlias;
import com.ibm.commons.jdbc.drivers.JDBCProvider;
public class DB2DriverProvider implements JDBCProvider {
public DB2DriverProvider() {
{
public Driver loadDriver(String className) throws SQLException {
if(classNmae.equals(com.ibm.db2.jcc.DB2Driver.class.getName())) {
return new com.ibm.db2.jcc.DB2Driver();
}
return null;
}
}
Assuming you've done everything else needed for the plugin, you should be able to export / create your update site and install the driver.
BTW, you'll be able to read how to setup & deploy and use the JDBC package in ExtLibX in our upcoming book "XPages Extension Library: A Step by Step Guide to the Next Generation of XPage Controls" - available on amazon pre-order at http://www.amazon.com/XPages-Extension-Library-Step---Step/dp/0132901811
Hope this helps.
My question goes here......
My job is to create a new Launch Configuration Type in Eclipse and add some Launch Configurations to the type I created.
I created a new Launch Configuration Type by extending the extension point org.eclipse.debug.core.launchConfigurationTypes
To add Launch Configurations to the type I created, I came to know that I need to extend the extension point org.eclipse.debug.core.launchDelegates. The only method that is to be overridden if it is extended is the launch() method. I placed the following code in this method.
public void launch(ILaunchConfiguration configuration, String mode,
ILaunch launch, IProgressMonitor monitor) throws CoreException {
ILaunchConfigurationType type = configuration.getType();//to get the type I created
ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(null, "MyConfiguration");
workingCopy.setAttribute(ATTR_MAIN_TYPE_NAME, "Mainclass");
workingCopy.setAttribute(ATTR_PROGRAM_ARGUMENTS, "start");
}
The problem is that the launch configurations that are created as mentioned above are not listed in the run/debug configuration dialog in the eclipse and also that it is not entering the launch() method body (founded it by debugging).
This is what I did to create launch configurations under a launch configuration type. if this is not enough please provide me with the required information.
These are the materials I have gone through
http://www.eclipse.org/articles/Article-Java-launch/launching-java.html and
http://www.eclipse.org/articles/Article-Launch-Framework/launch.html
Thanks in advance..........
I'm writing a test to learn how to use CheckedTreeSelectionDialog. This is the code.
CheckedTreeSelectionDialog dialog =
new CheckedTreeSelectionDialog(shell, new LabelProvider(), new TreeContentProvider() );
dialog.setTitle("Tree Selection");
dialog.setMessage("Select the elements from the tree:");
ElementTree et = new ElementTree();
et.createElement(new Path("element_1"), "element_1");
dialog.setInput(dt);
dialog.open();
But I get the exception:
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NoClassDefFoundError: org/eclipse/pde/internal/ui/elements/TreeContentProvider)
I really appreciate any hint!
Thanks!
You can't use the class org.eclipse.pde.internal.ui.elements.TreeContentProvider because it's only available for Eclipse PDE (the classes that are in a package 'internal' are not intended to be used by client).
Instead you should create your own TreeContentProvider, implementing the interface org.eclipse.jface.viewers.ITreeContentProvider, as you would do for a TreeViewer. A tutorial is here.
It appears the MSDN docs are broken concerning creating an Event Log completely along with a definitions file for messages. I am also lost on how to setup Categories (I have custom numbers in the 3000's for messages).
Can anyone point me to a link or show sample code on how to make this right?
You should start (if you haven't done so already) here:
EventLogInstaller Class (System.Diagnostics)
The sample provided there is the foundation for what you want to do. To sum it up, build a public class inheriting from System.Configuration.Install.Installer in an assembly (could be the same DLL where you have the rest of your application, a separate DLL, or an EXE file), decorate it with the RunInstaller attribute, and add your setup code in the constructor:
using System;
using System.Configuration.Install;
using System.Diagnostics;
using System.ComponentModel;
[RunInstaller(true)]
public class MyEventLogInstaller: Installer
{
private EventLogInstaller myEventLogInstaller;
public MyEventLogInstaller()
{
// Create an instance of an EventLogInstaller.
myEventLogInstaller = new EventLogInstaller();
// Set the source name of the event log.
myEventLogInstaller.Source = "NewLogSource";
// Set the event log that the source writes entries to.
myEventLogInstaller.Log = "MyNewLog";
// Add myEventLogInstaller to the Installer collection.
Installers.Add(myEventLogInstaller);
}
}
When you have your assembly compiled, you may use the InstallUtil tool available through the Visual Studio Command Prompt to run the installer code.
Regarding the message definition file (which includes category definitions), the MSDN documentation for EventLogInstaller.MessageResourceFile mentions that you should create an .mc file, compile it, and add it as a resource to your assembly. Digging around, I found an excellent post which should guide you to the end, here:
C# with .NET - Event Logging (Wayback Machine)