Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

bubk

@bubk
About
Posts
10
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • C# code snippet need help converting to VB
    B bubk

    Thanks Dave, I believe I understand now...Right now I just want to get the project converted to VB so I can try and understand how it works in VB...yes starting another thread to create and show a form does look like a REALLY bad idea, now that you mention it. thanks again for the help

    Worked on my Machine!

    Visual Basic csharp visual-studio wcf com help

  • Converting a WCF project from C# to VB
    B bubk

    yep, I totally agree and understand, the reason I posted here is I thought maybe there would be a better chance of finding someone who had WCF experience and c#/vb experience :)

    Worked on my Machine!

    WCF and WF csharp wcf com help tutorial

  • C# code snippet need help converting to VB
    B bubk

    I am trying to convert this C# code to vb and am having some trouble, it is from a WCF project located here http://www.codeproject.com/KB/webservices/wcftransfer.aspx?msg=3269789 I did try a online C# to VB translator but what it spit out as code the VS IDE didn't like Here is the piece of code:

                            ThreadStart start = delegate
                            {
                                form = new TProgress(null, port);
                                form.sport = sport;
                                form.Show();
                                form.GetThread = new Thread(new ParameterizedThreadStart(form.GetInvoke));
                                form.GetThread.Start(transfer);
                            };
                            HelpClass.Form.BeginInvoke(start);
    

    this is as far as I have gotten

                        'Dim start As New ThreadStart(AddressOf ) <--Not sure what this delegate is, AddressOf "what"?
                        Dim form As New TProgress(DBNull.Value, port)
                        form.sport = sport
                        form.Show()
                        form.GetThread = New Thread(New ParameterizedThreadStart(AddressOf form.GetInvoke))
                        form.GetThread.Start(Transfer)
                        'HelpClass.Form.BeginInvoke(start)
    

    Thanks in advance...

    Worked on my Machine!

    Visual Basic csharp visual-studio wcf com help

  • Converting a WCF project from C# to VB
    B bubk

    OK, well thanks for looking at it anyway, I appreciate it, I'll keep searching, I just started working with WCF, so I though what better way to learn than to try and convert this project thanks again...

    Worked on my Machine!

    WCF and WF csharp wcf com help tutorial

  • Converting a WCF project from C# to VB
    B bubk

    Sorry, still having trouble here is the entire proc I am trying to recreate in VB

        public IEnumerable<object> SendQuery(string ip, FilesTransfer transfer, int sport)
        {
            int port = 0;
            switch (transfer.Action)
            {
                case Action.Invite:
                    {
                        port = HelpClass.GetAvailablePort();
                        if (MessageBox.Show(string.Format("Accept {0} files from {1}", transfer.Files.Count, transfer.Name), "Files", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            ThreadStart start = delegate
                            {
                                form = new TProgress(null, port);
                                form.sport = sport;
                                form.Show();
                                form.GetThread = new Thread(new ParameterizedThreadStart(form.GetInvoke));
                                form.GetThread.Start(transfer);
                            };
                            HelpClass.Form.BeginInvoke(start);
                            break;
                        }
                        else return new List<object>() { (int)InviteRusult.Cancel, 0 };
    
                    }
                default:
                    {
                        return new List<object>() { (int)InviteRusult.Busy, 0 };
                    }
            }
            return new List<object>() { (int)InviteRusult.Ok, port };
        }
    

    An online C# to VB converter spit this out, but the IDE doesn't like 'Dim start As ThreadStart = Function() Do

        Public Function SendQuery(ByVal ip As String, ByVal transfer As FilesTransfer, ByVal sport As Integer) As System.Collections.Generic.IEnumerable(Of Object) Implements ITransfer.SendQuery
            Dim port As Integer = 0
            Select Case transfer.Action
                Case Action.Invite
                    If True Then
                        port = HelpClass.GetAvailablePort()
                        If MessageBox.Show(String.Format("Accept {0} files from {1}", transfer.Files.Count, transfer.Name), "Files", MessageBoxButtons.YesNo) = DialogResult.Yes Then
                            'Dim start As ThreadStart = Function() Do
                            '    form = New TProgress(Nothing, port)
                            '    form.sport = sport
                            '    form.Show()
    
    WCF and WF csharp wcf com help tutorial

  • Converting a WCF project from C# to VB
    B bubk

    See now if he had inclosed his joke in {} followed by ; I would have gotten the joke right away :-D

    Worked on my Machine!

    WCF and WF csharp wcf com help tutorial

  • Converting a WCF project from C# to VB
    B bubk

    I'll try to be a little bit more specific This is the block of code I am trying to translate

                            ThreadStart start = delegate
                            {
                                form = new TProgress(null, port);
                                form.sport = sport;
                                form.Show();
                                form.GetThread = new Thread(new ParameterizedThreadStart(form.GetInvoke));
                                form.GetThread.Start(transfer);
                            };
                            HelpClass.Form.BeginInvoke(start);
    

    This is what I've got so far, my problem is on the first line AddressOf

                        'Dim start As New ThreadStart(AddressOf) <-- Not sure what this is a delegate of a function, form, ect...
                        Dim form As New TProgress(DBNull.Value, port)
                        form.sport = sport
                        form.Show()
                        form.GetThread = New Thread(New ParameterizedThreadStart(AddressOf form.GetInvoke))
                        form.GetThread.Start(Transfer)
                        'HelpClass.Form.BeginInvoke(start)
    

    thanks

    Worked on my Machine!

    WCF and WF csharp wcf com help tutorial

  • Converting a WCF project from C# to VB
    B bubk

    Sorry if I misunderstood the intent of your reply

    Worked on my Machine!

    WCF and WF csharp wcf com help tutorial

  • Converting a WCF project from C# to VB
    B bubk

    Not looking for a my language is better than your language debate, just a little help that's all :cool:

    Worked on my Machine!

    WCF and WF csharp wcf com help tutorial

  • Converting a WCF project from C# to VB
    B bubk

    I am having trouble converting this section of code from c# to vb also not all that versed in threading. This code came from an example I found on Code project http://www.codeproject.com/KB/webservices/wcftransfer.aspx?msg=3269789 Any help would be appreciated thanks in advance

                            ThreadStart start = delegate
                            {
                                form = new TProgress(null, port);
                                form.sport = sport;
                                form.Show();
                                form.GetThread = new Thread(new ParameterizedThreadStart(form.GetInvoke));
                                form.GetThread.Start(transfer);
                            };
                            HelpClass.Form.BeginInvoke(start);
    

    Worked on my Machine!

    WCF and WF csharp wcf com help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups