Search Results

Search found 632 results on 26 pages for 'imports'.

Page 10/26 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How to specify dll onload function for mingw32?

    - by aking1012
    I can compile DLLs properly using mingw and do the exports/imports stuff. What I am looking for is defining the dll onload function properly as you would in MS VC products. Google didn't turn up anything. Anyone have any ideas or a link to a tutorial? It was suggested that this code snippet be added to the question: extern "C" DLL_EXPORT BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD Reason, LPVOID LPV) And yes, this is what I am trying to do, but with mingw.

    Read the article

  • Are Objective-C initializers allowed to share the same name?

    - by NattKatt
    I'm running into an odd issue in Objective-C when I have two classes using initializers of the same name, but differently-typed arguments. For example, let's say I create classes A and B: A.h: #import <Cocoa/Cocoa.h> @interface A : NSObject { } - (id)initWithNum:(float)theNum; @end A.m: #import "A.h" @implementation A - (id)initWithNum:(float)theNum { self = [super init]; if (self != nil) { NSLog(@"A: %f", theNum); } return self; } @end B.h: #import <Cocoa/Cocoa.h> @interface B : NSObject { } - (id)initWithNum:(int)theNum; @end B.m: #import "B.h" @implementation B - (id)initWithNum:(int)theNum { self = [super init]; if (self != nil) { NSLog(@"B: %d", theNum); } return self; } @end main.m: #import <Foundation/Foundation.h> #import "A.h" #import "B.h" int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; A *a = [[A alloc] initWithNum:20.0f]; B *b = [[B alloc] initWithNum:10]; [a release]; [b release]; [pool drain]; return 0; } When I run this, I get the following output: 2010-04-26 20:44:06.820 FnTest[14617:a0f] A: 20.000000 2010-04-26 20:44:06.823 FnTest[14617:a0f] B: 1 If I reverse the order of the imports so it imports B.h first, I get: 2010-04-26 20:45:03.034 FnTest[14635:a0f] A: 0.000000 2010-04-26 20:45:03.038 FnTest[14635:a0f] B: 10 For some reason, it seems like it's using the data type defined in whichever @interface gets included first for both classes. I did some stepping through the debugger and found that the isa pointer for both a and b objects ends up the same. I also found out that if I no longer make the alloc and init calls inline, both initializations seem to work properly, e.g.: A *a = [A alloc]; [a initWithNum:20.0f]; If I use this convention when I create both a and b, I get the right output and the isa pointers seem to be different for each object. Am I doing something wrong? I would have thought multiple classes could have the same initializer names, but perhaps that is not the case.

    Read the article

  • Need help helping in converting jquery, ajax, json and asp.net

    - by Haja Mohaideen
    I am tying out this tutorial, http://www.ezzylearning.com/tutorial.aspx?tid=5869127. It works perfectly. What I am now trying to do is to host the aspx contents as html file. This html file is hosted on my wampserver which is on my laptop. The asp.net code hosted on my test server. When I try to access, I get the following error, Resource interpreted as Script but transferred with MIME type text/html: "http://201.x.x.x/testAjax/Default.aspx/AddProductToCart?callback=jQuery17103264484549872577_1346923699990&{%20pID:%20%226765%22,%20qty:%20%22100%22,%20lblType:%20%2220%22%20}&_=1346923704482". jquery.min.js:4 Uncaught SyntaxError: Unexpected token < I am not sure how to solve this problem. index.html code $(function () { $('#btnAddToCart').click(function () { var result = $.ajax({ type: "POST", url: "http://202.161.45.124/testAjax/Default.aspx/AddProductToCart", crossDomain: true, data: '{ pID: "6765", qty: "100", lblType: "20" }', contentType: "application/json; charset=utf-8", dataType: "jsonp", success: succeeded, failure: function (msg) { alert(msg); }, error: function (xhr, err) { alert(err); } }); }); }); function succeeded(msg) { alert(msg.d); } function btnAddToCart_onclick() { } </script> </head> <body> <form name="form1" method="post"> <div> <input type="button" id="btnAddToCart" onclick="return btnAddToCart_onclick()" value="Button" /> </div> </form> aspx.vb Imports System.Web.Services Imports System.Web.Script.Services <ScriptService()> Public Class WebForm1 Inherits Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Session("test") = "" End Sub <WebMethod()> <ScriptMethod(UseHttpGet:=False, ResponseFormat:=ResponseFormat.Json)> Public Shared Function AddProductToCart(pID As String, qty As String, lblType As String) As String Dim selectedProduct As String = String.Format("+ {0} - {1} - {2}", pID, qty, lblType) HttpContext.Current.Session("test") += selectedProduct Return HttpContext.Current.Session("test").ToString() End Function End Class

    Read the article

  • Formatting a CSV File that contains HTML for Import to Excel

    - by Dave
    I would like to export a CSV file from my application for importing into Excel (or any other spreadsheet that supports CSV files). Anyhow, one of the cells in my table have rich content (i.e. HTML) which can, of course, contain commas as well as other HTML characters and formatting. I realize that Excel "can" handle HTML formatted text, but exporting it as CSV tends to screw up the data for importing. Is there some particular way I can format that particular cell so that imports correctly?

    Read the article

  • Java converting to Jython-Getting a class object within itself

    - by Bggreen
    I am attempting to convert Java code to Jython and am using the apache Log and LogFactory imports. I am attempting to emulate Foo.class in Jython The chunk of code is as follows: in Java import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public class MyClass { private static final Log log = LogFactory.getLog(MyClass.class); public MyClass(Document dom) { //code } How can I emulate this same behavior of MyClass.class in Jython/Python?

    Read the article

  • Importing data from file to array

    - by stamp
    I have 2 dimensional table in file, which look like this: 11, 12, 13, 14, 15 21, 22, 23, 24, 25 I want it to be imported in 2 dimensional array. I wrote this code: INTEGER :: SMALL(10) DO I = 1, 3 READ(UNIT=10, FMT='(5I4)') SMALL WRITE(UNIT=*, FMT='(6X,5I4)') SMALL ENDDO But it imports everything in one dimensional array.

    Read the article

  • How to import a package from Eclipse?

    - by Roman
    In one of my directories I have all .java files which belong to one package ("game"). Now I want to create one .java file which does not belong to this package and which imports the "game" package. If I create a new file and write import game; then Eclipse complains that it does not know what the "game" package means. Can somebody please help me to solve this problem?

    Read the article

  • How to install ASP.NET MVC 2 templates after already installing VS Web Dev 2010 first?

    - by Lucas McCoy
    First off these questions are related but do not fix my problem: http://stackoverflow.com/questions/2499934/ http://stackoverflow.com/questions/652836/ I have installed Visual Studio Web Developer Express Edition 2010, then I installed MVC 2. Now I can successfully run a MVC 2 application, however I have to do the manual imports of the namespaces and stuff. How can I install the templates?

    Read the article

  • objective c import once

    - by joels
    I have a header file with a bunch on statics like static NSString * SOME_NAME = @"someMeaning"; What is the best way to import this? Should I define them some other way? I tried just using the #import statement but any file that imports it gives me a warning saying SOME_NAME defined but not used...

    Read the article

  • Faster way to dump mysql

    - by japancheese
    This may be a dumb question, but I was just watching a screencast on MySQL replication, and I learned that a master database doesn't send SQL over to a slave for replication, it actually sends data over in binary, which makes importing extremely fast. I started wondering, "if a database can export and import binary, why do mysqldumps / imports take so long?" Is there a way to get mysql to dump a database in binary in a similar fashion to speed up that process as well?

    Read the article

  • vb.net how to start a folder monitor service at runtime and pass on the folder path to monitor?

    - by mazrabul
    hi, I have the following windows service file: Imports System.ServiceProcess Imports System.IO Public Class fswService Dim fsw As FileSystemWatcher Dim lf As StreamWriter Protected Overrides Sub OnStart(ByVal args As String()) ' Add code here to start your service. This method should set things ' in motion so your service can do its work. lf = New StreamWriter(Application.StartupPath & "\fsw_lg.log") fsw = New FileSystemWatcher() fsw.Path = args(0) fsw.IncludeSubdirectories = True fsw.Filter = ".txt" fsw.EnableRaisingEvents = True AddHandler fsw.Created, New FileSystemEventHandler(AddressOf file_created) AddHandler fsw.Changed, New FileSystemEventHandler(AddressOf file_changed) AddHandler fsw.Deleted, New FileSystemEventHandler(AddressOf file_deleted) End Sub Public Sub file_created(ByVal obj As Object, ByVal e As FileSystemEventArgs) lf.WriteLine(Now.ToShortDateString & "-" & Now.ToShortTimeString & "-" & e.FullPath & "-created") End Sub Public Sub file_changed(ByVal obj As Object, ByVal e As FileSystemEventArgs) lf.WriteLine(Now.ToShortDateString & "-" & Now.ToShortTimeString & "-" & e.FullPath & "-changed") End Sub Public Sub file_deleted(ByVal obj As Object, ByVal e As FileSystemEventArgs) lf.WriteLine(Now.ToShortDateString & "-" & Now.ToShortTimeString & "-" & e.FullPath & "-deleted") End Sub Protected Overrides Sub OnStop() lf.Close() End Sub End Class i have the ServiceName set to fswService (same as class name). When I added an installer I also set the ServiceName for the ServiceInstaller1 as fswService. I want to start this service at runtime based on the user setting the path of the folder to be watched. To achieve this I have the following: Dim fsw_controller As New ServiceProcess.ServiceController fsw_controller.Start(fswService) 2 problems: first, intellisense error saying: 'fswService' is a type and cannot be used as an expression. second, I can not figure out a way to pass on to the service the path of the folder to watch (which is stored at My.Settings.userPath). I really thought this is how you start a service. Am I missing something? Your help is, as always, appreciated. Thanks

    Read the article

  • What is the XML spec for importing into Microsoft Project?

    - by montek
    From our existing, internal tracking system I would like to create an XML export that I can then bring into Microsoft Project 2007 to further display and manipulation. I've been unable to find a straightforward explanation of how the XML should look for this kind of import. I want to be able to create dependencies, assign resources, etc. The Excel/CSV imports don't appear to offer all these capabilities so I think XML is the better way...if I could just get a spec for it.

    Read the article

  • Python-mode import problem

    - by smith
    I'm trying to use Emacs as a python editor and it works fine when I evaluate(C-c C-c) only single files but when I evaluate a file that imports another file in the same directory, I get an error saying that the file could not be imported. Does anyone know of a workaround? Thanks in advance

    Read the article

  • VB.NET FileSystemWatcher Multiple Change Events

    - by John
    Hi. I have the following code: Imports System.IO Public Class Blah Public Sub New() InitializeComponent() Dim watcher As New FileSystemWatcher("C:\") watcher.EnableRaisingEvents = True AddHandler watcher.Changed, AddressOf watcher_Changed End Sub Private Sub watcher_Changed(ByVal sender As Object, ByVal e As FileSystemEventArgs) MsgBox(e.FullPath) End Sub End Class When I run it and save changes to a file on my C drive, the code works great, except it executes the watcher_Changed() method four times. Any idea why? The changeType is "4" every time. Thanks.

    Read the article

  • Command Not working in separate thread in J2me.

    - by RishiPatel
    I am creating a bluetooth application. I created a simple midlet with a exit command and i create a thread for finding the service and discovering the device. While doing so it displays a animated screen on which i added the parent commandListener for exit command. After successful connection both user is represented with greetings(Current screen calls the parent Display method setCurrent for displaying itself). This screen also have CommandListener set to the parent. Now i want to add few more commands. I Implemented the CommandLIstener Interface in this class, added few commands but the commands are not working. I dont whats wen wrong. I am giving u Code snippets to fully describle my issue : - package name Imports here public class MyMidlet extends MIDlet implements CommandListener { public CommandListener theListener; public Display theDisplay; public Command exitCommand; public MyMidlet() { // Retrieve the display for this MIDlet //Create the initial screen } public void startApp() throws MIDletStateChangeException { } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void commandAction(Command c, Displayable d) { // Determine if the exit command was selected if (c == exitCommand) { //End application here notifyDestroyed(); } else { //Start the new thread here } } } Now here is the code for the class which is invoked by the above midlet in a separate thread; package here; imports here public class MyService implements Runnable, CommandListener { private MyMidlet parent; private StreamConnection conn; private OutputStream output; private InputStream input; public Command sendCommand; private TextField messageToSend Form form; public BChatService(boolean isServer, BChatMidlet parent) { //some stuff here this.parent = parent; } public void run() { //functino for showing animation here try { input = conn.openInputStream(); output = conn.openOutputStream(); } catch (IOException e) { displayError("IO Error", "An error occurred while opening " + "the input and output streams" + "(IOException: " + e.getMessage() + ")"); try { conn.close(); } catch (Exception ex) { } return; } // Create the Form here when service is discoverd and greets the users Command sendCommand = new Command("Send", Command.ITEM, 2); exitCommand = new Command("Exit", Command.EXIT, 1); form.addCommand(exitCommand); form.addCommand(sendCommand); parent.theDisplay.setCurrent(form); form.setCommandListener(this); public void commandAction(Command c, Displayable d) { if (c == exitCommand) { // End the game parent.destroyApp(true); parent.notifyDestroyed(); } if(c == sendCommand) { form.append("SOme text here"); } } } When i select the Send command, the string doesnt append in form neither exit command works. What can be the possible cause for it?? I need to implement this functionality...Is there any other way to achieve this??

    Read the article

  • MS Access Import from Text File problems

    - by Gavin O'Brien
    I'm trying to import a text file into an access database. It's not one I've written myself but the spec for the delimited text file is set up properly and the file imports properly using the wizard. When I try to use the import functions of the app itself, the ImportError table tells "Field Truncation" for one of the fields. Any help would be appreciated.

    Read the article

  • Switching 2003 SRV to 2008 caused Asp.net application not to load DLL

    - by Tom
    Switching aged 2003 SRV to 2008 caused my Asp.net 2 application fail: The application is no more loading the required library DLL from /bin/ folder anymore. What should I change in my code or web.config to make this webapp load OK also in new 2008 server? Now I receive this error when I access the application: This type is in IMPORTS ( Dll ). Compiler Error Message: BC30002: Type 'Facebook.Entity.User' is not defined.

    Read the article

  • Switching 2003 SRV to 2008 caused Asp.net application not to Import Dll

    - by Tom
    Switching aged 2003 SRV to 2008 caused my Asp.net 2 application fail: The application is no more loading the required library DLL from /bin/ folder anymore. What should I change in my code or web.config to make this webapp load OK also in new 2008 server? Now I receive this error when I access the application: This type is in IMPORTS ( Dll ). Compiler Error Message: BC30002: Type 'Facebook.Entity.User' is not defined.

    Read the article

  • Asp.Net (c#) - Read Excel Sheet.

    - by Pino
    I have a requirment to do some imports from an Excel spread sheet and have been looking at various examples on the web, they all seem to use the "Jet" driver which is not compatible with 64Bit. Now I am fully aware of the workarounds available (in changing how IIS runs etc) however I would like to know if there is repalcment for the "Jet" driver so I can read and generate excel sheets from Asp.Net running on a 64Bit server with no IIS modifications.

    Read the article

  • FileInfo displaying a peculiar date

    - by Berlioz
    Why does the following display 12/31/1600 ??? Imports System.IO Module Module1 Sub Main() Dim fi As New FileInfo("DocFiles\phillips_phone_number.txt") Console.WriteLine(fi.FullName) Console.WriteLine(fi.LastAccessTime.ToShortDateString) Console.ReadKey() End Sub End Module

    Read the article

  • Does grails support logging from the src/java classes?

    - by rainyday
    I have a grails app (v 1.1.2) the logging is working fine from the groovy classes, but I can't get it to work from within a java source... I have a class in package com.mforms.devices., it imports apache log4j, defines the logger as follows private final org.apache.log4j.Logger loggy = Logger.getLogger(this.getClass()); then refer to it later by doing loggy.error("...") my Config.groovy has the following log4j = { error 'com.mforms' root { error 'stdout', 'file' additivity = true } } What am I doing wrong?!?!

    Read the article

  • if i call an interface method will it get the method body from implementation class and execute ?

    - by sij
    please forgive me if i am wrong: I have an interface Interface1 I have its implementation Imple implements Interface (all methods hav been implemented :) ) now consider a third class CheckCall can I do a call in the class CheckCall like I mention below Interface1 interface1; interface1.method(); all necessary imports have been done. Please tell me is it possible or not , if not then ok and if yes then tell me what will happen if i have more than one impl classes for the same interface and i am doing the same call.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >