Mr.M 89 Future Programmers

Thank you, you saved me, I've been trying for weeks now. It works now perfectly with your code.

Mr.M 89 Future Programmers

I'm using Microsoft Visual Studio 2010 (Visual C++ Windows Form Project).
Regarding the test yes it doe compile/build/run with no error. Here are the includes

#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <Windows.h>
#include <WinSock.h>

Here are the namespaces

using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System::Data;
    using namespace System::Drawing;
    using namespace System::IO;
    using namespace System::Net;
    using namespace System::Text::RegularExpressions;
    using namespace std; // This I recently added as I was trying to solve this issue using different solutions from the internet.
rproffitt commented: I see that your system is no longer supported from what I can find. Nov 2024 was recent so while that's in play, so is the lack of code sharing. +17
Mr.M 89 Future Programmers
char ComputerName [MAX_COMPUTERNAME_LENGTH + 1];
            DWORD cbComputerName = sizeof (ComputerName);
            if(GetComputerName (ComputerName, &cbComputerName)){
                String^ pcname(ComputerName);

                label9->Text =  pcname;
            }
Mr.M 89 Future Programmers
I tried that but I get this error
     Error  14  error C2440: 'initializing' : cannot convert from 'char [16]' to 'System::String ^'

Regarding browser crashing, only with Dani its crashes on the other sites it doesn't crash 
Mr.M 89 Future Programmers

Display computer name to a label

Reverend Jim commented: I don't see the point in this. -3
rproffitt commented: Too vague. Might be Linux, Pi, smart badge, web page or any number of things. Elaborate and show what you tried so far. +17
Mr.M 89 Future Programmers

Just to indicate I've managed to work around this, and what I'm using is working 100%.

There's a reason why it uses the same id's that's because it is dynamically generated and I have almost 5 or 6 GROUPS of classes so I can't use the class grouping on this but was looking for something similar but instead of using classes I wanted to use id's.
But the approach I'm using is perfect as it uses this approach to get the element in question and find the closest tr then find the id from it.

This approach works perfect and it doesn't interfere with any other tables on other sections.

Also just to mention, the site is a one page that dynamically load elements without refreshing.

So thanks to everyone commenting but I've solved this issue.

Mr.M 89 Future Programmers

I've managed to use an alternative, instead of this approach I've changed and used a function call onChange="Myfunction(this);" and I then reference to the dom element returned to get it option selected id.

It is now working accordingly.

Mr.M 89 Future Programmers

Greetings, I'm having an issue, I want to set my form to display at the very top right hand side corner of a screen, I've achieved this in vb.net using this code

Location = New Point(Screen.PrimaryScreen.WorkingArea.Width - Width, 0)

Does anyone know how I can do this in VC++?

Mr.M 89 Future Programmers

I think these chatbots are something great to offload work load from agents but the problem starts from us developers by not making a tailored chatbot to address that business queries but we generalize it which becomes a problem.

This has to be done by account, product, business query which will allow a user to find solutions s/h needs

Mr.M 89 Future Programmers

Hi DW, I've faced an issue with my project, it has been working these years till I think last year or the other year. When I sync it fails saying unable to resolve dependency no matter which version I try I get similar error differs with version number.

Mr.M 89 Future Programmers

Hi DW. Does anyone know how can I clear a devtool network monitor log of a browser using javascript.

I know the console.clear() only clear the console log not the network monitor tool logs.

Mr.M 89 Future Programmers

Hi DW. Is there anyone who know how I can I develop an App that's like TeamView for Android so that I will be able to remotely access the phone via browser on my website?
What I want to do is that instead of directly accessing the phone I want to virtualise it so that I can have duplicates of it when required so that let say 2 people are accessing or using it, they won't be interference from the two but each will have his own clone (virtual) device. I want then to share the virtual device screen on my website.

The use case of this is very simple it's just for viewing while, going to settings, dial a USSD code and see a response.

The catch here is that we all know that the actual devices are not the same interms of operation so it must clone that device behaviour so that the user will be like using the very same device.

How can I achieve this? I think the steps is to first clone the entire device, I don't know how, then create a virtual device of it which the user will be interacting with rather than interacting with the actual device because that will mean I will have to have many device if th number grows so I think best way is to virtualise it so that I can have duplicates of it unless if there's another way of threading the remote access which might be …

Mr.M 89 Future Programmers

Please verify your location/url which is /data I think you need to put the full path url there like http://localhost/x/data

Mr.M 89 Future Programmers

