The VNC Manager - SmartCode Solutions Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



C# sample server, problems. Please Help Expand / Collapse
Author
Message
Posted 7/31/2008 4:08:33 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/5/2008 1:41:47 PM
Posts: 2, Visits: 3
This method cannot be used while the control running in the "design-time" mode.

I get this error every time I try to execute this code.

I need to be able to use the API, without adding it to a form.
The reason for this is because it will be run as a service on client machines.

How would I perform this funcionality?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace vnctester

{
       
public partial class Form1 : Form
       
{
            ServerX.
CSC_ServerXControl XServer = new ServerX.CSC_ServerXControl();

        public Form1()
       
{
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            XServer.AddClientEx(
"an ip address", 5500, "ID:1234");
        }
    }
}

Post #2149
Posted 7/31/2008 10:27:22 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 1/2/2009 6:42:35 PM
Posts: 863, Visits: 1,417
Hi,
have you tried to create a hidden Form with ServerX placed on it?



Kindest Regards,
SmartCode Solutions Support
Post #2150
Posted 8/5/2008 11:15:15 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/5/2008 1:41:47 PM
Posts: 2, Visits: 3
Yes,

Here is the problem I run into.

My program is not forum oriented it's component driven and multi threaded.
When I do add a hidden forum I get this error.

ActiveX control '8818cf4d-2190-49c3-b7eb-b9f2ae198cb1' cannot be instantiated because the current thread is not in a single-threaded apartment.

It will not allow me to add the activeX object to a component.

Is their a way to run this in a multi-threaded application?

Post #2154
Posted 8/5/2008 7:16:45 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 1/2/2009 6:42:35 PM
Posts: 863, Visits: 1,417
Are you getting this error while adding the ActiveX to a .Net or native Win32 based application.

Also, you don't use the ActiveX inside a SingleClick package, do you? If you do, please note that there is a bug in the Microsoft's manifest file generator; it's spells the appointment value incorrectly.



Kindest Regards,
SmartCode Solutions Support
Post #2155
Posted 8/28/2008 7:01:18 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/28/2008 6:55:37 PM
Posts: 10, Visits: 10
If you use the COM wrappers for .NET in the sample code everything works great.
Post #2177
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Support (s-code), Alex (s-code)

Permissions Expand / Collapse

All times are GMT -8:00, Time now is 5:04pm

Powered by InstantForum.NET v4.1.4 © 2009
Execution: 0.172. 8 queries. Compression Disabled.