Search Results

Search found 8286 results on 332 pages for 'defined'.

Page 91/332 | < Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >

  • OperationContext.Current is null and all other contexts too

    - by HeavyWave
    I have a WCF service defined as following: [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(IncludeExceptionDetailInFaults = true, InstanceContextMode = InstanceContextMode.PerCall)] public partial class FrontEndService : IFrontEndService However, most of the time (but not always -_-) InstanceContext.Current is null, as well as HttpContext.Current and OperationContext.Current is also null. What am I missing? What I want to do is store some data in HttpContext.Current.Items or a similar collection that exists for the length of the request.

    Read the article

  • rake db:migrate gives a uninitialized class variable @@configuration in Rails error

    - by PK
    uninitialized class variable @@configuration in Rails /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:19:in `configuration' /usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl.rb:24 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' This is the initial part of the enviroment.rb: RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION require File.join(File.dirname(__FILE__), 'boot') Rails::Initializer.run do |config| config.gem "oauth", :version => "0.2.7", :lib => "oauth"

    Read the article

  • Why can't I use interface with explicit operator?

    - by theburningmonk
    Hi, I'm just wondering if anyone knows the reason why you are not allowed to use interfaces with the implicit or explicit operators? E.g. this raises compile time error: public static explicit operator MyPlayer(IPlayer player) { ... } "user-defined conversions to or from an interface are not allowed" Thanks,

    Read the article

  • What's a good library for parsing mathematical expressions in java?

    - by CSharperWithJava
    I'm an Android Developer and as part of my next app I will need to evaluate a large variety of user created mathematical expressions and equations. I am looking for a good java library that is lightweight and can evaluate mathematical expressions using user defined variables and constants, trig and exponential functions, etc. I've looked around and Jep seems to be popular, but I would like to hear more suggestions, especially from people who have used these libraries before.

    Read the article

  • Selenium IDE and custom confirm() function conflict

    - by sakhunzai
    I am using simple modal dialog by Eric Martin. And have defined a function e.g function confirm(message, options) {.... } To customize all confirm dialogs. Its working nicely accross all the browsers.Except when I enable Selenium IDE ,my custom confirm dialog function fails to capture "options" parameters and firefox console echos like this: options is undefined callback=options.callback; Error When Selenium IDE is visible Normal Behaviour When Selenium IDE is closed Please help me sort out this issue so I should able to run selenium tests.

    Read the article

  • How to open a nested child PreferenceScreen in Android.

    - by Mike
    Hello, I have a PreferenceScreen that is defined in XML that serves all the preferences for my application. This PreferenceScreen also has a child PreferenceScreen nested within it. My implementing class is called PreferencesActivity. I know I can open the main Preferences window via startActivity(new Intent(this, PreferencesActivity.class)); but how do I go about opening the child PreferenceScreen via an Intent?

    Read the article

  • Derivative of a Higher-Order Function

    - by Claudiu
    This is in the context of Automatic Differentiation - what would such a system do with a function like map, or filter - or even one of the SKI Combinators? Example: I have the following function: def func(x): return sum(map(lambda a: a**x, range(20))) What would its derivative be? What will an AD system yield as a result? (This function is well-defined on real-number inputs).

    Read the article

  • Embedding more text into the mail body in SMTP Gmail sender

    - by Rahul Varma
    Hi folks, I am using Gmail sender function defined here to send a mail to the predefined mail id. But my problem is that i want to embed more text into the body of my mail... The Gmail sender is only accepting one sting to be embedded into the body of the mail. Can anyone tell me how to embed more strings into the body of the mail... If Gmail sender is not efficient method to send a mail then please suggest me an alternative with an example....

    Read the article

  • Great Circle & Ray intersection

    - by Karl T
    I have a Latitude, Longitude, and a direction of travel in degrees true north. I would like to calculate if I will intersect a line defined by two more Lat/Lon points. I figure the two points defining the line would create my great circle and my location and azimuth would define my ray (or possibly a small circle). Any ideas?

    Read the article

  • Problems with deploying struts annotations in ear file

    - by Asif
    I am attempting to make use of the struts 2 annotations, what I have found is if I deploy the app as a war file everything works fine but if I deploy my war as part of an ear file none of the struts annotations work only the actions defined in struts.xml work. I can't seem to work out why deploying as a ear file annotations don't work. Has anyone else experienced this problem? I am using struts 2.1.8 and deploying to Jboss 5 thanks

    Read the article

  • How to restrict rightBarButtonItem size in UINavigationBar ?

    - by lefakir
    I create a rightBarButtonItem with this method : - (UIBarButtonItem *)customBarButtonWithSelector:(SEL)callback { UIButton *customButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; customButton.bounds = CGRectMake(0, 0, 30.0f, 30.0f); return [[[UIBarButtonItem alloc] initWithCustomView:customButton] autorelease]; } At execution time the selector is fired when the bar is touched outside the button (near the middle). Is there a way to restrict the event responder in the defined bounds or in a acceptable range ?

    Read the article

  • Searchable list of objects in Java

    - by Christian
    I want to create a large (~300,000 entries) List of self defined objects of the class Drug. Every Drug has an ID and I want to be able to search the Drugs in logarithmic time via that ID. What kind of List do I have to use? How do I declare that it should be searchable via the ID?

    Read the article

  • Looking for Java libraries to create a report editor

    - by Julian
    I have to develop a specialised report editor in Java. The user will get a number of fields that can be layed out on a page plus some graphical elements. The resulting report design needs to be serialized into already defined database tables. Is there any software library that will help to achieve this without reinventing the wheel? I have come across Eclipse GEF and Zest, but I am not sure if this really meets my problem.

    Read the article

  • The key must be an application-specific resource id.

    - by Pentium10
    Why do I get this Exception? 05-18 20:29:38.044: ERROR/AndroidRuntime(5453): java.lang.IllegalArgumentException: The key must be an application-specific resource id. 05-18 20:29:38.044: ERROR/AndroidRuntime(5453): at android.view.View.setTag(View.java:7704) 05-18 20:29:38.044: ERROR/AndroidRuntime(5453): at com.mypkg.viewP.inflateRow(viewP.java:518) the line in question is: ((Button) row.findViewById(R.id.btnPickContact)).setTag(TAG_ONLINE_ID,objContact.onlineid); and I have it defined as: private static final int TAG_ONLINE_ID = 1;

    Read the article

  • Javascript Associative Arrays

    - by John Hartsock
    Hello all, It seems to me that this should work but I cant see what exactly is the problem. The error Im receiving is "DDROA is not defined" Could anyone help enlighten me. var DDROA = { AllowedRoutes : { AR0 : {text : 'SomeText', value : 'SomeValue'}, AR1 : {text : 'SomeText2', value : 'SomeValue2'} }, RouteContext : { RC0 : {text : 'None', value : '0', AllowedRoutes : new Array( DDROA.AllowedRoutes.AR0 // An error occurs here ) } } }

    Read the article

  • Unstable DNS with bind

    - by yasser abd
    we have a Centos machine called jupiter, on which I have installed bind9, On every other machine the DNS is set to be the IP address of jupiter (192.168.2.101), as you can see in the output of the following command in windows >ipconfig /all Windows IP Configuration Host Name . . . . . . . . . . . . : mypcs Primary Dns Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Broadcom NetXtreme 57xx Gigabit Controller Physical Address. . . . . . . . . : 00-1A-A0-AC-E4-CC DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::c16d:3ae4:5907:30c4%8(Preferred) IPv4 Address. . . . . . . . . . . : 192.168.2.98(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Lease Obtained. . . . . . . . . . : Thursday, September 20, 2012 10:26:11 AM Lease Expires . . . . . . . . . . : Sunday, September 23, 2012 10:26:10 AM Default Gateway . . . . . . . . . : 192.168.2.1 DHCP Server . . . . . . . . . . . : 192.168.2.1 DHCPv6 IAID . . . . . . . . . . . : 201333408 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-16-3A-50-01-00-1A-A0-AC-E4-CC DNS Servers . . . . . . . . . . . : 192.168.2.101 192.168.2.1 192.168.2.1 NetBIOS over Tcpip. . . . . . . . : Enabled All machines can always nslookup one of the domain (mydomain.com) that is set in the jupiter's DNS server, you can see that in the output of nslookup on the same windows machine: >nslookup mydomain.com Server: UnKnown Address: 192.168.2.101 Name: mydomain.com Address: 192.168.2.100 The problem is, sometimes mydomain.com can not be pinged, here is the output of the ping on the same windows machine >ping mydomain.com Ping request could not find host mydomain.com. Please check the name and try again. This looks very random, and happens once in a while, so the machine can lookup the DNS records but can't ping it, nor can browse the website that is hosted on mydomain.com, which should resolve to 192.168.2.100 On a linux machine that has the same DNS settings, the output of dig command for mydomain is as follows: $ dig mydomain.com ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.2 <<>> mydomain.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36090 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1 ;; QUESTION SECTION: ;mydomain.com. IN A ;; ANSWER SECTION: mydomain.com. 86400 IN A 192.168.2.100 ;; AUTHORITY SECTION: mydomain.com. 86400 IN NS jupiter. ;; ADDITIONAL SECTION: jupiter. 86400 IN A 192.168.2.101 ;; Query time: 1 msec ;; SERVER: 192.168.2.101#53(192.168.2.101) ;; WHEN: Thu Sep 20 16:32:14 2012 ;; MSG SIZE rcvd: 83 We've never had the same problem on MACs, they always resolve mydomain.com Here is how I have defined mydomain.com on Bind9's configs on Jupiter, notice that the name of the machine on 192.168.2.100 is venus, so I have this file: /var/named/named.venus: $TTL 1D @ IN SOA jupiter. admin.ourcompany.com. ( 2003052800 ; serial 86400 ; refresh 300 ; retry 604800 ; expire 3600 ; minimum ) @ IN NS jupiter. @ IN A 192.168.2.100 * IN A 192.168.2.100 /var/named/zones/named.venus.zone zone "mydomain.com" IN {type master;file "/var/named/named.venus";allow-update {none;};}; One thing to note is that I haven't defined reverse DNS lookups, only the forward DNS lookups are defined in Bind9 configs, not sure if that's relevant or not. So my question is, why is this being so unstable? what could be the cause?

    Read the article

  • ObjectDataSource typename of a singleton Business object

    - by luppi
    My singleton business object is defined in Global: public class Global : HttpApplication { public static BusinessForm BusinessFormLayer; void Application_Start(object sender, EventArgs e) { FormDalProvider concreteProvider = FormDalProvider.Instance; BusinessForumLayer = new BusinessForum(concreteProvider); } } My page: <asp:ObjectDataSource ID="objThreads" runat="server" SelectMethod="GetForms" SelectCountMethod="GetFormsCount" TypeName="Global.BusinessFormLayer" EnablePaging="true" SortParameterName="sortExpression">

    Read the article

  • ForeignKey django 1.1.1 model

    - by Spikie
    i have class staff_name(models.Model): firstname = models.CharField(max_length=150) surname = models.CharField(max_length=150) class inventory_transaction(models.Model): staffs = models.ForeignKey(staff_name) i want to get or create staff surname and first name through inventory_transaction i used these code below inventory_transaction.objects.get_or_create(staffs_surname_contains=sname,staffs_firstname_contains=fname) i got this error "staffs_surname_contains can not be defined" what have i done wrong ? thanks

    Read the article

  • Using Jquery.Form Plugin + MultiFile to automatically upload a single file

    - by Alan Neal
    I wanted to find a way to upload a single file*, in the background, have it start automatically after file selection, and not require a flash uploader, so I am trying to use two great mechanisms (jQuery.Form and JQuery MultiFile) together. I haven't succeeded, but I'm pretty sure it's because I'm missing something fundamental. Just using MultiFile, I define the form as follows... <form id="photoForm" action="image.php" method="post" enctype="multipart/form-data"> The file input button is defined as... <input id="photoButton" "name="sourceFile" class="photoButton max-1 accept-jpg" type="file"> And the Javascript is... $('#photoButton').MultiFile({ afterFileSelect: function(){ document.getElementById("photoForm").submit(); } }); This works perfectly. As soon as the user selects a single file, MultiFile submits the form to the server. If instead of using MultiFile, as shown above, let's say I include a Submit button along with the JQuery Form plugin defined as follows... var options = { success: respondToUpload }; $('#photoForm').ajaxForm(options); ... this also works perfectly. When the Submit button is clicked, the form is uploaded in the background. What I don't know how to do is get these two to work together. If I use Javascript to submit the form (as shown in the MultiFile example above), the form is submitted but the JQuery.Form function is not called, so the form does not get submitted in the background. I thought that maybe I needed to change the form registration as follows... $('#photoForm').submit(function() { $('#photoForm').ajaxForm(options); }); ...but that didn't solve the problem. The same is true when I tried .ajaxSubmit instead of .ajaxForm. What am I missing? BTW: I know it might sound strange to use MultiFile for single-file uploads, but the idea is that the number of files will be dynamic based on the user's account. So, I'm starting with one but the number changes depending on conditions.

    Read the article

  • Why are my resources suddenly unresolved in my Android project?

    - by Eno
    Eclipse is complaining about my Android project saying all my references to resources are unresolved, even though R.java does exist. For example: signin_btn=(Button)findViewById(R.id.signin_btn); signin_btn.setOnClickListener(this); I definately have signin_btn defined in my resources. Dont know why Eclipse is not seeing my R class anymore. How to fix?

    Read the article

  • Entering and retrieving data from SQLite for an android List View

    - by Infiniti Fizz
    Hi all, I started learning android development a few weeks ago and have gone through the developer.android.com tutorials etc. But now I have a problem. I'm trying to create an app which tracks the usage of each installed app. Therefore I'm pulling the names of all installed apps using the PackageManager and then trying to put them into an SQLite database table. I am using the Notepad Tutorial SQLite implementation but I'm running into some problems that I have tried for days to solve. I have 2 classes, the DBHelper class and the actual ListActivity class. For some reason the app force closes when I try and run my fillDatabase() function which gets all the app names from the PackageManager and tries to put them into the database: private void fillDatabase() { PackageManager manager = this.getPackageManager(); List<ApplicationInfo> appList = manager.getInstalledApplications(0); for(int i = 0; i < appList.size(); i++) { mDbHelper.addApp(manager.getApplicationLabel(appList.get(i)).toString(), 0); } } addApp() is a function defined in my AppsDbHelper class and looks as follows: public long createApp(String name, int usage) { ContentValues initialValues = new ContentValues(); initialValues.put(KEY_NAME, name); initialValues.put(KEY_USAGE, usage); return mDb.insert(DATABASE_TABLE, null, initialValues); } The database create is defined as follows: private static final String DATABASE_CREATE = "create table notes (_id integer primary key autoincrement, " + "title text not null, usage integer not null);"; I have commented out all statements that follow fillDatabase(); in the onCreate() method of the ListActivity and so know that it is definetely the problem but I don't know why. I am taking the appName and putting it into the KEY_NAME field of the row and putting 0 into the KEY_USAGE field of the row (because initially, my app will default the usage of each app to 0 (not used yet)). If my addApp() function doesn't take the usage and just puts KEY_NAME into the ContentValues and into the database, it seems to work fine, but I want a column for usage. Any ideas why it is not working? Have I overlooked something? Thanks for your time, InfinitiFizz

    Read the article

  • C#.Net Calling a C++ DLL

    - by hayer
    Hi I got a DLL(without the sourcecode) which exports like this: ?ReceiveCoreDataPtr@@YAXPAX@Z ?xenoAddRigidBodyAngularImpulse@@YAXHMMM@Z ?xenoAddRigidBodyForce@@YAXHMMM@Z ?xenoAddRigidBodyForce@@YAXHMMMMMM@Z ?xenoAddRigidBodyLinearImpulse@@YAXHMMM@Z ?xenoAddRigidBodyPointImpulse@@YAXHMMMMMM@Z ?xenoAddRigidBodyTorque@@YAXHMMM@Z ?xenoCharacterControllerCrouch@@YAXH@Z ?xenoCharacterControllerJump@@YAXH@Z ?xenoCharacterDisable@@YAXH@Z ?xenoCharacterEnable@@YAXH@Z ?xenoDeleteRigidBody@@YAXH@Z ?xenoEnd@@YAXXZ ?xenoGetCameraFOV@@YAKH@Z ?xenoGetCameraPointX@@YAKH@Z ?xenoGetCameraPointY@@YAKH@Z ?xenoGetCameraPointZ@@YAKH@Z ?xenoGetCameraPositionX@@YAKH@Z ?xenoGetCameraPositionY@@YAKH@Z ?xenoGetCameraPositionZ@@YAKH@Z ?xenoGetCharacterControllerHeadPosition@@YAKH@Z ?xenoGetCharacterControllerPositionX@@YAKH@Z ?xenoGetCharacterControllerPositionY@@YAKH@Z ?xenoGetCharacterControllerPositionZ@@YAKH@Z ?xenoGetCharacterControllerRotation@@YAKH@Z ?xenoGetRigidBodyAllowedPenetrationDepth@@YAKH@Z ?xenoGetRigidBodyAngularDamping@@YAKH@Z ?xenoGetRigidBodyAngularVelocityX@@YAKH@Z ?xenoGetRigidBodyAngularVelocityY@@YAKH@Z ?xenoGetRigidBodyAngularVelocityZ@@YAKH@Z ?xenoGetRigidBodyFriction@@YAKH@Z ?xenoGetRigidBodyGravityFactor@@YAKH@Z ?xenoGetRigidBodyLinearDamping@@YAKH@Z ?xenoGetRigidBodyLinearVelocityX@@YAKH@Z ?xenoGetRigidBodyLinearVelocityY@@YAKH@Z ?xenoGetRigidBodyLinearVelocityZ@@YAKH@Z ?xenoGetRigidBodyMass@@YAKH@Z ?xenoGetRigidBodyMaxAngularVelocity@@YAKH@Z ?xenoGetRigidBodyMaxLinearVelocity@@YAKH@Z ?xenoGetRigidBodyPointVelocityX@@YAKHMMM@Z ?xenoGetRigidBodyPointVelocityY@@YAKHMMM@Z ?xenoGetRigidBodyPointVelocityZ@@YAKHMMM@Z ?xenoGetRigidBodyRestitution@@YAKH@Z ?xenoIsRigidBodyALadder@@YAHH@Z ?xenoMakeCamera@@YAXHH@Z ?xenoMakeCharacterController@@YAXHMM@Z ?xenoMakeCharacterController@@YAXHMMM@Z ?xenoMakeCharacterController@@YAXHMMMM@Z ?xenoMakeCharacterController@@YAXHMMMMM@Z ?xenoMakeCharacterController@@YAXHMMMMMM@Z ?xenoMakeCharacterController@@YAXHMMMMMMM@Z ?xenoMakeRigidBodyDynamicBox@@YAXH@Z ?xenoMakeRigidBodyDynamicBox@@YAXHM@Z ?xenoMakeRigidBodyDynamicCapsule@@YAXH@Z ?xenoMakeRigidBodyDynamicCapsule@@YAXHM@Z ?xenoMakeRigidBodyDynamicCylinder@@YAXH@Z ?xenoMakeRigidBodyDynamicCylinder@@YAXHM@Z ?xenoMakeRigidBodyDynamicSphere@@YAXH@Z ?xenoMakeRigidBodyDynamicSphere@@YAXHM@Z ?xenoMakeRigidBodyStaticBox@@YAXH@Z ?xenoMakeRigidBodyStaticCapsule@@YAXH@Z ?xenoMakeRigidBodyStaticCylinder@@YAXH@Z ?xenoMakeRigidBodyStaticSphere@@YAXH@Z ?xenoMakeRigidBodyStaticTriangleMesh@@YAXH@Z ?xenoMakeVehicle@@YAXHH@Z ?xenoMoveCharacterControllerBackward@@YAXH@Z ?xenoMoveCharacterControllerForward@@YAXH@Z ?xenoMoveCharacterControllerLeft@@YAXH@Z ?xenoMoveCharacterControllerRight@@YAXH@Z ?xenoSetCharacterControllerPosition@@YAXHMMM@Z ?xenoSetCharacterControllerRotation@@YAXHM@Z ?xenoSetGravity@@YAXM@Z ?xenoSetGravity@@YAXMMM@Z ?xenoSetRigidBodyAllowedPenetrationDepth@@YAXHM@Z ?xenoSetRigidBodyAngularDamping@@YAXHM@Z ?xenoSetRigidBodyAngularVelocity@@YAXHMMM@Z ?xenoSetRigidBodyAsLadder@@YAXHH@Z ?xenoSetRigidBodyFriction@@YAXHM@Z ?xenoSetRigidBodyGravityFactor@@YAXHM@Z ?xenoSetRigidBodyLinearDamping@@YAXHM@Z ?xenoSetRigidBodyLinearVelocity@@YAXHMMM@Z ?xenoSetRigidBodyMass@@YAXHM@Z ?xenoSetRigidBodyMaxAngularVelocity@@YAXHM@Z ?xenoSetRigidBodyMaxLinearVelocity@@YAXHM@Z ?xenoSetRigidBodyPosition@@YAXHMMM@Z ?xenoSetRigidBodyRestitution@@YAXHM@Z ?xenoSetRigidBodyRotation@@YAXHMMM@Z ?xenoSetTimeStep@@YAXM@Z ?xenoStart@@YAXH@Z ?xenoStart@@YAXHM@Z ?xenoStart@@YAXHMH@Z ?xenoStart@@YAXXZ ?xenoUpdate@@YAXXZ ?xenoVehicleAccelerate@@YAXHM@Z ?xenoVehicleHandbrake@@YAXH@Z ?xenoVehicleReverse@@YAXH@Z ?xenoVehicleTurn@@YAXHM@Z When I try to use it in another C++ App like this #include <windows.h> class XenoPhysics { private: typedef void (*FunctionFunc)(void); typedef void (*FunctionFuncFloat)(float); typedef void (*FunctionFuncInt)(int); typedef void (*FunctionIntFloatFloatFloat)(int,float,float,float); HMODULE libInstance; public: void LoadLib() { this->libInstance = LoadLibrary(L"F:\\xenophysics.dll"); } void UnloadLib() { FreeLibrary(libInstance); } void xStart() { FunctionFunc curFunc; curFunc = (FunctionFunc)GetProcAddress(this->libInstance, "?xenoStart@@YAXXZ"); curFunc(); } void xEnd() { FunctionFunc curFunc; curFunc = (FunctionFunc)GetProcAddress(libInstance, "xenoEnd"); curFunc(); } void xUpdate() { FunctionFunc curFunc; curFunc = (FunctionFunc)GetProcAddress(libInstance, "xenoUpdate"); curFunc(); } void xMakeRigidBodyStaticBox(int objid) { FunctionFuncInt curFunc; curFunc = (FunctionFuncInt)GetProcAddress(libInstance, "xenoMakeRigidBodyStaticBox"); curFunc(objid); } void xMakeRigidBodyDynamicBox(int objid) { FunctionFuncInt curFunc; curFunc = (FunctionFuncInt)GetProcAddress(libInstance, "xenoMakeRigidBodyDynamicBox"); curFunc(objid); } void xSetRigidBodyPosition(int objid, float x, float y, float z) { FunctionIntFloatFloatFloat curFunc; curFunc = (FunctionIntFloatFloatFloat)GetProcAddress(libInstance, "xenoSetRigidBodyPosition"); curFunc(objid, x, y, z); } void xSetGravity(float grav) { FunctionFuncFloat curFunc; curFunc = (FunctionFuncFloat)GetProcAddress(libInstance, "xenoSetGravity"); curFunc(grav); } }; This is the "wrapper"(or whatever you would call it) class.. To call the functions I'm doing XenoPhysics * d = new XenoPhysics(); d->LoadLib(); d->xStart(); It then throws the following error at me(Note that it passes the LoadLib() without any errors) Unhandled exception at 0x50261bc9 in Xeno Test.exe: 0xC0000005: Access violation reading location 0x00000064. And yes; I've checked that the "curFunc" gets the address, not just a NULL pointer(atleast I think I've checked that).. Anyone who can help out? Edit: Forgot the C#.Net code, how stupid of me :3 Here is the C++ CLR DLL "wrapper" I tried to make: #include <windows.h> // The following ifdef block is the standard way of creating macros which make exporting // from a DLL simpler. All files within this DLL are compiled with the XENOWRAPPERWIN32_EXPORTS // symbol defined on the command line. this symbol should not be defined on any project // that uses this DLL. This way any other project whose source files include this file see // XENOWRAPPERWIN32_API functions as being imported from a DLL, whereas this DLL sees symbols // defined with this macro as being exported. #ifdef XENOWRAPPERWIN32_EXPORTS #define XENOWRAPPERWIN32_API __declspec(dllexport) #else #define XENOWRAPPERWIN32_API __declspec(dllimport) #endif typedef void (*FunctionFunc)(); typedef void (*FunctionFuncFloat)(float); typedef void (*FunctionFuncInt)(int); typedef void (*FunctionIntFloatFloatFloat)(int,float,float,float); // This class is exported from the xeno wrapper win32.dll class XENOWRAPPERWIN32_API Cxenowrapperwin32 { public: Cxenowrapperwin32(void); HINSTANCE libInstance; // FunctionFunc curFunc; // Library base functions void LoadLib() { libInstance = LoadLibrary(L"F:\\xenophysics.dll"); } void UnloadLib() { FreeLibrary(libInstance); } // Function calls to the xeno physics void xStart() { FunctionFunc curFunc; curFunc = (FunctionFunc)GetProcAddress(libInstance, "?xenoStart@@YAXXZ"); curFunc(); } void xEnd() { FunctionFunc curFunc; curFunc = (FunctionFunc)GetProcAddress(libInstance, "?xenoEnd@@YAXXZ"); curFunc(); } void xUpdate() { FunctionFunc curFunc; curFunc = (FunctionFunc)GetProcAddress(libInstance, "?xenoUpdate@@YAXXZ"); curFunc(); } void xMakeRigidBodyStaticBox(int objid) { FunctionFuncInt curFunc; curFunc = (FunctionFuncInt)GetProcAddress(libInstance, "?xenoMakeRigidBodyStaticBox@@YAXH@Z"); curFunc(objid); } void xMakeRigidBodyDynamicBox(int objid) { FunctionFuncInt curFunc; curFunc = (FunctionFuncInt)GetProcAddress(libInstance, "?xenoMakeRigidBodyDynamicBox@@YAXH@Z"); curFunc(objid); } void xSetRigidBodyPosition(int objid, float x, float y, float z) { FunctionIntFloatFloatFloat curFunc; curFunc = (FunctionIntFloatFloatFloat)GetProcAddress(libInstance, "?xenoSetRigidBodyPosition@@YAXHMMM@Z"); curFunc(objid, x, y, z); } void xSetGravity(float grav) { FunctionFuncFloat curFunc; curFunc = (FunctionFuncFloat)GetProcAddress(libInstance, "?xenoSetGravity@@YAXM@Z"); curFunc(grav); } }; extern XENOWRAPPERWIN32_API int nxenowrapperwin32; XENOWRAPPERWIN32_API int fnxenowrapperwin32(void); and here is how I use it in C#.Net class xeno { [DllImport("C:\\Users\\hayer\\Documents\\Visual Studio 2008\\Projects\\xeno wrapper win32\\Debug\\xeno wrapper win32.dll", EntryPoint = "?LoadLib@Cxenowrapperwin32@@QAEXXZ")] public static extern void xLoadLib(); public void LoadLib() { xLoadLib(); } [DllImport("C:\\Users\\hayer\\Documents\\Visual Studio 2008\\Projects\\xeno wrapper win32\\Debug\\xeno wrapper win32.dll", EntryPoint = "?UnloadLib@Cxenowrapperwin32@@QAEXXZ")] public static extern void xUnloadLib(); public void UnloadLib() { xUnloadLib(); } [DllImport("C:\\Users\\hayer\\Documents\\Visual Studio 2008\\Projects\\xeno wrapper win32\\Debug\\xeno wrapper win32.dll", EntryPoint = "?xStart@Cxenowrapperwin32@@QAEXXZ")] public static extern void xStart(); public void Start() { xStart(); } [DllImport("C:\\Users\\hayer\\Documents\\Visual Studio 2008\\Projects\\xeno wrapper win32\\Debug\\xeno wrapper win32.dll", EntryPoint = "?xUpdate@Cxenowrapperwin32@@QAEXXZ")] public static extern void xUpdate(); public void Update() { xUpdate(); } [DllImport("C:\\Users\\hayer\\Documents\\Visual Studio 2008\\Projects\\xeno wrapper win32\\Debug\\xeno wrapper win32.dll", EntryPoint = "?xEnd@Cxenowrapperwin32@@QAEXXZ")] public static extern void xEnd(); public void End() { xEnd(); } [DllImport("C:\\Users\\hayer\\Documents\\Visual Studio 2008\\Projects\\xeno wrapper win32\\Debug\\xeno wrapper win32.dll", EntryPoint = "?xMakeRigidBodyDynamicBox@Cxenowrapperwin32@@QAEXH@Z")] public static extern void xMakeRigidBodyDynamicBox(int objid); public void MakeRigidBodyDynamicBox(int id) { xMakeRigidBodyDynamicBox(id); } [DllImport("C:\\Users\\hayer\\Documents\\Visual Studio 2008\\Projects\\xeno wrapper win32\\Debug\\xeno wrapper win32.dll", EntryPoint = "?xMakeRigidBodyStaticBox@Cxenowrapperwin32@@QAEXH@Z")] public static extern void xMakeRigidBodyStaticBox(int objid); public void MakeRigidBodyStaticBox(int id) { xMakeRigidBodyStaticBox(id); } [DllImport("C:\\Users\\hayer\\Documents\\Visual Studio 2008\\Projects\\xeno wrapper win32\\Debug\\xeno wrapper win32.dll", EntryPoint = "?xSetGravity@Cxenowrapperwin32@@QAEXM@Z")] public static extern void xSetGravity(float grav); public void SetGravity(float g) { xSetGravity(g); } [DllImport("C:\\Users\\hayer\\Documents\\Visual Studio 2008\\Projects\\xeno wrapper win32\\Debug\\xeno wrapper win32.dll", EntryPoint = "?xSetRigidBodyPosition@Cxenowrapperwin32@@QAEXHMMM@Z")] public static extern void xSetRigidBodyPosition(int obj, float x, float y, float z); public void SetRigidBodyPosition(int id, float q, float w, float e) { xSetRigidBodyPosition(id, q, w, e); } } And in the main C#.Net program I do xeno tx = new xeno(); tx.Start(); tx.SetGravity(-1); tx.MakeRigidBodyStaticBox(ground.Id); tx.MakeRigidBodyDynamicBox(cube.Id); tx.SetRigidBodyPosition(cube.Id, 0, 50, 0);

    Read the article

  • RCP applicatoon activities

    - by Peter
    I have a problem with my RCP application. First, I defined an activity in my plugin.xml: <extension point="org.eclipse.ui.activities"> <activity id="myproject.view.input.activity" name="myproject.view.input.activity"> <enabledWhen> <with variable="myproject.view.input.active"> <equals value="ENABLED"> </equals> </with> </enabledWhen> </activity> <activityPatternBinding activityId="myproject.view.input.activity" pattern="myproject.gui/myproject.view.input"> </activityPatternBinding> Then i defined my SourceProvider: <extension point="org.eclipse.ui.services"> <sourceProvider provider="myproject.util.CommandState"> <variable name="myproject.view.input.active" priorityLevel="workbench"> </variable> And, finally, my CommandState class: public class CommandState extends AbstractSourceProvider { public final static String OUTPUT_VIEW = "myproject.view.input.active"; // then goes some others variables, i just skip them // .... public final static String [] ACTIONS = {OUTPUT_VIEW /*and all others variables*/}; public final static String ENABLED = "ENABLED"; public final static String DISENABLED = "DISENABLED"; private final Map <String, String> currentState = new HashMap <String, String> (); @Override public void dispose() { } @Override public String[] getProvidedSourceNames() { return ACTIONS; } @Override public Map <String, String> getCurrentState() { return currentState; } public void setEnabled(boolean enabled, String [] commands) { String value = enabled ? ENABLED : DISENABLED; for (String command : commands) { currentState.put(command, value); fireSourceChanged(ISources.WORKBENCH, command, value); } } } In my Login window, application checks user permissions, and enable or disable views, commands, etc. with setEnabled method of CommandState. For commands it works fine, they are enabling or disabling correctly. But when i try to disable view and open perspective, that contains that view (myproject.view.input), it opened without that view, but also throws exception: !STACK 1 org.eclipse.ui.PartInitException: Could not create view: myproject.view.input at org.eclipse.ui.internal.ViewFactory.createView(ViewFactory.java:158) I can show full stacktrace if anyone want. I tried to debug my application and before i open my perspective whith that view, i checked currentState of my CommandState source provider, and all seemes to be ok: all variables values are correct and myproject.view.input.active = DISABLED Can anyone say, why exception is thrown? Thanks for any help. Sorry for big post and bad language

    Read the article

< Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >