SmartCode Solutions Web Forum




C# sample server, problems. Please Help

Author Message
 Posted Thursday, July 31, 2008
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Tuesday, August 05, 2008
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
Add to Twitter Add to Facebook
 Posted Thursday, July 31, 2008
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Monday, February 06, 2012
Posts: 1,582, Visits: 2,954
Hi,
have you tried to create a hidden Form with ServerX placed on it?


http://www.s-code.com/App_Themes/Default/images/blue_line.gif
We are looking for investors and business partners. Please contact us for more details

Kindest Regards,
SmartCode Solutions Support
Post #2150
Add to Twitter Add to Facebook
 Posted Tuesday, August 05, 2008
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Tuesday, August 05, 2008
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
Add to Twitter Add to Facebook
 Posted Tuesday, August 05, 2008
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Monday, February 06, 2012
Posts: 1,582, Visits: 2,954
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.


http://www.s-code.com/App_Themes/Default/images/blue_line.gif
We are looking for investors and business partners. Please contact us for more details

Kindest Regards,
SmartCode Solutions Support
Post #2155
Add to Twitter Add to Facebook
deX
 Posted Thursday, August 28, 2008
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: Thursday, August 28, 2008
Posts: 10, Visits: 10
If you use the COM wrappers for .NET in the sample code everything works great.
Post #2177
Add to Twitter Add to Facebook


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse