Search Results

Search found 225 results on 9 pages for 'sendmessage'.

Page 8/9 | < Previous Page | 4 5 6 7 8 9  | Next Page >

  • object reference not set to an instance of object exception coming at runtime.

    - by amby
    Hi, I am getting this error at runtime: object reference not set to an instance of object my question is that am i using stringbuilder array correctly here. Because I am new in C#. and i think its the problem with my stringbuilder array. Below is the code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Text; using System.Web.Script.Serialization; using System.Web.Script.Services; using System.Collections; public partial class Testing : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } [WebMethod] public static string SendMessage() { try { al2c00.ldap ws = new al2c00.ldap(); Hashtable htPeople = new Hashtable(); //DataTable dt = ws.GetEmployeeDetailsBy_NTID("650FA25C-9561-430B-B757-835D043EA5E5", "john"); StringBuilder[] empDetails = new StringBuilder[100]; string num = "ambreen"; empDetails[0].Append("amby"); num = empDetails[0].ToString(); htPeople.Add("bellempposreport", num); JavaScriptSerializer jss = new JavaScriptSerializer(); string output = jss.Serialize(htPeople); return output; } catch(Exception ex) { return ex.Message + "-" + ex.StackTrace; } } } please reply me what i am doing wrong here.

    Read the article

  • Log4net Logging Problem : Very simple file appender logging not working

    - by contactmatt
    Here's my web.config information <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/> </configSections> <log4net> <root> <level value="ALL" /> </root> <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender"> <file value="c:\temp\log-file.txt" /> <appendToFile value="true" /> <rollingStyle value="Size" /> <maxSizeRollBackups value="10" /> <maximumFileSize value="1MB" /> <staticLogFileName value="true" /> <layout type="log4net.Layout.SimpleLayout" /> </appender> </log4net> ... Here's the code that initalizes the logger protected void SendMessage() { log4net.Config.XmlConfigurator.Configure(); ILog log = LogManager.GetLogger(typeof(Contact)); ... log.Info("here we go!"); log.Debug("debug afasf"); ... } it doesn't work, no matter what I seem to do. I am referencing the 'log4net.dll' correctly, and by debugging the application i can see that the log object is getting initiated properly. This is a asp.net 3.5 framework web project. Any ideas/suggestions? I thought originally this error may be due to a file write permission constraint, but that doesn't seem to be the case (or so I think).

    Read the article

  • Is it valid to use unsafe struct * as an opaque type instead of IntPtr in .NET Platform Invoke?

    - by David Jeske
    .NET Platform Invoke advocates declaring pointer types as IntPtr. For example, the following [DllImport("user32.dll")] static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, Int32 wParam, Int32 lParam); However, I find when interfacing with interesting native interfaces, that have many pointer types, flattening everything into IntPtr makes the code very hard to read and removes the typical typechecking that a compiler can do. I've been using a pattern where I declare an unsafe struct to be an opaque pointer type. I can store this pointer type in a managed object, and the compiler can typecheck it form me. For example: class Foo { unsafe struct FOO {}; // opaque type unsafe FOO *my_foo; class if { [DllImport("mydll")] extern static unsafe FOO* get_foo(); [DllImport("mydll")] extern static unsafe void do_something_foo(FOO *foo); } public unsafe Foo() { this.my_foo = if.get_foo(); } public unsafe do_something_foo() { if.do_something_foo(this.my_foo); } While this example may not seem different than using IntPtr, when there are several pointer types moving between managed and native code, using these opaque pointer types for typechecking is a godsend. I have not run into any trouble using this technique in practice. However, I also have not seen an examples of anyone using this technique, and I wonder why. Is there any reason that the above code is invalid in the eyes of the .NET runtime? My main question is about how the .NET GC system treats "unsafe FOO *my_foo". Is this pointer something the GC system is going to try to trace, or is it simply going to ignore it? My hope is that because the underlying type is a struct, and it's declared unsafe, that the GC would ignore it. However, I don't know for sure. Thoughts?

    Read the article

  • Sending multi-part email from Google App Engine using Spring's JavaMailSender fails

    - by hleinone
    It works without the multi-part (modified from the example in Spring documentation): final MimeMessagePreparator preparator = new MimeMessagePreparator() { public void prepare(final MimeMessage mimeMessage) throws Exception { final MimeMessageHelper message = new MimeMessageHelper( mimeMessage); message.setTo(toAddress); message.setFrom(fromAddress); message.setSubject(subject); final String htmlText = FreeMarkerTemplateUtils .processTemplateIntoString(configuration .getTemplate(htmlTemplate), model); message.setText(htmlText, true); } }; mailSender.send(preparator); But once I change it to: final MimeMessagePreparator preparator = new MimeMessagePreparator() { public void prepare(final MimeMessage mimeMessage) throws Exception { final MimeMessageHelper message = new MimeMessageHelper( mimeMessage, true); ... message.setText(plainText, htmlText); } }; mailSender.send(preparator); I get: Failed message 1: javax.mail.MessagingException: Converting attachment data failed at com.google.appengine.api.mail.stdimpl.GMTransport.sendMessage(GMTransport.java:231) at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:402) ... This is especially difficult since the GMTransport is proprietary Google class and no sources are available, which would make it a bit easier to debug. Anyone have any ideas what to try next? My bean config, for helping you to help me: <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl" p:username="${mail.username}" p:password="${mail.password}" p:protocol="gm" />

    Read the article

  • Ozeki Server not recieving SMS messages

    - by Sam Thompson
    I'm trying to get Ozeki to recieve SMS messages from my GSM Nokia E63 - it will send messages fine but wont recieve them. I am also trying to get a PHP/HTML form to generate messages, but the example on the Ozeki website won't work! <?php if ($submit=="Send") { $url='http://localhost:9333/ozeki?'; $url.="action=sendMessage"; $url.="&login=admin"; $url.="&password=abc123"; $url.="&recepient=".urlencode($recepient); $url.="&messageData=".urlencode($message); $url.="&sender=".urlencode($sender); file($url); } ?> <html> <form method=post action='index.php'> <table border=0> <tr> <td>Sender</td><td><input type='text' name='sender'></td> </tr> <tr> <td>Recepient</td><td><input type='text' name='recepient'></td> </tr> <tr> <td>Message</td><td><input type='text' name='message'</td> </tr> <tr> <td colspan=2><input type=submit name=submit value=Send> </form> </tr> </table> </form> </html> Any help?!

    Read the article

  • Using authsmtp from a Grails server

    - by Simon
    This is quite a specific question, and I have had no luck on the grails nabble forum, so I thought I would post here. I am using the grails mail plug-in, but I think my question is a general one about using authsmtp as an email gateway from my server. I am having trouble sending mail from my app using authsmtp. I have installed and configured the mail plugin and was originally using my ISP's SMTP server to send mails. However when I deployed to AWS EC2 this failed because my elastic IP was blocked by the SMTP host. So I bought myself an authsmtp account and set up my server email address as an accepted one at authsmtp. I then changed my configuration in SecurityConfig.groovy to point to the authsmtp server that I had been designated... mailHost = "mail.authsmtp.com" mailUsername = "myusername" mailPassword = "mypassword" mailProtocol = "smtp" mailFrom = "[email protected]" mailPort = 2525 ...and I'm just trying to get this to work locally before I deploy back up to AWS. Sending mail fails and in my log I have this exception: 2010-02-13 10:59:44,218 [http-8080-1] ERROR service.EmailerService - Failed to send emails: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 513 5.0.0 Your email system must authenticate before sending mail. org.springframework.mail.MailSendException; nested exception details (1) are: Failed message 1: com.sun.mail.smtp.SMTPSendFailedException: 513 5.0.0 Your email system must authenticate before sending mail. at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388) at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583) I'm a bit lost since the username and password I provide in the configuration are definitely correct. A terse and not very helpful conversation with authsmtp support suggests that I need to MD5 and/or base64 encode my credentials before sending, so my question is in three parts... 1) any idea what's going on with the failure and why that message is appearing? 2) how would I encode the credentials to pass to authsmtp and how would I configure that for the mail plugin 3) has anyone successfully connected and sent mail through authsmtp from the mail plugin and specifically from AWS EC2?

    Read the article

  • OnContextMenu() not working in view class

    - by Anu
    Hi, i have a popup menu for contextmenu.And i wrote the function for each menu in CMainframe. I have OnContextMenu() in each view class and in one dialog class.Its works fine in Dialog class.But not in View class.Codings are below: CMainframe funciton: void CMainFrame::OnUpdateFptrend(CCmdUI* pCmdUI) { ((CMainFrame *)AfxGetMainWnd())->SendMessage(WM_COMMAND,ID_TRENDVIEW,NULL); } void CMainFrame::OnUpdateFptuning(CCmdUI* pCmdUI) { ((CMainFrame *)AfxGetMainWnd())->SendMessageWM_COMMAND,ID_TUNINGVIEW,NULL); } Dialog class Contextmenu: void CFacePlate::OnContextMenu(CWnd* pWnd, CPoint point) { CMenu mnuPopup; mnuPopup.LoadMenu(IDR_FPMENU); CRect rBarRect; rBarRect.left = rBarRect.top = 0; rBarRect.right = 1000;rBarRect.bottom = 300; CMenu *mnuPopupMenu = mnuPopup.GetSubMenu(0); ASSERT(mnuPopupMenu); if( rBarRect.PtInRect(point) ) mnuPopupMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this); } View class: void CGroupView::OnContextMenu(CWnd* pWnd, CPoint point) { CMenu mnuPopup; mnuPopup.LoadMenu(IDR_FPMENU); CRect rBarRect; rBarRect.left = rBarRect.top = 0; rBarRect.right = 1150;rBarRect.bottom = 390; CMenu *mnuPopupMenu = mnuPopup.GetSubMenu(0); ASSERT(mnuPopupMenu); if( rBarRect.PtInRect(point) ) mnuPopupMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this); } When i press popup menu from Faceplate(Dialogclass),it goes to Mainframe function.At the same time when i press menu from any view class,it doesnot go to Mainframe function.Why its like that?

    Read the article

  • How to implement progressbar(to show progress) using threading concept in win 32?

    - by Rakesh
    I am trying to show a progress bar while my process is going on...in my application there will be a situation where I gotta read files and manipulate them(it will take some time to complete)..want to display a progress bar during this operation..the particular function I am calling is an win 32 ...so if you check my code below i am upto the point of creating the progress bar in a dialog window and creating a thread Now I dont know how to post the message and where to get the message and handle...Please help me..thanks in advance //my function int Myfunction(....) { HWND dialog = CreateWindowEx(0,WC_DIALOG,L"Proccessing...",WS_OVERLAPPEDWINDOW|WS_VISIBLE, 600,300,280,120,NULL,NULL,NULL,NULL); HWND pBar = CreateWindowEx(NULL,PROGRESS_CLASS,NULL,WS_CHILD|WS_VISIBLE,40,20,200, 20, dialog,(HMENU)IDD_PROGRESS,NULL,NULL); HANDLE getHandle = CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)SetFilesForOperation(...), NULL,NULL,0); } LPARAM SetFilesForOperation(...) { for(int index = 0;index < noOfFiles; index++) { *checkstate = *(checkState + index); if(*checkstate == -1) { *(getFiles+i) = new TCHAR[MAX_PATH]; wcscpy(*(getFiles+i),*(dataFiles +index)); i++; } else { (*tempDataFiles)->Add(*(dataFiles+index)); *(checkState + localIndex) = *(checkState + index); localIndex++; } //SendMessage(pBar,PBM_SETSTEP,1,0); } }

    Read the article

  • Not able to display the progress bar using threading concept?

    - by Rakesh
    I am trying to show a progress bar while my process is going on...in my application there will be a situation where I gotta read files and manipulate them(it will take some time to complete)..want to display a progress bar during this operation..the particular function I am calling is an win 32 ...so if you check my code below ...I am able to display the progressbar but it doesnt show any progress..actually its not doing any further process...Please help me..thanks in advance //my function int Myfunction(....) { MSG msg; HWND dialog = CreateWindowEx(0,WC_DIALOG,L"Proccessing...",WS_OVERLAPPEDWINDOW|WS_VISIBLE, 600,300,280,120,NULL,NULL,NULL,NULL); HWND pBar = CreateWindowEx(NULL,PROGRESS_CLASS,NULL,WS_CHILD|WS_VISIBLE,40,20,200, 20, dialog,(HMENU)IDD_PROGRESS,NULL,NULL); SendMessage(pBar,PBM_SETRANGE,0,MAKELPARAM(0,noOfFile)); while(GetMessage(&msg,NULL,0,0)) { TranslateMessage(&msg); Dispatch(&message); } HANDLE getHandle = CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)SetFilesForOperation(...), NULL,NULL,0); } LPARAM SetFilesForOperation(...) { for(int index = 0;index < noOfFiles; index++) { *checkstate = *(checkState + index); if(*checkstate == -1) { *(getFiles+i) = new TCHAR[MAX_PATH]; wcscpy(*(getFiles+i),*(dataFiles +index)); i++; } else { (*tempDataFiles)->Add(*(dataFiles+index)); *(checkState + localIndex) = *(checkState + index); localIndex++; } PostMessage(pBar,PBM_SETPOS,(WPARAM)index,0); } }

    Read the article

  • Send Click Message to another application process

    - by Nazar
    Hi Guys I have a scenario, i need to send click events to an independent application. I started that application with the following code. private Process app; app = new Process(); app.StartInfo.FileName = app_path; app.StartInfo.WorkingDirectory = dir_path; app.Start(); Now i want to send Mouse click message to that applicaiton, I have specific coordinates in relative to application window. How can i do it using Windows Messaging or any other technique. I used [DllImport("user32.dll")] private static extern void mouse_event(UInt32 dwFlags, UInt32 dx, UInt32 dy, UInt32 dwData, IntPtr dwExtraInfo); It works well but cause the pointer to move as well. So not fit for my need. Then i use. [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); It works well for minimize maximize, but do not work for mouse events. The codes for mousevents i am using are, WM_LBUTTONDOWN = 0x201, //Left mousebutton down WM_LBUTTONUP = 0x202, //Left mousebutton up WM_LBUTTONDBLCLK = 0x203, //Left mousebutton doubleclick WM_RBUTTONDOWN = 0x204, //Right mousebutton down WM_RBUTTONUP = 0x205, //Right mousebutton up WM_RBUTTONDBLCLK = 0x206, //Right mousebutton do Thanks for the help in advance, and waiting for feedback.

    Read the article

  • Assign click event to addon icon on navigation bar

    - by Charsee
    We have created a chrome extension for our app. Where we call a METHOD from a "js file" on CLICK event of the "extension icon" placed on the navigation bar. For this we use message passing between the app.js (file containing the METHOD to be called on icon click) and background.html (using a js file included in this html). The script used to pass message is:(from background.html) chrome.browserAction.onClicked.addListener(function (tab) { chrome.tabs.sendMessage(tab.id, "showPopup"); }); and to listen the message :(in app.js) chrome.extension.onMessage.addListener(function(request) { if (request === "showPopup") { showPopup(); } }); The click event works as expected. But now we want to do same thing in mozilla extension. and we can't pass message to app.js on the click of the icon,so that it can execute the containing methods. We have also added the app.js using pageMod, something like this exports.main = function(options, callbacks) { pageMod.PageMod({ include: ["*"], contentScriptWhen: 'start', contentScriptFile: [data.url('jquery-1.7.1.min.js'),data.url('app.js')] }); createAndAddNavBarButton(); }; function createAndAddNavBarButton() { var navBar = document.getElementById('nav-bar');//assume document has been defined if (!navBar){return;}; var nbBtn = document.createElement('navbaricon'); nbBtn.setAttribute('id', 'navButton'); nbBtn.setAttribute('image', data.url('icon_16.png')); nbBtn.onclick = function(){ showPopup(); return true; } navBar.appendChild(btn); } But the click event does nothing and showPopup() is undefined. When a new page loads event associated with it in the app.js executes without any error but the click event doesn't work. Is there a method from where we can assign click event directly to this icon, as we have done in the case of chrome extension.

    Read the article

  • Thread loses Message after wait() and notify()

    - by fugu2.0
    Hey Guys! I have a problem handling messages in a Thread. My run-method looks like this public void run() { Looper.prepareLooper(); parserHandler = new Handler { public void handleMessage(Message msg) { Log.i("","id from message: "+msg.getData.getString("id")); // handle message this.wait(); } } } I have several Activities sending messages to this thread, like this: Message parserMessage = new Message(); Bundle data = new Bundle(); data.putString("id", realId); data.putString("callingClass", "CategoryList"); parserMessage.setData(data); parserMessage.what = PARSE_CATEGORIES_OR_PRODUCTS; parserHandler = parser.getParserHandler(); synchronized (parserHandler) { parserHandler.notify(); Log.i("","message ID: " + parserMessage.getData().getString("id")); } parserHandler.sendMessage(parserMessage); The problem is that the run-method logs "id from message: null" though "message ID" has a value in the Log-statement. Why does the message "lose" it's data when being send to the thread? Has it something to do with the notify? Thanks for your help

    Read the article

  • Why is JavaMail Transport.send() a static method?

    - by skiphoppy
    I'm revising code I did not write that uses JavaMail, and having a little trouble understanding why the JavaMail API is designed the way it is. I have the feeling that if I understood, I could be doing a better job. We call: transport = session.getTransport("smtp"); transport.connect(hostName, port, user, password); So why is Eclipse warning me that this: transport.send(message, message.getAllRecipients()); is a call to a static method? Why am I getting a Transport object and providing settings that are specific to it if I can't use that object to send the message? How does the Transport class even know what server and other settings to use to send the message? It's working fine, which is hard to believe. What if I had instantiated Transport objects for two different servers; how would it know which one to use? In the course of writing this question, I've discovered that I should really be calling: transport.sendMessage(message, message.getAllRecipients()); So what is the purpose of the static Transport.send() method? Is this just poor design, or is there a reason it is this way?

    Read the article

  • Android How to get position of selected item from gridview without using onclicklistner, using ontouchlistner instead

    - by zonemikel
    I have a gridview, I need to do stuff on motioneven.action_down and do something for motioneven.action_up ... using onclicklistener is great but does not give me this needed functionality. Is there anyway to easily call the gridview and get its selected item in a ontouchlistener ? I've been having limited success with making my own implementation. Its hard to get the right x,y because if i call the child it gives me the x and y relative to the child so a button would be 0,0 to 48,48 but it does not tell you the actual location on the screen relative to the gridview or the screen itself. this is what i've been doing, its partially working so far. Grid.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { int x = (int)event.getX(); int y = (int)event.getY(); int position = 0; int childCount = Grid.getChildCount(); Message msg = new Message(); Rect ButtonRect = new Rect(); Grid.getChildAt(0).getDrawingRect(ButtonRect); int InitialLeft = ButtonRect.left + 10; ButtonRect.offsetTo(InitialLeft, ButtonRect.top); // while(position < childCount){ if(ButtonRect.contains(x,y)){break;} if(ButtonRect.right + ButtonRect.width() > Grid.getWidth()) { ButtonRect.offsetTo(InitialLeft, ButtonRect.bottom);} position++; ButtonRect.offsetTo(ButtonRect.right, ButtonRect.top); } msg.what = position; msg.arg1 = ButtonRect.bottom; msg.arg2 = y; cHandler.sendMessage(msg); }// end if action up if (event.getAction() == MotionEvent.ACTION_UP) { } return false; } });

    Read the article

  • SetWindowPos has not effect on tooltip

    - by YoungPony
    Hello, I am trying to give my ComboBox an in place tooltip for long strings. However when I call SetWindowPos on the tooltip, the position is never changed. Called when TTN_SHOW is received: ::SetWindowPos(textTooltip, NULL, TipRect.left, TipRect.top, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER); If I remove the SWP_NOSIZE flag and pop in some values into the width/height, then the combo box changes size to these values but the position remains the same. SetWindowPos always returns TRUE. The tip is initialised like so: textTooltip = CreateWindowEx(WS_EX_TRANSPARENT, TOOLTIPS_CLASS, NULL, TTS_NOPREFIX, 0, 0, 0, 0, this->GetSafeHwnd(), NULL, NULL, NULL); if(!textTooltip) return; ZeroMemory(&ToolInfo, sizeof(TOOLINFO)); ToolInfo.cbSize = sizeof(TOOLINFO); ToolInfo.uFlags = TTF_TRANSPARENT | TTF_SUBCLASS; ToolInfo.hwnd = this->GetSafeHwnd(); ToolInfo.lpszText = "place holder"; //set in OnSelectChangeOk ToolInfo.uId = 0; ToolInfo.rect = TipRect; //rect is re-set in OnSelectChangeOk ::SendMessage(textTooltip, TTM_ADDTOOL, 0, (LPARAM)&ToolInfo); Am I missing something?

    Read the article

  • c++ connect() keeps returning WSATIMEDOUT over internet but not localy

    - by KaiserJohaan
    Hello, For some reason, my chat application always gets WSATIMEDOUT when trying to connect to another person over the internet. int len_ip = GetWindowTextLength(GetDlgItem(hWnd,ID_EDIT_IP)); char ipBuffer[16]; SendMessage(GetDlgItem(hWnd,ID_EDIT_IP),WM_GETTEXT,16,(LPARAM)ipBuffer); long host_ip = inet_addr(ipBuffer); int initializeConnection(long host_ip, HWND hWnd) { // initialize winsock WSADATA wdata; int result = WSAStartup(MAKEWORD(2,2),&wdata); if (result != 0) { return 0; } // setup socket tcp_sock = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP); if (tcp_sock == INVALID_SOCKET) { return 0; } // setup socket address SOCKADDR_IN tcp_sock_addr; tcp_sock_addr.sin_family = AF_INET; tcp_sock_addr.sin_port = SERVER_TCP_PORT; tcp_sock_addr.sin_addr.s_addr = host_ip; // connect to server if (connect(tcp_sock,(SOCKADDR*)&tcp_sock_addr,sizeof(tcp_sock_addr)) == SOCKET_ERROR) { return 0; } HRESULT hr = WSAGetLastError(); // set socket in asynchronous mode if (WSAAsyncSelect(tcp_sock,hWnd,SOCKET_TCP, FD_READ | FD_WRITE | FD_CONNECT | FD_CLOSE) == SOCKET_ERROR) { return 0; } return 1; } For some reason it works perfectly fine on local network between computers, but totally screws up over the internet. WSATIMEDOUT is always returned (not connection refused, so its not a port problem). It makes me believe something is wrong with the IP but why on earth can it work on local addresses (like 192.168.2.4) Any ideas? Cheers

    Read the article

  • android progressBar problem

    - by kostas
    hi.i have a button that on click is loading rss feed.i want to load a progress bar until my list opens.i have created a progressbar,it works,but as i press the return button to return to the main menu the progress bar appears again and it doesnt stop(and not even let me see my menu).this is my code ProgressBar myProgressBar; int myProgress = 0; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main1); Button nea = (Button) findViewById(R.id.nea); nea.setOnClickListener(new View.OnClickListener() { public void onClick (View view) { setContentView(R.layout.bar); myProgressBar=(ProgressBar)findViewById(R.id.bar); new Thread(myThread).start(); Intent myIntent = new Intent(view.getContext(), nea.class); startActivityForResult(myIntent, 0); } }); } and then,out of the onCreate private Runnable myThread = new Runnable(){ @Override public void run() { // TODO Auto-generated method stub while (myProgress<100){ try{ myHandle.sendMessage(myHandle.obtainMessage()); Thread.sleep(1000); } catch(Throwable t){ } } } Handler myHandle = new Handler(){ public void handleMessage(Message msg) { // TODO Auto-generated method stub myProgress++; myProgressBar.setProgress(myProgress); } }; };

    Read the article

  • Google Chrome Extension : Port: Could not establish connection. Receiving end does not exist

    - by tcornelis
    I have been looking for an answer for almost a week now, but having read all the stackoverflow items i can't seem to find a solution that is working for me. The error that i'm having is : Port: Could not establish connection. Receiving end does not exist. lastError:30 set lastError:30 dispatchOnDisconnect messaging:277 folder layout : img developer_icon.png js sidebar.js main.js jquery-2.0.3.js manifest.json my the manifest.json file looks something like this (it is version 2) :` "browser_action": { "default_icon": "./img/developer_icon.png" }, "content_scripts": [ { "matches": ["*://*/*"], "js": ["./js/sidebar.js"], "run_at": "document_end" } ], "background" : { "scripts" : ["./js/main.js","./js/jquery-2.0.3.js"] }, I want to handle the user clicking the extension icon so i could inject a sidebar in the existing website (because the extension i would like to develop requires that amount of space). So in main.js : chrome.browserAction.onClicked.addListener(function(tab) { chrome.tabs.getSelected(null, function(tab){ chrome.tabs.sendMessage( //Selected tab id tab.id, //Params inside a object data {callFunction: "toggleSidebar"}, //Optional callback function function(response) { console.log(response); } ); }); }); and in sidebar.js : chrome.runtime.onMessage.addListener(function(req,sender,sendResponse){ console.log("sidebar handling request"); toggleSidebar(); }); but i'm never able to see the console.log in my console because of the error. Does someone know what i did wrong? Thanks in advance!

    Read the article

  • Send Click Message to another application process

    - by Nazar Hussain
    I have a scenario, i need to send click events to an independent application. I started that application with the following code. private Process app; app = new Process(); app.StartInfo.FileName = app_path; app.StartInfo.WorkingDirectory = dir_path; app.Start(); Now i want to send Mouse click message to that applicaiton, I have specific coordinates in relative to application window. How can i do it using Windows Messaging or any other technique. I used [DllImport("user32.dll")] private static extern void mouse_event(UInt32 dwFlags, UInt32 dx, UInt32 dy, UInt32 dwData, IntPtr dwExtraInfo); It works well but cause the pointer to move as well. So not fit for my need. Then i use. [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); It works well for minimize maximize, but do not work for mouse events. The codes for mousevents i am using are, WM_LBUTTONDOWN = 0x201, //Left mousebutton down WM_LBUTTONUP = 0x202, //Left mousebutton up WM_LBUTTONDBLCLK = 0x203, //Left mousebutton doubleclick WM_RBUTTONDOWN = 0x204, //Right mousebutton down WM_RBUTTONUP = 0x205, //Right mousebutton up WM_RBUTTONDBLCLK = 0x206, //Right mousebutton do Thanks for the help in advance, and waiting for feedback.

    Read the article

  • Accessing and inheriting Windows Message for other Windows Message in Delphi

    - by HX_unbanned
    I am using WMSysCommand messages to modify Caption bar button ( Maximize / Minimize ) behaivor and recent update requiered to use WMNCHitTest, but I do not want to split these two related messages in multiplie procedures because of lengthy code. Can I access private declaration ( message ) from other message? And if I can - How to do it? procedure TForm1.WMNCHitTest(var Msg: TWMNCHitTest) ; begin SendMessage(Handle, HTCAPTION, WM_NCHitTest, 0); // or other wParam or lParam ???? end; procedure TForm1.WMSysCommand; begin if (Msg.CmdType = SC_MAXIMIZE or 61488) or (Msg.Result = htCaption or 2) then // if command is Maximize or reciever message of Caption Bar click begin if CheckWin32Version(6, 0) then Constraints.MaxHeight := 507 else Constraints.MaxHeight := 499; Constraints.MaxWidth := 0; end else if (Msg.CmdType = SC_MINIMIZE or 61472) or (Msg.Result = htCaption or 2) then // if command is Minimize begin if (EnsureRange(Width, 252, 510) >= (510 / 2)) then PreviewOpn.Caption := '<' else PreviewOpn.Caption := '>'; end; DefaultHandler(Msg); // reset Message handler to default ( Application ) end; Soo ... do I think correctly and sipmly do not know correct commands or I am thinking total bullsh*t? Regards. Thanks for any help...

    Read the article

  • Android thread handler NullPointerException

    - by Realn0whereman
    So this null pointer is confusing me. I believe it is a scope issue. My main activity looks like this: public class App extends Activity { ProgressDialog progressDialog; ProgressThread progressThread; Then inside of the oncreate I do this: ProgressDialog progressDialog = new ProgressDialog(this); progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); progressDialog.setMessage("Fetching Images..."); ProgressThread progressThread = new ProgressThread(handler,mImageIds,mImages); progressThread.start(); progressDialog.show(); THEN inside progressThread which is a separate class I do mHandler.sendMessage(mHandler.obtainMessage()); Now up until this point i believe it behaves as it should. I have my handler hanging out in class scope right underneath my oncreate final Handler handler = new Handler() { public void handleMessage(Message msg){ progressDialog.hide(); progressThread.interrupt(); } }; The program thinks that progressDialog and progressThread are declared, but are null. Why would they be null if I instantiate in my oncreate.

    Read the article

  • How do you send an extended-ascii AT-command (CCh) from Android bluetooth to a serial device?

    - by softex
    This one really has me banging my head. I'm sending alphanumeric data from an Android app, through the BluetoothChatService, to a serial bluetooth adaptor connected to the serial input of a radio transceiver. Everything works fine except when I try to configure the radio on-the-fly with its AT-commands. The AT+++ (enter command mode) is received OK, but the problem comes with the extended-ascii characters in the next two commands: Changing the radio destination address (which is what I'm trying to do) requires CCh 10h (plus 3 hex radio address bytes), and exiting the command mode requires CCh ATO. I know the radio can be configured OK because I've done it on an earlier prototype with the serial commands from PIC basic, and it also can be configured by entering the commands directly from hyperterm. Both these methods somehow convert that pesky CCh into a form the radio understands. I've have tried just about everything an Android noob could possibly come up with to finagle the encoding such as: private void command_address() { byte[] addrArray = {(byte) 0xCC, 16, 36, 65, 21, 13}; CharSequence addrvalues = EncodingUtils.getString(addrArray, "UTF-8"); sendMessage((String) addrvalues); } but no matter what, I can't seem to get that high-order byte (CCh/204/-52) to behave as it should. All other (< 127) bytes, command or data, transmit with no problem. Any help here would be greatly appreciated. -Dave

    Read the article

  • WpfToolkit DataGrid does not work in Windows Phone 7

    - by Igor Zevaka
    I am trying to use WpfToolkit DataGrid in Windows Phone 7 project (Silverligt 4) and it's not working. Here is the XAML: <UserControl x:Class="SilverlightControls.Grid" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:wtk="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit" d:DesignHeight="480" d:DesignWidth="480"> <Grid x:Name="LayoutRoot" Background="#FF1F1F1F" Width="960"> <Grid x:Name="TitleGrid"> <TextBlock Text="{Binding Title}" Style="{StaticResource PhoneTextPageTitle2Style}"/> </Grid> <wtk:DataGrid> </wtk:DataGrid> </Grid> </UserControl> The project compiles fine but crashes at runtime trying to load this control. The best clue I got so far is from Visual Studio Designer. Once I add wtk:DataGrid to the control the visual designer does not load and below is the exception it displays. Could it be that WpfToolkit relies on PresentationFramework.dll and it's not available in SL4? System.Reflection.Adds.UnresolvedAssemblyException Type universe cannot resolve assembly: PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. at System.Reflection.Adds.AssemblyProxy.GetResolvedAssembly() at System.Reflection.Adds.AssemblyProxy.get_FullName() at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.PrepareAttributes(Reflectable`1 reflectableAssembly) at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.PrepareAttributes(Reflectable`1 reflectableType) at MS.Internal.Metadata.ClrType.GetAttributes[T](ReflectionMetadataContext context, IReflectable`1 member, ITypeMetadata attributeType, Boolean merge, AttributeMergeCache& cache) at MS.Internal.Metadata.ClrMember`1.GetLocalAttributes(ITypeMetadata attributeType) at MS.Internal.Design.Metadata.Xaml.XamlType.GetSpecialProperty(Int32 idx, PropertyIdentifier pid) at MS.Internal.Design.Metadata.Xaml.XamlType.get_ContentProperty() at Microsoft.Windows.Design.Metadata.Xaml.XamlExtensionImplementations.GetContentProperty(ITypeMetadata sourceType) at Microsoft.Windows.Design.Metadata.Xaml.XamlExtensions.GetContentProperty(ITypeMetadata source) at MS.Internal.Design.Metadata.ReflectionTypeNode.get_ContentProperty() at MS.Internal.Design.Markup.XmlElement.CalcChildWhitespaceImportant(XamlElement element) at MS.Internal.Design.Markup.XmlElement.ConvertChildrenToXaml(XamlElement result, PrefixScope scope, IParseContext context, IMarkupSourceProvider provider, Boolean childrenAsString) at MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider) at MS.Internal.Design.Markup.XmlElement.ConvertChildrenToXaml(XamlElement result, PrefixScope scope, IParseContext context, IMarkupSourceProvider provider, Boolean childrenAsString) at MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider) at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.ParseElementFromSkeleton(XamlParseContext context, SkeletonNode node, XamlElement parent, Boolean fullElement) at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.UpdateSkeleton(IDamageListener listener) at Microsoft.Windows.Design.DocumentModel.Trees.MarkupDocumentTreeManager.Update() at Microsoft.Windows.Design.DocumentModel.MarkupProducer.Update() at Microsoft.Windows.Design.DocumentModel.MarkupProducer.HandleMessage(DocumentTreeCoordinator sender, MessageKey key, MessageArguments args) at Microsoft.Windows.Design.DocumentModel.MarkupProducer.Microsoft.Windows.Design.DocumentModel.IDocumentTreeConsumer.HandleMessage(DocumentTreeCoordinator sender, MessageKey key, MessageArguments args) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.SendMessage[T](MessageKey`1 key, T args, Boolean isPrivateMessage) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.QueuedMessage`1.Microsoft.Windows.Design.DocumentModel.IQueuedMessage.Invoke() at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.ProcessQueuedMessages(Object state) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

    Read the article

  • Debugging Messaging Exception

    - by rizza
    We have a batch program that incorporates JavaMail 1.2 that sends emails. In our development environment, we haven't got the chance to encounter the above mentioned exception. But in the client's environment, they had experienced this a lot of times with the following error trace: javax.mail.MessagingException: 550 Requested action not taken: NUL characters are not allowed. at com.sun.mail.smtp.SMTPTransport.issueCommand (SMTPTransport.java: 879) at com.sun.mail.smtp.SMTPTransport.finishData (SMTPTransport.java: 820) at com.sun.mail.smtp.SMTPTransport.sendMessage (SMTPTransport.java: 322) ... I'm not sure if this is connected to my problem, http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4697158. But trying JavaMail 1.4.2, I see that the content transfer encoding of the email is still 7bit, so I'm not sure if using JavaMail 1.4.2 could solve the problem. Please take note that I could only do testing in our development environment that hasn't been able to replicate this. With the above exception, how would i know if this is from the sender or the receiver side? What debugging steps could you suggest? EDIT: Here is a DEBUG of the actual sending (masked some information): DEBUG: not loading system providers in &lt;java.home&gt;</a>/lib DEBUG: not loading optional custom providers file: /META-INF/javamail.providers DEBUG: successfully loaded default providers DEBUG: Tables of loaded providers DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]} DEBUG: Providers Listed By Protocol: {imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]} DEBUG: not loading optional address map file: /META-INF/javamail.address.map DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc] DEBUG SMTP: useEhlo true, useAuth false DEBUG: SMTPTransport trying to connect to host "nnn.nnn.n.nnn", port nn DEBUG SMTP RCVD: 220 xxxx.xxxxxxxxxxx.xxx SMTP; Mon, 23 Mar 2009 15:18:57 +0800 DEBUG: SMTPTransport connected to host "nnn.nnn.n.nnn", port: nn DEBUG SMTP SENT: EHLO xxxxxxxxx DEBUG SMTP RCVD: 250 xxxx.xxxxxxxxxxx.xxx Hello DEBUG SMTP: use8bit false DEBUG SMTP SENT: MAIL FROM:<a href="newmsg.cgi?mbx=Main&[email protected]">&lt;[email protected]&gt;</a> DEBUG SMTP RCVD: 250 <a href="newmsg.cgi?mbx=Main&[email protected]">&lt;[email protected]&gt;</a>... Sender ok DEBUG SMTP SENT: RCPT TO:&lt;[email protected]&gt; DEBUG SMTP RCVD: 250 &lt;[email protected]&gt;... Recipient ok Verified Addresses &nbsp;&nbsp;[email protected] DEBUG SMTP SENT: DATA DEBUG SMTP RCVD: 354 Enter mail, end with "." on a line by itself DEBUG SMTP SENT: . DEBUG SMTP RCVD: 550 Requested action not taken: NUL characters are not allowed.

    Read the article

  • Client-side policy error using JacORB (Java/CORBA) with SSL

    - by jason
    I'm trying to add SSL to an existing CORBA app, and I keep getting this error: org.omg.CORBA.NO_PERMISSION: Client-side policy requires SSL/TLS, but server doesn't support it vmcid: 0x0 minor code: 0 completed: No at org.jacorb.orb.iiop.ClientIIOPConnection.checkSSL(ClientIIOPConnection.java:535) at org.jacorb.orb.iiop.ClientIIOPConnection.connect(ClientIIOPConnection.java:144) at org.jacorb.orb.giop.GIOPConnection.sendMessage(GIOPConnection.java:835) at org.jacorb.orb.giop.GIOPConnection.sendRequest(GIOPConnection.java:805) at org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:302) at org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:282) at org.jacorb.orb.Delegate.invoke_internal(Delegate.java:919) at org.jacorb.orb.Delegate.invoke(Delegate.java:868) at org.jacorb.orb.Delegate.is_a(Delegate.java:1268) at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112) at databridge.autogen.ILoginManagerHelper.narrow(ILoginManagerHelper.java:57) at databridge.test.Client.main(Client.java:59) I have generated keystores for both client and server and exchanged the keys between the two. Using this setup, I can get the demo application that came in the JacORB download to run successfully. The only difference I can tell is that my test is using the Tie method to get the POA. There are some policies that go into that, but I can't find any information on what policies need to go in there to enable SSL, if any. I'm not even sure that's the problem as the JacORB demo doesn't set any policies on the server or poa. When I run the -Djavax.net.debug=ssl, I can see the keystores load up the trusted certs on both the client and the server. I'm just not sure what policies are being referred to here, but it's odd that the demo works and the test doesn't using the exact same keystores and properties. I've emailed the mailing list, but I'm not holding out much hope as that doesn't seem to be very active. Any help would be greatly appreciated. Below are my properties files. Server Props: jacorb.security.support_ssl=on jacorb.security.ssl.server.supported_options=60 jacorb.security.ssl.server.required_options=20 jacorb.ssl.socket_factory=org.jacorb.security.ssl.sun_jsse.SSLSocketFactory jacorb.ssl.server_socket_factory=org.jacorb.security.ssl.sun_jsse.SSLServerSocketFactory jacorb.security.keystore=dbserver.jks jacorb.security.keystore_password=dbsslserver_pass jacorb.security.jsse.trustees_from_ks=on jacorb.security.jsse.log.verbosity=4 jacorb.implname=StandardImplName client props jacorb.security.support_ssl=on jacorb.security.ssl.client.supported_options=60 jacorb.security.ssl.client.required_options=20 jacorb.ssl.socket_factory=org.jacorb.security.ssl.sun_jsse.SSLSocketFactory jacorb.security.keystore=dbclient.jks jacorb.security.keystore_password=dbsslclient_pass jacorb.security.jsse.trustees_from_ks=on jacorb.security.jsse.log.verbosity=4 jacorb.implname=StandardImplName

    Read the article

< Previous Page | 4 5 6 7 8 9  | Next Page >