Ok here you need to first have some sort of differentiating when (a) the session doesn't exist then also (b) when the user has click remove then finally (c) another part is added to the category. That will be done by you but this will help you in that:

<?php echo $_SESSION['your_session'] == "" ? 'show' : 'hidden';?>

then for checking if the user has removed item you will need to have a global variable or make use of toggle through a function which will trigger the css to show/hide the ADD which you will used or call it when the user removes the item, then also call the same function that toggles this when another part is added in a different category.

Hope that helps you.

adajames commented: As I read this post, I found it to be very helpful. Thank you for posting it. I enjoyed reading it. +0
Mr.M 89 Future Programmers

I also think the issue is within the CSS, see if you don't also have mixed bootstrap and also try to test it in a simple standard radio radio button or check box and see if it will work on a non-bootstrap element. If it work the you might need to verify your bootstrap you are using, I also had the same issue I ended up not using the slide option because of this.

Mr.M 89 Future Programmers

You have too much code, that is why you don't get answers, it a bit hard to follow, rather point straight to the portion of codes that should be doing what you are trying to do, like just show that function with fewer codes for better answers. Make 1 example of the actual data from your source and how you want it to be and the code you tried to achieve that so that it will be easy to see what's wrong with your code.

Mr.M 89 Future Programmers

You have two operations depending on you start app approach. I mean if you always require login each time an App is started.

In that case when the user attempt to login simply return the account status in whatever way you want so that you can check the value and see if the account is active or not.

Another method is to request an account status feom your database to see if the account is active or not.

Mr.M 89 Future Programmers

So you want excel to be like your database?

athousandsticks commented: The returned “EmployeeID” will be used to clock in [in the Excel Time & Attendance application] automatically +0
Mr.M 89 Future Programmers

How many have websites here or own websites here?

Mr.M 89 Future Programmers

I think what's next on this issue or on this kind of hack, I think they will change or advance from sim swop to hacking the actual phones without our knowledge.

Take a look at this, on your mobile you download an App then on the installation process it ask you to grant it permissions to all the technologies it will need or use that also including reading your SMSs, your phone book contacts, and sometimes even your location.

Now to me that's a very dangerous acts just like how WhatsApp does when you installing it, you login, then it sends you an SMS with the OTP, but as soon as that SMS reaches your system tray it reads it and get the code. So for a hacking App I think it can also do the same when they are spying on you for your banking details because as we are in the 4IR we have seen even banks push people to bank digital mostly their mobile Apps.

Now to me that look like the next big hit we should be prepared of as it is coming and it will hit very badly because I'm not yet sure if its possible to get the message on system tray then instantly remove it so it doesn't notify or ring the notification but if that's possible then people might really lose money and don't get notifications on their Apps because these Apps would get it first then remove it so not to …

rproffitt commented: "Get that person an upvote." In reference to the Shareit comment. That's banned on some forums. +15
Mr.M 89 Future Programmers

I've been hearing with this even here in RSA, people are complaining with this, I just wonder how they do it because it seems as if the victim is totally not aware of such.

rproffitt commented: Victims become aware when the losses happen. The SimSwap issue has changed my mind about using my smart phone for more than phone and games. +15
Mr.M 89 Future Programmers

Well this is just a demo hosted on a free hosting service. It is meant to show how the library should work when you use it on your website. This is just a demo.

rproffitt commented: So that's the message I'd see if I used it? J.K.? +0
Mr.M 89 Future Programmers

Thanks to Dani queen, I was also affected by this as well, tried to reset password but the email wasn't sent to me, I contacted her about this and she assisted me instantly. I was about to loose hope in gaining back my Daniweb account. Thank you Dani.

Mr.M 89 Future Programmers

I managed to get the solution to this problem and the solution is:

<?php
$mysqli = new mysqli($host, $user, $password, $database);
// DO ERROR CHECKING HERE

$article_id = isset($_GET['id']) ? $_GET['id'] : false;

if ($article_id) {
  $query = <<< QUERY
SELECT * 
FROM 
  `ndlelabyte`.`messages` 
WHERE 
  `articleid` ={$article_id} 
LIMIT 0 , 30
QUERY;

  $result = $mysqli->query($query);
  if ($result) {
    while ($row = $result->fetch_object()) {
      echo <<< COMMENT
  <div class="col-xs-12">
    <div class="mbr-testimonial card">
      <div class="card-block"><p>{$row['comments']}</p></div>
      <div class="mbr-author card-footer">
      <div class="mbr-author-name">{$row['author']}</div>
    </div>
    </div>
  </div>
COMMENT;
    }
  }
}
Mr.M 89 Future Programmers

