Search Results

Search found 923 results on 37 pages for 'messagebox'.

Page 21/37 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • error C2065: undeclared identifier

    - by karikari
    Currently, I have this function inside my other cpp file: UINT32 functionHtml(const wchar_t *url) { WinHttpClient client(url); client.SendHttpRequest(); wstring httpResponseHeader = client.GetHttpResponseHeader(); wstring httpResponse = client.GetHttpResponse(); writeToLog(httpResponse.c_str()); return 0; } I have another cpp file, and I would like to execute the stuff inside the above file. Here is the code for the other file: HRESULT CButtonDemoBHO::onDocumentComplete(IDispatch *pDisp, VARIANT *vUrl){ ATLTRACE("CButtonDemoBHO::onDocumentComplete %S\n", vUrl->bstrVal); // <---- i would like to call funtionHTML here or .. if (isMainFrame(pDisp)){ m_normalPageLoad=false; // <---- here.. MessageBox(m_hWnd, L"Main Document has completed loading", L"Document Complete", MB_OK); return S_OK; } return S_OK; } I got the error C2065: 'url' : undeclared identifier. Need help.

    Read the article

  • Program skips code after trying to parse XML in VB.NET

    - by Bead
    I'm trying to parse some XML (html) I downloaded using WebRequest.Create() and then read it. However after loading the XML file using LoadXml(string), anything else I execute doesn't work. Setting a breakpoint on anything afterwards doesn't work and it doesn't break. I tried catching exception but none are occurring, so I'm not sure what the problem is. Here is my code: Dim reader As StreamReader = New StreamReader(HTTPResponse.GetResponseStream()) Dim xDoc As XmlDocument = New XmlDocument() xDoc.LoadXml(reader.ReadToEnd()) Dim omfg As String = xDoc.ChildNodes().Item(0).InnerText() Dim name As XmlNodeList = xDoc.GetElementsByTagName("div") Dim jj As Integer = name.Count For i As Integer = 0 To name.Count - 1 MessageBox.Show(name.Item(i).InnerText) Next i Anything after the "xDoc.LoadXml(reader.ReadToEnd())" doesn't execute.. Any ideas on this? My XML does have some whitespace at the beginning, I don't know if that is causing the problem...

    Read the article

  • Active Directory List OU's

    - by Stephen Murby
    I have this code currently, string defaultNamingContext; DirectoryEntry rootDSE = new DirectoryEntry("LDAP://RootDSE"); defaultNamingContext = rootDSE.Properties["defaultNamingContext"].Value.ToString(); rootDSE = new DirectoryEntry("LDAP://" + defaultNamingContext); //DirectoryEntry domain = new DirectoryEntry((string)"LDAP://" + defaultNamingContext); DirectorySearcher ouSearch = new DirectorySearcher(rootDSE,"(objectCategory=Organizational-Unit)", null, SearchScope.Subtree); MessageBox.Show(rootDSE.Path.ToString()); try { SearchResultCollection collectedResult = ouSearch.FindAll(); foreach (SearchResult temp in collectedResult) { comboBox1.Items.Add(temp.Properties["name"][0]); DirectoryEntry ou = temp.GetDirectoryEntry(); } } When i use the debugger i can see that rootDSE.Path is infact pointing to the right place, in this case "DC=g-t-p,DC=Local" but the directory searcher doesn't find any results. Can anyone help?

    Read the article

  • Disabling Task manager using c# in OS Hardened machine

    - by srk
    I am using the below code to disable the task manager for a kiosk application which works perfectly public void DisableTaskManager() { RegistryKey regkey; string keyValueInt = "1"; string subKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"; try { regkey = Registry.CurrentUser.CreateSubKey(subKey); regkey.SetValue("DisableTaskMgr", keyValueInt); regkey.Close(); } catch (Exception ex) { MessageBox.Show("DisableTaskManager" + ex.ToString()); } } But when i run this in OS hardened machine i get the following error, DisableTaskManagerSystem.UnauthorizedAccessException: Access to the registry key 'HKey_Current_User\Software\Mictrosoft\Windows\CurrentVersion\Policies\System' is denied. at Microsoft.win32.RegistryKey.win32Error(int32 errorcode, String str) How can i overcome this ? I need to do this for a Kiosk application.

    Read the article

  • How can I avoid floating the same content twice?

    - by Randall Bohn
    My Kynetx app uses float_html() to put up a box full of content. rule float_box { select when pageview ".*" pre { content = << <div id='messagebox'> <h3>Floating Message Box</h3> <ul id='my_list'></ul> </div> >>; } float_html("absolute","top:25px","right:20px",content); } rule fill_box { select when pageview ".*" foreach ["alpha","bravo","charlie"] setting (list_item) append("#my_list", "<li>#{list_item}</li>"); } The app (a421x27) is used from a bookmarklet. If you click the bookmarklet twice on the same page you get double content. Is there any way to detect that the box is already on the screen and reuse it?

    Read the article

  • Unreachable code detected by using const variables

    - by Anton Roth
    I have following code: private const FlyCapture2Managed.PixelFormat f7PF = FlyCapture2Managed.PixelFormat.PixelFormatMono16; public PGRCamera(ExamForm input, bool red, int flags, int drawWidth, int drawHeight) { if (f7PF == FlyCapture2Managed.PixelFormat.PixelFormatMono8) { bpp = 8; // unreachable warning } else if (f7PF == FlyCapture2Managed.PixelFormat.PixelFormatMono16){ bpp = 16; } else { MessageBox.Show("Camera misconfigured"); // unreachable warning } } I understand that this code is unreachable, but I don't want that message to appear, since it's a configuration on compilation which just needs a change in the constant to test different settings, and the bits per pixel (bpp) change depending on the pixel format. Is there a good way to have just one variable being constant, deriving the other from it, but not resulting in an unreachable code warning? Note that I need both values, on start of the camera it needs to be configured to the proper Pixel Format, and my image understanding code needs to know how many bits the image is in. So, is there a good workaround, or do I just live with this warning?

    Read the article

  • How is it possible to get the forms mouseposition when clicking inside a control?

    - by ikky
    Hi. I have a panel and have added a PictureBox to it. I have added mouse_click listeners to both the panel and the picturebox. When they are clicked i create a messagebox which tells me the mouse position. Problem: When i click the panel, i get the mouse position i want. When i click the pictureBox, i get the current position in that picturebox. What i want: I want both of the controls to get the current mouseposition on the form. I can also go with getting the current mouseposition of the panel, since it is overlaying the form. Does anybody know how i can do this? I've googled around for this, but can't seem to find anything about it. Thank you in advance.

    Read the article

  • How do I pass a reference type to Control.Invoke / display a form centered on the main form

    - by Rubio
    I'm on a thread other than the UI thread and need to display a modal form that's centered on the application's main form. What I usually do is use the width and height of the main form and the modal form to calculate the location, then use the PointToScreen method of the main form to get the location of the modal form. Since I'm on another thread I need to use Control.Invoke to call this method. I just can't figure out how to pass a parameter of type Point to Control.Invoke (params object[]). Value types and String works fine. Or, if someone can find a better way to display a form centered on the main form regardless of thread, that would be great. MessageBox seems to be able to do this (although not modally).

    Read the article

  • [C#] dotNet 4.0 Clipboard bug?

    - by Nayan
    Try this: 1. Create an app in VS Express Edition 2010 (.NET 4.0). 2. Put these lines in the code wherever u like - string text = Clipboard.GetText(); MessageBox.Show(text); 3. Copy some ANSI text (for simplicity) from notepad. 4. Run the app and see the result. I see "Clipboard.GetText()" (without quotes) instead of actual data! Can anyone confirm if this happens in Pro/Ultimate editions too?

    Read the article

  • using Mutex causing application to hang on Win XP X64

    - by Mohsan
    hi. I used the following code to verify the single instance of application. On Win XP X86 it is working fine, but on X64 after 3 to 4 minutes System generates StackOverflowException and causes the application to hang. after removing this check application is working fine.. Please tell me what should be the reason. code is static void Main() { bool instanceCountOne = false; using (Mutex mtex = new Mutex(true, "AppName", out instanceCountOne)) { if (instanceCountOne) { #if (DEBUG) RunInDebugMode(); #else RunInReleaseMode(); #endif mtex.ReleaseMutex(); } else { MessageBox.Show( "An application instance is already running", "App Name", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } it crashes when single instance of application is running.

    Read the article

  • C#: How to Make it Harder for Hacker/Cracker to Get Around or Bypass the Licensing Check?

    - by Peter Lee
    Hi all, Suppose that the user has saved the License file under the Application.StartupPath, where all users can read. And then, every time when the app starts, it will check if it can find and verify the license file. If the app can find and verify, we let the user to continue with full functinalities. If not, we prompt a MessageBox showing "Unlicencsed, continue to use with trial version, functionalities limited." My question is, if I'm a hacker/cracker, I would try to get around or bypass the licensing check instead of cracking the license file, because, if we use RSA signature, it's very difficult to crack a license file. So where should we put the license check? thanks. Merry Christmas and Happy New Year! Peter P.S.: and also, is it safe if I put a global variable IsLicensed (true / false) to limit the functionalities? Is it easy for a hacker to change IsLicensed = true?

    Read the article

  • Task manager close is not detected second time in C# !!!

    - by Samir
    private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (e.CloseReason == CloseReason.UserClosing) { if (MessageBox.Show(this, "Do you really want to close?", "Close?", MessageBoxButtons.YesNo) == DialogResult.No) { e.Cancel = true; } } } So when I want to close the application clicking the close button the message box is shown as it should, then I chose no. Then the line e.Cancel = true is executed and the form is not closed. Now the thing is, after this if i close the application from task manager the close reason is UserClosing !!! Why? Shouldn't it be TaskManagerClosing?

    Read the article

  • How to marshal the type of "Cstring" in .NET Compact Framework(C#)?

    - by SmartJJ
    How to marshal the type of "Cstring" in .NET Compact Framework(C#)? DLLname:Test_Cstring.dll(OS is WinCE 5.0),source code: extern "C" __declspec(dllexport) int GetStringLen(CString str) { return str.GetLength(); } I marshal that in .NET Compact Framework(C#),for example: [DllImport("Test_Cstring.dll", EntryPoint = "GetStringLen", SetLastError = true)] public extern static int GetStringLen(string s); private void Test_Cstring() { int len=-1; len=GetStringLen("abcd"); MessageBox.Show("Length:"+len.ToString()); //result is -1,so PInvoke is unsuccessful! } The Method of "GetStringLen" in .NET CF is unsuccessful! How to marshal this type of "Cstring"? Any information about it would be very appreciated!

    Read the article

  • C# problem with ADO

    - by ahmed
    When i use the following code, i get this error : "OleDbexception Syntax error in INSERT INTO statement. plz help me! { // add the new username System.Data.OleDb.OleDbCommandBuilder cb; cb = new System.Data.OleDb.OleDbCommandBuilder(da); DataRow dRow = cPD_DatabaseDataSet.Tables["users_table"].NewRow(); dRow[0] = this.textBox_add_user.Text ; dRow[1] = this.textBox_password.Text ; cPD_DatabaseDataSet.Tables["users_table"].Rows.Add(dRow); //add new record cb.GetUpdateCommand(); cb.GetInsertCommand(); //save new recode into the Access file da.Update(cPD_DatabaseDataSet, "users_table"); //clear textboxes this.textBox_add_user.Text = ""; this.textBox_password.Text = ""; this.textBox_re_password.Text = ""; } catch (System.Data.OleDb.OleDbException exp) { //close the connection this.con.Close(); MessageBox.Show(exp.ToString()); }`

    Read the article

  • C# WinForms: How to load an image, then wait a few seconds, then play a mp3 sound ?

    - by ibmkahm
    Hello everybody, (after pressing a button) i would like to show an image (using a picturebox), wait a few seconds and then play a mp3 sound, but i dont get it to work. To wait a few seconds i use "System.Threading.Thread.Sleep(5000)". The problem is, the image alway appears AFTER the wait time, but i want it to show first, then wait, then play the mp3... i tried to use "WaitOnLoad = true" but it doesnt work, shouldn't it load the image first and the continue to read the next code line ?? Here is the code i've tried, that doesnt work: private void button1_Click(object sender, EventArgs e) { pictureBox1.WaitOnLoad = true; pictureBox1.Load("image.jpg"); System.Threading.Thread.Sleep(5000); MessageBox.Show("test"); //just to test, here should be the code to play the mp3 } (i also tried loading the image with "LoadAsync" and put the code to wait and play the mp3 in the "LoadCompleted" event, but that doesnt work either...) would be very nice if somebody helps me

    Read the article

  • WCF Service method syncronous/async

    - by Rafal
    Hi I have a problem withi calling WCF Service methods vs Silverlight 3. ` private bool usr_OK = false; clientService.CheckUserMailAsync(this.mailTF.Text); if (usr_OK == true) { isValidationOK = true; } else { isValidationOK = false; MessageBox.Show("User already exists.", "User registered succes!", MessageBoxButton.OK); } ` CheckUserMail should change usr_OK parameter. However it runs in other thread and it does not change the usr_OK param before IF block begins. I've tried thread.join byt the application freezed and i do not know what to do else. Please help me...how can i wait for WCF method to return param usr_OK.

    Read the article

  • implement button click in html

    - by vbNewbie
    I have been trying to execute a button event in html page that displays additional content on the web page. I am getting a null reference error when using the getelementbyid and not sure how to change this. Here is the html reference I need to engage: <div class="button" style="float:none;width:180px;margin:20px auto 30px;"><a href="#" id="more" style="width:178px">Show more ?</a></div> </div> and here is my code: Dim wb As New WebBrowser wb.Navigate(fromUrl) While wb.ReadyState <> WebBrowserReadyState.Complete Application.DoEvents() End While Debug.Write(wb.DocumentText) Dim htmlElements As HtmlElementCollection = wb.Document.GetElementsByTagName("<a") If Not wb.Document Is Nothing Then Try If wb.DocumentText.Contains("more") Then If wb.Document.GetElementById("more").GetAttribute("href") Then wb.Document.GetElementById("more").InvokeMember("#") End If End If Catch ex As Exception MessageBox.Show(ex.Message.ToString) End Try End If I appreciate any ideas.

    Read the article

  • Marshal managed string[] to unmanaged char**

    - by Vince
    This is my c++ struct (Use Multi-Byte Character Set) typedef struct hookCONFIG { int threadId; HWND destination; const char** gameApps; const char** profilePaths; } HOOKCONFIG; And .Net struct [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] public struct HOOKCONFIG { public int threadId; public IntPtr destination; // MarshalAs? public string[] gameApps; // MarshalAs? public string[] profilePaths; } I got some problem that how do I marshal the string array? When I access the struct variable "profilePaths" in C++ I got an error like this: An unhandled exception of type 'System.AccessViolationException' occurred in App.exe Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. MessageBox(0, cfg.profilePaths[0], "Title", MB_OK); // error ... Orz

    Read the article

  • "Data type mismatch in criteria expression"

    - by simon
    Hey guys ! I have a problem when i want to insert values from textboxes to my access database ! When i want to save i get that error ("Data type mismatch in criteria expression") The code: string conString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=C:\Users\Simon\Desktop\test5\test5\test5\save.mdb"; OleDbConnection empConnection = new OleDbConnection(conString); string insertStatement = "INSERT INTO aktivnosti_save " + "([ID_uporabnika],[ID_aktivnosti],[kalorij]) " + "VALUES (@ID_uporabnika,@ID_aktivnosti,@kalorij)"; OleDbCommand insertCommand = new OleDbCommand(insertStatement, empConnection); insertCommand.Parameters.Add("@ID_uporabnika", OleDbType.Char).Value = textBox3.Text; insertCommand.Parameters.Add("@ID_zivila", OleDbType.Char).Value = iDTextBox.Text; insertCommand.Parameters.Add("@kalorij", OleDbType.Char).Value = textBox2.Text; empConnection.Open(); try { int count = insertCommand.ExecuteNonQuery(); } catch (OleDbException ex) { MessageBox.Show(ex.Message); } finally { empConnection.Close(); textBox1.Clear(); textBox2.Clear(); } }

    Read the article

  • How to detect the language of MS Excel from C#

    - by Babba
    If i try to use Excel from C# (interop) i receive error (HRESULT: 0x80028018) when current thread language is different from Excel language: so i need to set thread language, they must be the same. Which is the best method to understand the language of Excel/Office? 1) registry (HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\LanguageResources\UILanguage ? How understand wich version (12.0/14.0/...?) 2) with Application like suggested here (http://stackoverflow.com/questions/2804556/how-to-detect-the-language-of-ms-excel) ? It's ok but i need a strong reference to a specific version Microsoft.Office.Core and so i can't do it for different versione of Office: Excel.Application application = new Excel.Application(); int iUi = application.LanguageSettings.get_LanguageID(Microsoft.Office.Core.MsoAppLanguageID.msoLanguageIDUI); MessageBox.Show(iUi.ToString()); 3) other?

    Read the article

  • WCF Service method synchronous/async

    - by Rafal
    Hi I have a problem with calling WCF Service methods with Silverlight 3. private bool usr_OK = false; clientService.CheckUserMailAsync(this.mailTF.Text); if (usr_OK == true) { isValidationOK = true; } else { isValidationOK = false; MessageBox.Show("User already exists.", "User registered succes!", MessageBoxButton.OK); } CheckUserMail should change usr_OK parameter. However it runs in other thread and it does not change the usr_OK param before IF block begins. I've tried thread.join byt the application freezed and i do not know what to do else. Please help me...how can i wait for WCF method to return param usr_OK.

    Read the article

  • How to get Combobox.SelectedItem Return string value of what is selected instead of Service Reference Class?

    - by Rohit Acharya
    I currently have the following code for a button. The message box shows SilverlightApplication2.ServiceReference2.Employee instead of the text string selected by the user. The combobox items are being populated by a WCF service. As a result I am unable to pass it to the Async call. How do I get the string of what user selected? private void btnAdd_Click(object sender, RoutedEventArgs e) { object selectedItem = comobo1.SelectedItem.ToString(); MessageBox.Show(selectedItem.ToString()); var proxy = new Service1Client(); proxy.GetAllEmployeesCompleted += proxy_GetAllEmployeesCompleted; proxy.GetAllEmployeesAsync(selectedItem.ToString()); }

    Read the article

  • redirect an event in VB.NET

    - by serhio
    I havea a UserControl1 (in witch I have an Label1) in Form1. I want to catch the MouseDown event from label and send it like from UserControl I do: Public Class UserControl1 Shadows Custom Event MouseDown As MouseEventHandler AddHandler(ByVal value As MouseEventHandler) AddHandler Label1.MouseDown, value End AddHandler RemoveHandler(ByVal value As MouseEventHandler) RemoveHandler Label1.MouseDown, value End RemoveHandler RaiseEvent(ByVal sender As Object, ByVal e As MouseEventArgs) 'RaiseMouseEvent(Me, e) ??? ' End RaiseEvent End Event End Class However, when I set in the Form1 the UserControl Private Sub UserControl11_MouseDown(ByVal sender As System.Object, _ ByVal e As System.Windows.Forms.MouseEventArgs) _ Handles UserControl11.MouseDown MessageBox.Show(sender.GetType.Name) 'here I have 'Label', want 'UserControl' End Sub

    Read the article

  • Program ends abruptly even in debugger - how did that happen?

    - by Mick
    I am trying to debug a program that unexpectedly shuts down. When I say "shuts down, I mean one moment I am seeing all the windows being displayed, each of which is showing all the right data,then suddenly all the windows disappear. The is no messagebox reporting anything wrong. So I tried running the program in the debugger hoping that it would somehow trap whatever was causing the program to abort, but even within the debugger the program simply ends abruptly. The last line in the debugger is: The program '[5500] test.exe: Native' has exited with code 0 (0x0). My program which is extremely large and extremely old has a lot of self diagnostics. My suspicion is that perhaps a self test has failed and maybe I just called "exit()", forgetting to pop up a dialog explaining why. My question now is, how can I find out from which point in the code, my program quit?

    Read the article

  • Using a c# .net object in an Excel VBA form

    - by Mark O'G
    Hi I have a .net object that I want to use in Excel. I have an existing VBA script that i need to alter to call this the object from. I have then converted the object to a TLB. I've not really touched on this area before so any help will be appreciated. I have created an interface [Guid("0F700B48-E0CA-446b-B87E-555BCC317D74"),InterfaceType(ComInterfaceType.InterfaceIsDual)] public interface IOfficeCOMInterface { [DispId(1)] void ResetOrder(); [DispId(2)] void SetDeliveryAddress(string PostalName, string AddressLine1, string AddressLine2, string AddressLine3, string AddressLine4, string PostCode, string CountryCode, string TelephoneNo, string FaxNo, string EmailAddress); } I have also created an class that inherits that object. [ClassInterface(ClassInterfaceType.None), ProgId("NAMESPACE.OfficeCOMInterface"), Guid("9D9723F9-8CF1-4834-BE69-C3FEAAAAB530"), ComVisible(true)] public class OfficeCOMInterface : IOfficeCOMInterface, IDisposable { public void ResetSOPOrder() { } public void SetDeliveryAddress(string PostalName, string AddressLine1, string AddressLine2, string AddressLine3, string AddressLine4, string PostCode, string CountryCode, string TelephoneNo, string FaxNo, string EmailAddress) { try { SalesOrder.AmendDeliveryAddress(PostalName, AddressLine1, AddressLine2, AddressLine3, AddressLine4, PostCode); MessageBox.Show("Delivery address set"); } catch (Exception ex) { throw ex; } } }

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >