cgeier 187 Junior Poster

In "Main.cpp", line 63 should be cout << "Number inserted:" << num << endl;

In "Main.cpp", there are multiple problems with "ProcessMenu".

  • No "do" for the while statement
  • case1 should be case 1 (you need a space between the word "case" and the number 1)
  • In "ShowMenu" you offer an option to print, but don't have a case statement for it in "ProcessMenu"
  • You don't offer an option to quit

Try the following for ShowMenu:

int ShowMenu(void)
{
    int option;
    cout << "\n\t" << endl;
    cout << "\t\t===============================" << endl;
    cout << "\t\t1. Insert into tree" << endl;
    cout << "\t\t2. Print tree" << endl;
    cout << "\t\t3. Quit" << endl;
    cout << "\t\t===============================" << endl;
    cout << endl;

    cout << "Choose an option: ";

    cin >> option;
    return option;
}//ShowMenu

Try the following for "ProcessMenu":

void ProcessMenu(TreeType<T>& tree)
{
    bool quit = false;
    do{
        switch (ShowMenu())
        {
            case 1:
                InsertItem(tree);
                break;
            case 2: 
                PrintTree(tree);
                break;
            case 3:
                quit = true;
                break;
            default:
                cout << "Error: Invalid option. Try again." << endl;
        }//switch
    } while (!quit);

}//ProcessMenu
cgeier 187 Junior Poster

If this only happens when using under battery power, it could be a bug in the video driver, the video chip, or a bug in the OS. You may consider opening a case with HP, although there may be a fee involved. You can download the latest Intel video driver from the Intel website. However, if you open a case with HP, they will most likely insist that you download the latest driver from the HP website, which may or may not actually be the latest driver, but rather the last driver that they've tested on that model of computer. As a work-around, you can try changing some of the power settings. See http://windows.microsoft.com/en-us/windows7/products/features/power-management . I don't have access to a computer right now, but look for any settings for video--can't remember, at the moment, if there are any. Can also try changing the processor minimum (on battery) to a higher number. Start with 100% and see if the issue still occurs.

cgeier 187 Junior Poster

Replace the '/' between yyyy and hh and it may work. It looks like your database design could use some work. Is this a theoretical resort (ie: homework assgmt) or a real place. After looking through your project I had difficulty figuring out where swimming type comes into play. Can ppl just visit to use the pool/beach and pay a small fee? Is there an extra fee for additional people when renting a cottage/room?

cgeier 187 Junior Poster

Also, you should Use Parameterized Queries to Avoid SQL Injection Attacks

For example, in "frmAdmin" (btnSave_Click) you have the following code:

Dim cmdsave As New OleDbCommand("INSERT INTO Room(id,Room_Name,Available,Quantity,Price)" & _
                                "VALUES('" & txtid.Text & "','" & txtname.Text & "'," & _
                                " '" & txtquantity.Text & "','" & txtquantity.Text & "','" & txtprice.Text & "')", conn)

cmdsave.ExecuteNonQuery()

to change to use parameterized queries, do the following:

Dim cmdsave As New OleDbCommand("INSERT INTO Room(id,Room_Name,Available,Quantity,Price)" & _
                                        "VALUES(@id, @Room_Name, @Available, @Quantity, @Price", conn)

Then add the parameters using one of the following methods (versions).

Version 1: (use AddWithValue)

cmdsave.Parameters.AddWithValue("@id", txtid.Text)
cmdsave.Parameters.AddWithValue("@Room_Name", txtname.Text)
cmdsave.Parameters.AddWithValue("@Available", txtquantity.Text)
cmdsave.Parameters.AddWithValue("@Quantity", txtquantity.Text)
cmdsave.Parameters.AddWithValue("@Price", txtprice.Text)

Version 2: (specify data type)

cmdsave.Parameters.Add("@id", OleDbType.VarChar).Value = txtid.Text
cmdsave.Parameters.Add("@Room_Name", OleDbType.VarChar).Value = txtname.Text
cmdsave.Parameters.Add("@Available", OleDbType.VarChar).Value = txtquantity.Text
cmdsave.Parameters.Add("@Quantity", OleDbType.VarChar).Value = txtquantity.Text
cmdsave.Parameters.Add("@Price", OleDbType.VarChar).Value = txtprice.Text

Version 3:

Dim idParam As New OleDbParameter("@id", txtid.Text)
cmdsave.Parameters.Add(idParam)

'do similarly for the other parameters

Version 4:

Dim idParam As New OleDbParameter("@id", OleDbType.VarChar)
idParam.Value = txtid.Text
cmdsave.Parameters.Add(idParam)

'do similarly for the other parameters

There are other ways of adding the parameters, these are just a few.

Then execute:

cmdsave.ExecuteNonQuery()
cgeier 187 Junior Poster

The answer to my question is:

Dim chart1 As New System.Windows.Forms.DataVisualization.Charting.Chart

In order to use it one needs to first be using .NET >= 4. Then a reference needs to be added to System.Windows.Forms.DataVisualization

Add Reference to System.Windows.Forms.DataVisualization:

-Project
-Add Reference
-.NET (tab)
-System.Windows.Forms.DataVisualization

Then add the following "Imports" statement: Imports System.Windows.Forms.DataVisualization

Your issue seems to be on line #29 (line #3 in the original post):
Chart1.Series["Series1"].BorderWidth = 3 should be Chart1.Series("Series1").BorderWidth = 3. VB .NET uses parentheses, not square brackets.

cgeier 187 Junior Poster

Here are 3 methods that each accomplish this:

getFolderNameGD (System.IO.Directory.GetDirectories) - version 1:

Public Function getFolderNameGD(ByVal fullyQualifiedFolderName As String, ByVal searchPattern As String)

    'return directory that matches searchPattern
    For Each fqDirName As String In System.IO.Directory.GetDirectories(fullyQualifiedFolderName, searchPattern, System.IO.SearchOption.TopDirectoryOnly)
        Return fqDirName
    Next

    Return String.Empty
End Function

getFolderNameGDI (System.IO.DirectoryInfo) - version 2:

Public Function getFolderNameGDI(ByVal fullyQualifiedFolderName As String, ByVal searchPattern As String)

    Dim di As New System.IO.DirectoryInfo(fullyQualifiedFolderName)
    Dim dirInfoArr() As System.IO.DirectoryInfo = di.GetDirectories(searchPattern, System.IO.SearchOption.TopDirectoryOnly)

    'return directory that matches searchPattern
    For Each d As System.IO.DirectoryInfo In dirInfoArr
        Return d.FullName
    Next

    Return String.Empty
End Function

getFolderNameED (System.IO.EnumerateDirectories) - version 3:

Public Function getFolderNameED(ByVal fullyQualifiedFolderName As String, ByVal propertyNumber As String)

    'return directory that starts with 
    'property number followed by a space and a "-"
    For Each fqDirName As String In System.IO.Directory.EnumerateDirectories(fullyQualifiedFolderName)
        Dim dirName = fqDirName.Replace(System.IO.Path.GetDirectoryName(fqDirName) & "\", "")

        If dirName.Substring(0, dirName.IndexOf("-") - 1) = propertyNumber Then
            'Debug.WriteLine("dirName ED: " & dirName)
            Return fqDirName
        End If
    Next

    Return String.Empty
End Function

Usage:

'version 1
Dim foldernameGD As String = getFolderNameGD("C:\Temp\Revenue Management\Centralized Revenue Management Service\CRMS Hotels", "1504 -*")

'version 2
Dim foldernameGDI As String = getFolderNameGDI("C:\Temp\Revenue Management\Centralized Revenue Management Service\CRMS Hotels", "1504 -*")

'version 3
Dim foldernameED As String = getFolderNameED("C:\Temp\Revenue Management\Centralized Revenue Management Service\CRMS Hotels", "1504")

example folder name: "1504 - FPbs Meriden"

cgeier 187 Junior Poster

The following is a continuation of my above post.

To serialize the XML (write the XML to file), we will create a static class called "ClsXmlHelper" and add an instance of our "Table" class (ClsTable).

ClsXmlHelper.cs:

public static class ClsXmlHelper
{
    //create instance of root attribute (Table) class
    public static ClsTable myClsTable = new ClsTable();

}//class

Add the following "using" statements:

using System.IO;
using System.Xml;
using System.Xml.Serialization;

Serializing is quite simple:

public static class ClsXmlHelper
{

    //create instance of root attribute (Table) class
    public static ClsTable myClsTable = new ClsTable();

    public static void serializeToXml(string filename)
    {
        //writes Xml to file

        //create new instance of StreamWriter
        StreamWriter sw = new StreamWriter(filename);

        //create new instance of XmlSerializer(<your class>.GetType)
        XmlSerializer mySerializer = new XmlSerializer(myClsTable.GetType());

        //serialize - write data to file
        mySerializer.Serialize(sw, myClsTable);

        //close StreamWriter
        if (sw != null)
        {
            sw.Close();
        }//if

    }//serializeToXml
}//class

If you want to eliminate the namespaces and the XML declaration in the XML file, use the following instead:

public static class ClsXmlHelper
{

    //create instance of root attribute (Table) class
    public static ClsTable myClsTable = new ClsTable();

    public static void serializeToXml(string filename)
    {
        //writes Xml to file

        //create new instance of StreamWriter
        StreamWriter sw = new StreamWriter(filename);

        //create new instance of XmlSerializer(<your class>.GetType)
        XmlSerializer mySerializer = new XmlSerializer(myClsTable.GetType());

        //eliminate "xsd" and "xsi" namespaces
        XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
        ns.Add(string.Empty, "urn:none");

        //indent Xml and eliminate Xml declaration
        XmlWriterSettings myXmlWriterSettings = new XmlWriterSettings();
        myXmlWriterSettings.OmitXmlDeclaration = true;
        myXmlWriterSettings.Encoding = Encoding.UTF8;
        myXmlWriterSettings.Indent = true;

        //create instance of XmlWriter …
cgeier 187 Junior Poster

I haven't used Linq, but if you know how to use Linq with a List, then you should be able to use the following--it uses XmlSerializer. I see a discrepancy in what you posted above. There would be no need to do where GroupName="Name" if the file only contained one GroupName. So, I will assume an XML file that looks like the following:

Table.xml

<Table>
  <GroupPermissions>
    <Group GroupName="Group1">
      <ModuleRestrictions>
        <Module1>
          <Button1 value="true" />
        </Module1>
      </ModuleRestrictions>
    </Group>
    <Group GroupName="Group2">
      <ModuleRestrictions>
        <Module1>
          <Button1 value="false" />
        </Module1>
      </ModuleRestrictions>
    </Group>
  </GroupPermissions>
</Table>

To use XmlSerializer, we will use nested classes.

"Table", "GroupPermissions", "Group", "ModuleRestrictions", "Module1", and "Button1" are XML elements (these will be denoted by "XmlElement" or "XmlElementAttribute"). Each one of these will be it's own class.

"Group" contains an attribute named "GroupName". This will be denoted as an "XmlAttribute". Likewise, "Button1", contains an attribute named "value".

In the XML file "Table.xml", more than one "Group" element exists. So, we need to use something that allows for more than one instance of "Group"--we will use a List for this.

Let's get started.

Note: It is necessary to add using System.Xml.Serialization; statement to each class (file).

You can name the classes anything you want as long as you specify the actual name of the element in the XML file using "ElementName" (if "ElementName" isn't specified, XmlSerializer, will assume that the class name matches the element name). Likewise, with variable and class instance names.

I will start all of the class names with "Cls". …

ddanbe commented: Great! +15
cgeier 187 Junior Poster

"People don't care how much you know until they know how much you care." -- Zig Ziglar

cgeier 187 Junior Poster

The following would be a close translation:

Dim fn As String = "C:\MyTextFile.txt"
Dim sr As New StreamReader(fn)
Dim LineFromFile As String = Nothing
Dim textRowNo As Integer = 0
Dim arrival As String = Nothing
Dim status As String = Nothing

'...

While Not sr.EndOfStream
    textRowNo += 1
    LineFromFile = sr.ReadLine()

    If textRowNo > 8 Then
        arrival = Mid(LineFromFile, 1, 9)
        status = Trim(Mid(LineFromFile, 11, 3))

        '...

    End If

End While

sr.close()

Note: The above code is a translation of the code you posted and hasn't been reviewed for efficiency.

Click here for the resource code was translated from.

Santanu.Das commented: Fine work +4
cgeier 187 Junior Poster

Your power adapter is probably not working. Try using a different power adapter.

cgeier 187 Junior Poster

Change lines 40-42

from:

i += 1
TextBox1.Text = dt.Rows(i)(0)
TextBox2.Text = dt.Rows(i)(1)

to:

'last index is dt.Rows.Count - 1
'only increment if doing so
'would not exceed the index
If i < dt.Rows.Count - 2 Then
    i += 1
Else
    'set to the last row
    i = dt.Rows.Count - 1
End If

If dt IsNot Nothing Then
   TextBox1.Text = dt.Rows(i)(0)
   TextBox2.Text = dt.Rows(i)(1)
End If
Ashveen96 commented: i tried it, still same error +0
cgeier 187 Junior Poster

In "frmBirthdayCake_Load", the connection is not open. Where is con.Open?

Ashveen96 commented: i tried it, still same error +0
cgeier 187 Junior Poster

Is power connected to the hard drive? If so, you may consider using a power supply tester to ensure your power supply is functioning properly.

Here is a page stating that they are selling a 2 tb hdd pulled from a working Dell 760. Therefore, it must be possible to use a 2 tb drive in that model.

This is a genuine OEM Dell Optiplex 760 7200RPM hard drive. This hard drive was pulled from a working Dell Optiplex 760 computer and is guaranteed to work with all Dell Optiplex 760 computers.

Optiplex 760 and 3TB Hard Disk Windows 7

Beyond 2TB
Using a hard drive larger than 2.1TB on Windows-based computer systems may require special setup considerations

Beyond 2TB Video

cgeier 187 Junior Poster

What hard drive brand/model?

Which version of the Optiplex 760 do you have?

Here are the power specs:
OptiPlex 760 Desktop Tech Specs

Mini-Tower

305W Standard Power Supply; 255W 88% Efficient Power Supply, ENERGY STAR 5.0 compliant, Active PFC

Desktop

255W Standard Power Supply; 255W 88% Efficient Power Supply, ENERGY STAR 5.0 compliant, Active PFC

Small Form Factor

235W Standard Power Supply; 255W 88% Efficient Power Supply, ENERGY STAR 5.0 compliant, Active PFC

Ultra Small Form Factor

220W External PSU, ENERGY STAR 5.0 compliant.

The following article may be of interest:
Dell Optiplex 760 Upgrade Project

mouaadable commented: thank you +1
cgeier 187 Junior Poster

Looks like UPS has a program for software developers. Did you contact them?

UPS Developer Kit

UPS Developer Kit Community

UPS Developer Resource Center

UPS Ready Program

cgeier 187 Junior Poster

This documentation also provides some information on Maxicode (although it doesn't look like their product supports .NET).

cgeier 187 Junior Poster

The following seems to work with Outlook 2010:

Add reference to Outlook Object Library:

  • Project
  • Add Reference
  • COM
  • Microsoft Outlook xx.x Object Library

Add the following "using statements":

  • using System.Runtime.InteropServices;
  • using Outlook = Microsoft.Office.Interop.Outlook;

Declare the constants as seen below:

//Content-id - MIME
private const string PR_ATTACH_CONTENT_ID_A = "http://schemas.microsoft.com/mapi/proptag/0x3712001E";
private const string PR_ATTACH_CONTENT_ID = "http://schemas.microsoft.com/mapi/proptag/0x3712001F";

//binary attachment data
private const string PR_ATTACH_DATA_BIN = "http://schemas.microsoft.com/mapi/proptag/0x37010102";

//formatting info for attachment
private const string PR_ATTACH_MIME_TAG_A = "http://schemas.microsoft.com/mapi/proptag/0x370E001E";
private const string PR_ATTACH_MIME_TAG = "http://schemas.microsoft.com/mapi/proptag/0x370E001F";

//set to true for hidden attachments
//undefined otherwise and will throw an exception if queried
private const string PR_ATTACHMENT_HIDDEN = "http://schemas.microsoft.com/mapi/proptag/0x7FFE000B";

mergeTemplates:

private void mergeTemplates(string templatePath1, string templatePath2)
{

    string tempDir = System.Environment.GetEnvironmentVariable("TEMP");

    Outlook.Application oApp = new Outlook.Application();

    if (!tempDir.EndsWith(@"\"))
    {
        tempDir += @"\";
    }//if

    //put first template into a MailItem
    Outlook.MailItem newMail1 = oApp.CreateItemFromTemplate(templatePath1);

    //put second template into a MailItem
    Outlook.MailItem newMail2 = oApp.CreateItemFromTemplate(templatePath2);

    //create a new MailItem for our merged template
    Outlook.MailItem mergedMailItem = oApp.CreateItem(Outlook.OlItemType.olMailItem);

    //merge HTMLBody from newMail1 and newMail2
    mergedMailItem.HTMLBody = newMail1.HTMLBody + System.Environment.NewLine + newMail2.HTMLBody;


    if (newMail1.Attachments.Count > 0)
    {
        for (int i = 1; i <= newMail1.Attachments.Count; i++)
        {
            string tempFn = tempDir + newMail1.Attachments[i].FileName;

            //save attachment from template to temp file
            newMail1.Attachments[i].SaveAsFile(tempFn);

            //add attachment
            Outlook.Attachment mergedMailItemAttachment = mergedMailItem.Attachments.Add(tempFn);

            //delete temp file
            System.IO.File.Delete(tempFn);

            //get content-id from template
            string imageCidA = newMail1.Attachments[i].PropertyAccessor.GetProperty(PR_ATTACH_CONTENT_ID_A);
            string imageCid = newMail1.Attachments[i].PropertyAccessor.GetProperty(PR_ATTACH_CONTENT_ID);

            //set content-id
            mergedMailItemAttachment.PropertyAccessor.SetProperty(PR_ATTACH_CONTENT_ID_A, imageCidA);
            mergedMailItemAttachment.PropertyAccessor.SetProperty(PR_ATTACH_CONTENT_ID, imageCid);

            //make attachment hidden
            mergedMailItemAttachment.PropertyAccessor.SetProperty(PR_ATTACHMENT_HIDDEN, true);

            //set …
cgeier 187 Junior Poster

Are you required to use InputBox? Not sure why you are using ListBox for those things.

  1. Prompt user for French marks (handle invalid entries)
  2. Prompt user for German marks (handle invalid entries)
  3. Prompt user for Spanish marks (handle invalid entries)
  4. Add marks to ListBox
  5. Calculate percentage mark
  6. Display result

Note: Re-check your calculation. Consider displaying your message using a Label, MessageBox, etc.

Consider using a ComboBox for each mark type and populate it with numbers 1-30.

Danny_7 commented: Hey, i was asked by a teacher to use a listbox, anyways is that the pseudocode then yea? +0
cgeier 187 Junior Poster

The following may be of interest:
Packet loss

Here are a few ideas.

Possible issue 1:
Packet loss due to network flooding. This could be caused by a bad network card, a virus, etc.

Tests:
Unhook all computers except for one, and test for packet loss. Repeat for the other two computers.

Repeat test using a clean computer--one that has a newly installed OS, or one that is known to work from another site--this will eliminate any computer hardware issues and the possibility of a virus/malware. Connect this computer to the cable from one of the other computers.

Possible Issue 2: Noise/interference on/in the cabling from the environment (such as fluorescent lighting, or other electro-magnetic interference)

Test:
Using clean computer, repeat test close to the router, using a 1-2 m cable to connect to the router. Disconnect all other cables at the router. Test for packet loss again.

cgeier 187 Junior Poster

You didn't copy the code correctly. Copy the code as is, line-by-line.

Check line #6:
BtnName = selectedBtn should be BtnName = selectedBtn.Name

Also, when renaming variables, rename all occurrences of the variable.

Pre-requisites:

  • Add 5 buttons to a form named "Form1.vb", name them as follows: A3, A4, A5, A6, A7

Form1.vb:
Note: I changed "sender.BackColor" to "selectedBtn.BackColor"--although either will work.

Public Class Form1

    Private BtnName As String = String.Empty

    Private Sub A3_Click(sender As System.Object, e As System.EventArgs) Handles A3.Click, A4.Click, A5.Click, A6.Click, A7.Click
        Dim selectedBtn As Button = sender

        If String.IsNullOrEmpty(BtnName) Then
            BtnName = selectedBtn.Name
            selectedBtn.BackColor = Color.Red
        Else If BtnName = selectedBtn.Name Then
            BtnName = String.Empty
            selectedBtn.BackColor = Control.DefaultBackColor
        Else
            'can only select 1 btn
            MsgBox("You can only select one seat for every Process")
        End If

    End Sub

End Class

Note: In this kind of scenario, one should probably be able to click on another button without having to de-select the previous one. Change the color on the previous button pressed back to the default color, and change the color of the newly pressed button to red.

cgeier 187 Junior Poster

Move Console.ReadLine(); inside the loop so that it pauses between loop iterations.

      ...
Console.ReadLine();

} while (true);
      ...

Add some WriteLine statements (for debugging).

           ...
number1 = number.Next(1, 31);
number2 = number.Next(1, 31);
operators = number.Next(1, 5);  // 1 = add, 2 = minus, 3 = multiply, 4 = divide

Console.WriteLine("number1: " + number1); //debugging
Console.WriteLine("number2: " + number2); //debugging
Console.WriteLine("operators: " + operators); //debugging
Console.WriteLine(); //debugging

Console.WriteLine("\tMath Problems\n");
            ...

Continue writing code to solve the rest of your identified problems:

  • Allow user to enter a numeric answer to the math problem
  • Display average score
  • Items: 4, 5, 6, 8, 9, 10, 11 that you identified above.
cgeier 187 Junior Poster

You can try the following:

Option 1:

  • Turn computer on. Press "F10" repeatedly (once or twice per second).
  • If prompted to "Edit Windows boot options...", press the escape key.
  • If the Windows Boot Manager screen appears ("Choose an operating system to start..."), select the OS you want to boot.

Note: If "F10" doesn't work, reboot and try another "F" key.

Option 2: Use "EasyBCD" as others have stated.

Option 3:

How to Manually Repair Windows 7 Boot Loader Problems

Option 4:
If you don't have the install DVD (or your install DVD doesn't have the "Repair your computer" option), you can create a bootable USB drive using WinPE 5.1 (it is for Win 8.1, but you should be able to use it for Win 7).

To create the bootable USB drive using Win 8 computer:

Demo 2: Installing Windows PE on a USB Drive

To create the bootable USB drive using Win 7 computer:

Download and install Windows Assessment and Deployment Kit (Windows ADK) for Windows 8.1 Update

  • Double-click "adksetup.exe".
  • You either choose Option A: "Install the Windows Assessment and Deployment Kit for Windows 8.1 to this computer" or Option B: "Download the Windows Assessment and Deployment Kit for Windows 8.1 for installation on a separate computer". (I chose Option B: "Download the Windows Assessment...", so I could save it and not have to download it again should I want to install it on another computer. If choosing Option B, …
mike_2000_17 commented: Nice complete explanation! +14
cgeier 187 Junior Poster

The following article may be of interest:

How to handle peripherals support on virtual desktops

cgeier 187 Junior Poster

This is for C# but can be converted: C# send plain text to default printer (Zebra printer) http://stackoverflow.com/questions/19171628/c-sharp-send-plain-text-to-defult-printer-zebra-printer

cgeier 187 Junior Poster

You can't just return to MethodA. MethodA didn't call MethodD--MethodC did. Even with exceptions, if unhandled, they are passed back to the caller. An exception could potentially be passed from D to C to B to A. Also, control needs to be passed back from MethodD to MethodC so clean-up of MethodC can occur--disposing of objects. Why do you feel that you should avoid returning up the chain--from D to C to B to A?

strRusty_gal commented: Thanks =) +3
cgeier 187 Junior Poster

Add the following to the end of the script:

'====================================
'Loop through the files in the
'sub-folders in the path
'from above (objStartFolder)
'====================================

ShowSubFolders objFolder


Sub ShowSubFolders(Folder)
    On error resume next

    For Each Subfolder in Folder.SubFolders


        Set objFolder = objFSO.GetFolder(Subfolder.Path)
        Set colFiles = objFolder.Files

        For Each objFile in colFiles
            if (LCase(objFSO.getextensionname(objFile)) = "jpg") then
            oFile.Write objFolder & "\" & objFile.name & vbCrlf
            end if

        Next

        ShowSubFolders Subfolder
    Next
End Sub

So now you will have:

'====================================
'objStartFolder is where you enter 
'the folder path string
'====================================

objStartFolder = "C:\"
'objStartFolder = "C:\Users\user\Desktop\"
'objStartFolder = "C:\Temp\"

Wscript.Echo objStartFolder

'====================================
'create file system object
'====================================

set objFSO=CreateObject("Scripting.FileSystemObject")

'====================================
'outputFile is where you enter the 
'path and name of the LogFile text
'file.
'====================================

outputFile = "C:\Users\user\Desktop\LogFile.txt"


Set objFolder = objFSO.GetFolder(objStartFolder)
set oFile = objFSO.CreateTextFile(outputFile,True)

Set colFiles = objFolder.Files

'====================================
'Loop through the files in the path 
'from above (objStartFolder)
'====================================


For Each objFile in colFiles

    if (LCase(objFSO.getextensionname(objFile)) = "jpg") then
        oFile.Write objFolder & "\" & objFile.name & vbCrlf
    end if

Next

'====================================
'Loop through the files in the
'sub-folders in the path
'from above (objStartFolder)
'====================================

ShowSubFolders objFolder


Sub ShowSubFolders(Folder)
    For Each Subfolder in Folder.SubFolders

        Set objFolder = objFSO.GetFolder(Subfolder.Path)
        Set colFiles = objFolder.Files

        For Each objFile in colFiles
            if (LCase(objFSO.getextensionname(objFile)) = "jpg") then
            oFile.Write objFolder & "\" & objFile.name & vbCrlf
            end if
        Next

        ShowSubFolders Subfolder
    Next
End Sub

How Can I Get a List of All the Files in a Folder and Its Subfolders?

Stuugie commented: Thank you so much for your assistance here +5
cgeier 187 Junior Poster

The reason for your error is because Mid throws an error if the value of start is < 1.

Mid Function

start: Character position in string at which the part to be taken begins.

InStrRev Function

Usage: InStrRev(string1, string2[, start[, compare]])

string1: Required. String expression being searched.

string2: Required. String expression being searched for.

...

InStrRev returns a value of 0 if string2 is not
found.

Stuugie commented: Thanks for clarifying why the MID Function errored out. +0
cgeier 187 Junior Poster

Try deleting the following code (lines 15-17):

if (LCase(Mid(objFile.Name, InstrRev(objFile.Name,"."))) = ".jpg") then
    oFile.Write objFolder & objFile.name & vbCrlf
end if

and replace it with this:

if (LCase(objFSO.getextensionname(objFile)) = "jpg") then
    oFile.Write objFolder & objFile.name & vbCrlf
end if

Resource:
VBScript: how do I determine file extensions?

The following may also be of interest:
Display All the Subfolders Within a Folder Using VBscript

Stuugie commented: Thanks for this help, I really appreciate it. +5
cgeier 187 Junior Poster

You need help or you need someone to do it for you? If you need help, post the code that you have so far.