You problem is here

        cmd = New OdbcCommand("insert into arsip values (?, ?, ?, ?)", conn)
        With cmd
            .Parameters.AddWithValue("?", TextNO.Text)
            .Parameters.AddWithValue("?", TextJenis.Text)
            .ExecuteNonQuery()
        End With
        conn.Close()

you have 4 values that need to be used but you only used 2.

If your database doen't have 4 fields then your code should be like this:

        cmd = New OdbcCommand("insert into arsip values (?, ?)", conn)
        With cmd
            .Parameters.AddWithValue("?", TextNO.Text)
            .Parameters.AddWithValue("?", TextJenis.Text)
            .ExecuteNonQuery()
        End With
        conn.Close()
Mr.M 89 Future Programmers

So you mean I can call

form->label1->Text = "Text has changed from the out side.";
Application::Run(form);

as much as need and where ever I want to? I will have to try it out and see then.

Mr.M 89 Future Programmers

Don't use to hijack other peoples posts. Here is a C# code.

foreach (ListViewItem iItem in ListView4.SelectedItems) {
    // I declared the variables I will use to keep track here.
    int Price_To_Deduct = 0;
    // I used Integer because I didn't format the numbers to money format so you can try using Double but I haven't tested that.
    int Current_Total_Price = 0;
    // This variable will contain the current total price which we will deduct from.
    int New_Total = 0;
    // This will contain the new total.
    Price_To_Deduct = iItem.SubItems(1).Text;
    Current_Total_Price = Label2.Text;
    // Retrieving the current total price so that we will do calculations.
    New_Total = Current_Total_Price - Price_To_Deduct;
    // Because I'm using a Label I now have to clear it and reUpdate it with the new total.
    Label2.Text = "";
    Label2.Text = New_Total;
}
Mr.M 89 Future Programmers

I will strongly suggest that you first read tutorial that will introduce you to programming language as well as the IDE then read how to create your first program in that IDE, how to use controls etc. From there you will have some ideas onto where to start answering the questions.

Here we help by providing solutions to code problems (Errors), unfunctioning properly codes, etc.

Download pdfs, videos trust me it will help a lot.

Mr.M 89 Future Programmers

Thanks that was my problem on how I could loop through this, I knew I need to loop through it but didn't know how because when I try For Each MyRow As DataRow In dvt.Rows it didn't do what I wanted till I find this.

Mr.M 89 Future Programmers

Well because you not a modem manufacture, I think what will help you is to first detect USB/Ethernet cable insertion/removing. Every peripheral device connected to a computer usually first identifies it self into a computer and then offer/issue how it will be connected/contacted using(Port). So I think that might help as a start and my direct you to the right direction.

Once you have detected, you will have to check its description to see what it is: check this:

This is for detecting plugged and removed USB device with it drive letter:

 Public Enum WM_DEVICECHANGE_WPPARAMS As Integer
 DBT_CONFIGCHANGECANCELED = &H19
 DBT_CONFIGCHANGE = &H18
 DBT_CUSTOMEVENT = &H8006
 DBT_DEVICEARRIVAL = &H8000
 DBT_DEVICEQUERYREMOVE = &H8001
 DBT_DEVICEQUERYREMOVEFAILED = &H8002
 DBT_DEVICEREMOVECOMPLETE = &H8004
 DBT_DEVICEREMOVEPENDING = &H8003
 DBT_DEVICETYPESPECIFIC = &H8005
 DBT_DEVNODES_CHANGED = &H7
 DBT_QUERYCHANGECONFIG = &H17
 DBT_USERDEFINED = &HFFFF
 End Enum

 REM: Device info structure for table.

 Public Structure DEV_BROADCAST_HDR
 Public dbch_size As Int32
 Public dbch_devicetype As Int32
 Public dbch_reserved As Int32
 End Structure

 REM: Volume info Structure

 Private Structure DEV_BROADCAST_VOLUME
 Public dbcv_size As Int32
 Public dbcv_devicetype As Int32
 Public dbcv_reserved As Int32
 Public dbcv_uninmask As Int32
 Public dbcv_flags As Int16
 End Structure

 REM: Function to get drive letter

 Private Function GetDriveLetterFromMask(ByRef Unit As Int32) As Char
 For i As Integer = 0 to 25
 If Unit = (2 ^ i) Then
 Return Chr(Asc("A") + i)
 End If
 Next
 End Function

 REM: Implementation of WndProc() method

 Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
 If QueryCancelAutoPlay = 0 Then
 QueryCancelAutoPlay = RegisterWindowsMessage("QueryCancelAutoPlay")
 End If
 If m.Msg …
Mr.M 89 Future Programmers

This is how I did it.

 Sub countR()
 ConnDB()
 Dim sql As String = "select COUNT (*) FROM register"
 Dim cmd As New OleDbCommand(sql, conn)
 dr = cmd.ExecuteReader()
 While (dr.Read())
 lblTotalR.Text = (dr(0).Tostring())
 End While
 End Sub
Tafadzwa_3 commented: Where is dr declared and how do you delcare dr +0
Mr.M 89 Future Programmers

Just made some modifications on my code as follows:

 ConnDB()
 Dim da As New OleDbDataAdapter(("select username, regDate, birthdate, LastSeen from mytable;"), conn)
 Dim dt As New DataTable
 da.Fill(dt)
 Try
 If dt.Rows.Count > 0 Then
 Musername = dt.Rows(0).Item("username") & ""
 MregDate = dt.Rows(0).Item("regDate") & ""
 Mbirthdate = dt.Rows(0).Item("birthdate") & ""
 MlastSeen = dt.Rows(0).Item("lastSeen") " ""

Now this does give me the record on my client side but the problem is that its only give one record. Currently I have 5 records on my database, what I'm trying to do is get all these records data but only the selected columns.

I don't want to send out the complete person record but only a selected columns data I want to send.

I'm not sure if I have to use a For Each and if I have to use it. How could I apply to my scenario.

I've also looked through this https://www.commandprompt.com/ppbook/x5802 and found the plan that I've used on this code post. I saw another with select * from mytabe WHERE scondition = condition which would have perfectly answered/solved my problem if it had worked on me but it didn't. The client side just froze.

This would have answered because I would use the scondition where let say I want to get all the currently online users I would have done it like this: select * FROM myTable WHERE lastSeen = Online;" that would have solved my problem but this didn't work as I've stated that the …

Mr.M 89 Future Programmers

Hi Dw.

I have a MS Access database that has 9 columns what I want to do is to retrieve all data from a database only on 5 columns.

I think I have to use the select * from data but I don't know how to select the columns I want to retrieve because I can't use the WHERE test = '" because I want to retrieve all database records but only selected columns.

A very good example of what I want to achieve is thisselect all usernames, birthdates, last_seen_status now this is just an example where a database has users records in the database you may have as many columns as possible including name, surname, sex, location, username, last_seen_status,birthdates, registration_Date and more but only need to retrieve data from 'username,birthdates,last_seen_status` from the database for all the users that had registered or is registered in this database.

Hope I didn't confuse you on this. I saw something with wildcards but was a bit complicated the problem is that I didn't know how to apply it to my scenario. I saw it here: http//www.codeguru.com/columns/vb/doing-data-extraction-with-visual-basic.net.htm

Mr.M 89 Future Programmers

Ok. I have just looked through the code and half of the attachment because of my internet. But I have some Questions.

Why you have

 With ProgressBar1
.Style = ProgressBarStyle.Blocks
.Step = 1
.Minimum = _MinProgressbarValue
.Maximum = _MaxProgressbarValue
.Value = _ProgressbarValue
End With

Twice and also why > because if the progress value is more then 100 the error is thrown?

Also if you say you are using a MDI then try something like this:

For Each xChild As Form In Me.MdiParent.MdiChildren
xChild.Close()
Next xChild

To see if all active child forms won't close.

Mr.M 89 Future Programmers

I think what you will need is something like this "For i As String = F To O" but not sure if it works with alphabets and a you can notice I didn't add the "Step" because I don't know how in alphabets but in numbers the step would be "1" or "-1".

Then in your code you would need to change "F" to "i".

Mr.M 89 Future Programmers

Yes that's achievable, you will have to make sure you have used an extension that is not used by any file, since the sample I did bellow only checks and get a list of files but an extension. Also since you will be working with two extension you will have to code them separately one for extracting which will search for ".gov" and change it to ".sql".

