|
The VS.NET Toolbox window can be customized to add ActiveX controls such as the web browser control. When you drop this control onto your form, interop libraries will be automatically built and used.
|
|
|
|
|
please tell me how to use that control( and what they are)!!!
|
|
|
|
|
Tutorial[^]. What this article does not say is that, instead of using the cmdline to extract what's known as interop libraries, you can let the VC#.NET IDE do it for you, by simply dragging the "Microsoft Web Browser control" COM component from the Toolbox to your Form.
|
|
|
|
|
I need to convert a string variable to an array of integers (An ASCII code for each character) and send it over to a Fortran code.
First, I have converted the string var. to an array of char (see below), but how can I convert this (kurt) to an array of integers?
string SetupPath;
char [] kurt;
int [] intFilePath;
.
.
.
kurt=SetupPath.ToCharArray();
intFilePath = ????
.
.
fdc
|
|
|
|
|
I have solved it, with something like this:
for (i=0;i
|
|
|
|
|
|
I create a Windows Service, I allow it to interact with the desktop and I can see the NotifyIcon in the try bar when the service start, but I can't use the Icon.
I explain better:
_I can see the icon
_I can see the tooltip
_I can see the baloon
_I can't see the Context menu when i click with the right mouse button
_I can't execute the action that I assign to the left mouse button.
So, the service can intercact with the desktop, but the user can't interact with the try Icon.
There is a solution?
Thanks for any help.
Regards,
Emanuele
|
|
|
|
|
The NotifyIcon only addresses the issue of the icon in the toolbar. In order for the user to interact with this icon, you have to create the context menu and click events for that menu.
|
|
|
|
|
I have create all.
If i run the app all run ok,
but if i do the same in a service there is that problem....
|
|
|
|
|
|
I have a problem with pointers in C#. In my code, i have to define a struct and one of the element of this struct is a string. But C# don't let us use a string in structs when we use it with pointer. So in struct i use "char". Then when assigning a char to pointer, c# only assigns the first character of the variable. As you see, i have to use a char array with pointers for this. But i couldn't that. Is anybody can tell me how can i do that?
Sierra
|
|
|
|
|
Are you doing this for interop? If so, I suggest reading the "using win32 and other libraries from C#" column here:
http://www.gotdotnet.com/team/csharp/learn/columns/ericgu_column.aspx
|
|
|
|
|
Post your code, I'll give it a look.
|
|
|
|
|
Hi !
I want to read the text shown inside a word document to a string variable.
The problem is the normal appraoch
FileInfo f = new FileInfo(loadedPage);
StreamReader s = f.OpenText();
myvar = s.ToString();
which is used to read normal text files will not work with word.
Thanx !
|
|
|
|
|
Sorry to disappoint you but a word document contains format codes. Open it up using note pad and a you will understand. You need to save it as a text file. In addition, if you save word in rtf, you can open it up using the rtf control provided by MS.
Hope this helps.
Robocop
Robocop
|
|
|
|
|
Hi !
I wont to call a flash exe inside a form I've created.
How can I do this.
(ps: I've heard there is a ocx that can be added but i dont know the name)
Thanx in advance
|
|
|
|
|
Is it an exe you want to call? if so just use
System.Diagnostics.Process.Start
if it's a swf file or a dcr (i think that's the director extension) then there are a couple of ocx's available
"Shockwave flash object" which is a file called flash.ocx and "Shockwave activex control" which is a file called SwDir.dll
depending on the type of movie you want to show, you should add these to your project and use as required.
|
|
|
|
|
Sorry my mistake
I want to call a swf not and exe ....
Thanx for the reply
|
|
|
|
|
Sorry my mistake
I want to call a *.swf file... not an *.exe file.
Thanx for the reply.
|
|
|
|
|
-Bring the Toolbox Window, right-click and choose Customize Toolbox
-Select "Shockwave Flash Object" from the COM components tab. This will automagically build all interop libraries for the ActiveX control.
-Drop the control on your Form
-Depending on whether you want to dynamically set the .swf url or not :
-Static url : bring the Properties Window. On the top is a "Property pages" button. Set the url there. This will show the .swf movie at design-time.
-Dynamic url : once you have dropped the control, it creates a new member in your form, for instance axShockwaveFlash1. Just add this code : axShockwaveFlash1.Movie = "http://....swf";
|
|
|
|
|
Ok, so I've got this little C# app that updates my asp.net weblog. I plan on passing it on to other people I know, but then I came across a problem...
The files are outputted to the "entries" folder (name by the year, month, day, hour, minute, but thats irrelivant...) located on my hard drive in... (the location is in bold below). So, my problem was that, what if they wanted to change the location of the entries folder... you know... export the files somewhere else on the hard drive.
string fileName = DateTime.Now.ToString("yyyyMMdd_hhmm") + ".xml";<br />
XmlTextWriter writer = new XmlTextWriter("<big>C:/inetpub/wwwroot/weblog/entries</big>/"+ fileName, null);
SO, then I put togeather a little options form (options.cs) with a text box to enter the location on the drive, and then you click 'OK' and then it is saved to "options.xml". (see the code below...)
private void buttonOK_Click(object sender, System.EventArgs e)<br />
{<br />
XmlTextWriter writer=new XmlTextWriter("options.xml", null);<br />
writer.Formatting=Formatting.Indented;<br />
writer.WriteStartDocument();<br />
writer.WriteStartElement("Options");<br />
{<br />
string entryFile=textBoxEntryFile.Text;<br />
writer.WriteStartElement("entryFile");<br />
writer.WriteString(entryFile);<br />
writer.WriteEndElement();<br />
}<br />
writer.WriteEndElement();<br />
writer.WriteEndDocument();<br />
writer.Close();<br />
Form.ActiveForm.Close();<br />
<br />
}
This is what the options.xml file looks like....
?xml version="1.0"?><br />
<Options><br />
<entryFile>C:\inetpub\wwwroot\weblog\entrys\</entryFile><br />
</Options>
Now, I need this...
XmlTextWriter writer = new XmlTextWriter("<big>C:/inetpub/wwwroot/weblog/entries</big>/"+ fileName, null);
...instead of saveing it evertime.... unconfigurable.... to "C:/inetpub/wwwroot/weblog/entries", but rather save the entries to what ever file it says in the "options.xml" file.
WHEW!... i hope that made sense... im not familar with the XmlTextReader (assuming that what is to be used...) stuff... thanks for all the help possible.
/\ |_ E X E GG
|
|
|
|
|
Although it's not using the XmlTextReader, this should do what you want.
<br />
FileStream strmSettings;<br />
XmlDocument xmlDoc = new XmlDocument();<br />
XmlNode nSetting;<br />
string filePath;<br />
<br />
strmSettings = File.Open("options.xml", FileMode.Open);<br />
xmlDoc.Load(strmSettings);<br />
<br />
nSetting = xmlDoc.SelectSingleNode("/options");<br />
if(nSetting != null)<br />
filePath = nSetting.InnerText;<br />
<br />
strmSettings.Close();<br />
The string filePath will now contain the value from the Xml so you can do this:
<br />
XmlTextWriter writer = new XmlTextWriter(filePath + fileName, null);<br />
Obviously you should do some more error checking, but in the interests of simplicity this should get you up and running.
HTH
|
|
|
|
|
I FIGURED IT OUT! Thanks for you help...
It took me a while but, after tweeking you code out a little and a crash course on xml thanks to MSDN I got it.
XmlDocument xmlDoc = new XmlDocument();
XmlNode nSetting;
string filePath;
xmlDoc.Load("options.xml");
nSetting = xmlDoc.SelectSingleNode("//Options/entryFile");
filePath = nSetting.InnerText;
string fileName = DateTime.Now.ToString("yyyyMMdd_hhmm") + ".xml";
XmlTextWriter writer = new XmlTextWriter(filePath + fileName, null);
I probably ghetoed this code out alot... but it works... I'll work on cleaning it up later... thanks agian!
/\ |_ E X E GG
|
|
|
|
|
Hey
I have the folowing cod:
try
{
//reading of logg file
StreamReader srlogg = new StreamReader(Application.StartupPath + "\\logg.bin",false);
BinaryFormatter bfstat = new BinaryFormatter();
arylogg = (ArrayList)bfstat.Deserialize(srlogg.BaseStream);
srlogg.Close();
}
catch.........
How could i do to avoid a message box that says error, the file .... .not found.
I fought first that srlogg maby sets to null when no file is not found, but the error comes already on the
StreamReader srlogg = new........
row, is there a good way to avoid error messages only for a file that are missing? I whant the try and catch if there will be other errors.
PS:
When the program starts, then all files is loaded, then thay ar updated after every change.
Best regards
Jimmy
|
|
|
|
|
You should be using a Stream derived class for the BinaryFormatter, not a TextReader derived class like you are using at the moment.
Hey leppie! Your "proof" seems brilliant and absurd at the same time. - Vikram Punathambekar 28 Apr '03
|
|
|
|