|
Why don't you import the tlb? (tlbimp.exe)
If your C# app has the [STAThread] attribute in its entry point, make sure to have an appropriate COM object (registry lookup under the InprocServer32 or LocalServer32 key, ThreadingModel value).
A few suggestions : change the attribute to [MTAThread] (read the docs), create a new thread and create the COM instance from there.
Otherwise, if you can't afford a simple tlbimp, then I suggest to have a c proxy that would start the com object for you.
RSS feed
|
|
|
|
|
Hi,
How can I extend an array like int[] or create a dynamic length's int[]? For example:
int[] a = new int[10];<br />
<br />
for ( int i = 0; i < 10; i ++ ) {<br />
a[i] = i;<br />
}
Now I want a to be int[11] and a[10] = 10, how can I do it?
Thanks.
|
|
|
|
|
|
|
I was able to add the Microsoft Web Browser control in Visual Studio .NET 2003, but alot of the properties are in grey so I can't point url to the control, please tell me exact how I can add a url to the Microsoft Web Browser control I added on my C# windows form application, what code I write? I'm total noob, I only know how to use the IDE but I don't know the C# language syntax, please help X_x;;
http://www.hentaitheme.com
Free Public Ragnarok Online Game Server
|
|
|
|
|
Hi .. just add the Web Browser Control to you application, then use
object flags = 0;
object targetFrame = String.Empty;
object postData = String.Empty;
object headers = String.Empty;
this.axWebBrowser1.Navigate("http://www.ebay.com/", ref flags, ref targetFrame, ref postData, ref headers);
But if you want more informations there are some WebBrowser Source Codes here on Codeproject! That you are a beginner is no problem, but learning is to understanding If you want to program such things you have to learn c#
Greets
Matthias
|
|
|
|
|
you can't just add these codes anywhere right?
object flags = 0;
object targetFrame = String.Empty;
object postData = String.Empty;
object headers = String.Empty;
this.axWebBrowser1.Navigate("http://www.ebay.com/", ref flags, ref targetFrame, ref postData, ref headers);
I mean you have to add those code within something{ } right? but where? X_x;
http://www.hentaitheme.com
Free Public Ragnarok Online Game Server
|
|
|
|
|
Take a look at any of the articles for the basics of c#.
|
|
|
|
|
<br />
public class LogClass <br />
{<br />
private TextBoxBase outputWin = null;<br />
<br />
public LogClass(TextBoxBase win)<br />
{<br />
outputWin = win;<br />
}<br />
<br />
public void ShowMessage(string message)<br />
{<br />
string s = System.DateTime.Now.ToString() + ": " + message + "\r\n";<br />
lock ( this ) <br />
{<br />
if ( outputWin != null ) <br />
{<br />
if ( s.Length + outputWin.TextLength > outputWin.MaxLength ) <br />
{<br />
outputWin.Text = "";<br />
}<br />
outputWin.Text += s;<br />
}<br />
}<br />
}<br />
}<br />
<br />
<br />
public MyClass<br />
{<br />
private System.Windows.Forms.TextBox logBox;<br />
<br />
private void DoSomething()<br />
{<br />
log.ShowMessage("thread running" );<br />
}<br />
<br />
private void button3_Click(object sender, System.EventArgs e)<br />
{<br />
log.ShowMessage( "start test" );<br />
Thread[] t = new Thread[10];<br />
int i = 0;<br />
for ( i = 0; i < 10; i ++ )<br />
{<br />
t[i] = new Thread(new ThreadStart(this.DoSomething));<br />
t[i].Start();<br />
Thread.Sleep(100);<br />
}<br />
<br />
log.ShowMessage( "end test" );<br />
}<br />
}<br />
<br />
public MyClass()<br />
{<br />
log = new LogClass( logBox);<br />
}<br />
<br />
}
My code gets stuck at the LogClass.ShowMessage(). Anybody knows why?
Thanks in advance!
|
|
|
|
|
Hi!
I want to get all Logical Drives, the Directories and the Files of a Server in my Network.
I know how to view all this Stuff on my local Computer (Directory class, File class). But how should i view it on a other Computer in the Net? I tried to do this with the same classes but it didn't work.
Does anyone have an idea?
wg
Christoph Marchgraber
|
|
|
|
|
It's an ugly object model and it overloads the term 'managed' in a bad way for people who started with the CLR, but the WMI based classes in the System.Management namespace are what you are looking for.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Hey,
I created a custom object. For the public properties I used
///
/// xxx
///
and i used also the [description]- attribute.
I build a dll and referenced to it from another application.
The control works fine, but there is no intellisence and no description in the propertybox.
What did I do wrong? In which XML-file I will find al this comments?
Thanks
Bene
|
|
|
|
|
Description attributes should show up in the VS designer automatically. For xml comments, you need to tell Visual Studio to create an xml file (right click your project->Properties->Configuration Properties->XML Documentation file)
The graveyards are filled with indispensible men.
|
|
|
|
|
How can i insert a icon / image into a listview in detail mode in another column than the first one? f.e. i want i icon / image in row 2 instead of text ...
Thank you for your help
Matthias
|
|
|
|
|
There are many articles about how to do this (as well as libraries for which you can download the source to) on CodeProject. Please try searching for an appropriate article.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hello,
is there a way to create and display MS-Excel-Charts in the own application.
I've already imported the office type libraries and can create and manipulate office - objects like charts, workbooks, worksheets and so on.
But I did not find a way to display such a chart in my application.
Is there a way to create a control that can host office ms office objects?
Any hints?
Thanks for Help,
Sören
|
|
|
|
|
SörenH wrote:
But I did not find a way to display such a chart in my application.
You simply can't. Before you can do so, your app must support Active documents, which is a feature expected to come with the next VS.NET release, next year.
Active documents are supported in good ol' MFC/WIN32/ATL/COM programming environments;
Alternative suggestion, the web office components is free. It's an ActiveX and as such can be hosted in an app or in a web page. Lookup msdn for owc10.exe (office xp version).
RSS feed
|
|
|
|
|
Stephane Rodriguez. wrote:
You simply can't.
Well, you can, but it's sort of a hack - display the chart in an Excel sheet in a WebBrowser control.
|
|
|
|
|
Right, although from wiu the poster wants to program against it. At this point, i think he should definitely take the route of owc.
RSS feed
|
|
|
|
|
Hello Stephane,
I'll take a look at this.
Thank you!
|
|
|
|
|
Hai there,
This is probably a mathematical discussion, but I trusted your great minds...
I have a circle divided into 10 equal (pie)chuncks. When I click anywhere in the circle I need to know which (pie)chunck I'm in.
How to calculate/recognize this?
thanx,
Octavie
|
|
|
|
|
I forgot to mention I have a circle image on a WinForm and I'm coding with C# (obviously...)
|
|
|
|
|
<br />
Convert.ToInt32(Math.Floor(5 * (Math.Atan2(click.Y - centerOfCircle.Y, click.X - centerOfCircle.X) / Math.PI + 1)))<br /> will give you a number between 0 and 9 representing the segment that was click, counting clockwise from the left.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Thanx,
I already had this solution and it works great! I'm building a usercontrol with a Dartsboard. That's why I needed the "piechunk" recognition... I also have the next step ready: did I click one of the rings (double, triple, single or double bull)
If everything is done I will publish it on CodeProject...
grtz,
Octavie
|
|
|
|
|
convert the x,y location into polar coordinates...
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|