Suppose your path is "D:\Test\" and you have more then one file inside. So you can do it like this:

 Dim D As DirectoryInfo = New DirectoryInfo("D:\Test\")
 For Each File As FileInfo In D.GetFiles("*.sql")
 Dim OriginalFileName As String
 OriginalFileName  = File        
 Dim result As String
 result = Path.ChangeExtension(OriginalFileName, ".gov")
 File.Move(OriginalFileName ,result)
 Next

Now you can use the very same code above for searching for ".gov" files to change them back to ".sql". Also note that you will have to swap around the extension to set it back to the original.

You can place the above code under a button to change extension, then copy it again and past it on the button to set to original and on the code just change the extensions.

HTH.

Mr.M 89 Future Programmers

Check the below code. You need to pull the image.

 Dim connection As New SqlConnection("connection string here")
 Dim command As New SqlCommand("SELECT Picture FROM MyTable
 WHERE ID = 1", connection)

 connection.Open()

 Dim pictureData As Byte() = DirectCast(command.ExecuteScalar(),
 Byte())

 connection.Close()

 Dim picture As Image = Nothing

 'Create a stream in memory containing the bytes that comprise
 the image.
 Using stream As New IO.MemoryStream(pictureData)
 'Read the stream and create an Image object.      from the data.
 picture = Image.FromStream(stream)
 End Using

Note how image is read from database before displaying.

Mr.M 89 Future Programmers

Ow you can do as ddanbe said or put a label in your Form1, your choice and if you want to display a message then you can just hide the label and point Form1 to send message to this label then on Form2 point it to retrieve this message.

ddanbe commented: Good advice. +15
Mr.M 89 Future Programmers

That's great. I think you may now mark this question as solved then.

Mr.M 89 Future Programmers

@Dj yes I agree, I posted the use new line early then later when I was in front of my pc I then noticed that its not working. But I got your point there.

@Wishala you should have cleared that out, if so then you can use Dj's suggestion.

Mr.M 89 Future Programmers

@DJ but there are situations where the items are retrieved somewhere maybe from a file or from a database then are added to a control, so I think we shouldn't stick much to the way of how the OP is adding because we may find that the data is retrieved some where else and it is dynamically updated so the OP may need to add it just like how he do, unless the data won't be updated at a later stage then the OP can add it internally or within IDE. Just saying

Mr.M 89 Future Programmers

I've just worked with another project where the OP was also doing something similar except that, that's OP wanted to make more then one selections at the same time, as I worked with that's OP's question I noticed that even if you add the code for new line, the new line won't be added so I prefer you use ListBox instead of ListView, unless its a must do with a ListView.

ListView seemed to me that it had some limitations on doing things with it. With a ListBox what you require can be achieved so early.

Mr.M 89 Future Programmers

An example based on your above code will be:

 List1 = Me.lsv1.Items.Add(Me.txtDescription.Text & Vb.NewLine)
 List1 = Me.lsv1.Items.Add(Me.txtPrice.Text & Vb.NewLine)

Something like this should help do what you intend to do.

Mr.M 89 Future Programmers

You need to add

 &VbNewLine

at the end of the add statement so that when you click twice it will write the data on a new line below the previously added data.

Mr.M 89 Future Programmers

Don't forget, if your question has been answered to mark it as solved.

Mr.M 89 Future Programmers

The above is one URL address, it also have a very good example of how to use it.

Mr.M 89 Future Programmers
Mr.M 89 Future Programmers

WebClient.DownloadFile seem to be easy to work with, have a look at it.

stackoverflow.com/questions/4066082/download-file-in-vb-net-2010

Mr.M 89 Future Programmers

Does the user have a place where s/he will enter the address or the browser retrieve the URL somewhere? If the user is the one entering the URL then you can simply check the entered address and if its youtube address then instruct WebBrowser to browse to that other address.

Also please capture and post here the error so we can see, also another thing is that before you can start doing anything with WebBrowser you need to start by this code:

  On Error Resume Next

  ' This should solve your problem.
  If WebBrowser1.Url.PathAndQuery.Equals("http://www.youtube.com") Then
 ' MsgBox("You have entered youtube website.")
 WebBrowser1.Navigate("http://www.google.com")
 Else
 ' MsgBox("Other address entered")
 End If

Hope that will answer your question.

Mr.M 89 Future Programmers

Hi DW

I have a Canon MP250 printer which can scan, copy, and print. I want to create my own ScanGear of a direct program to instruct the printer to print, and scan. I do have the disc that came with the printer but I just want to play around with it and like create my own app that will send printing commands to the printer and scanning commands to the printer to scan documents.

The main idea is not to use any of their software but be able to communicate with it and still do the printing, scanning functions as if I had installed their software's. I don't want to have their scangear on my laptop but rather create the program that will directly communicate with the device.

Anyone know how I can create this app or any link, documentation or anything that may point to the right direction with clues.

Thank you.