|
Did you unregister your interop assembly and re-register the actual ActiveX OCX? You might also re-install ActiveX control if it was packed in an installer, since the install might have written more registry entries. It seems as if the actual COM method (remember, the interop assembly is only a Runtime Callable Wrapper (RCW), in which calls are forwarded) is not being called because the forwarding method can't the object to call.
-----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-----
|
|
|
|
|
Yep, i did a regasm /u on the interop assembly, and regsvr32 on the ocx.
Still no joy.
let me know if you fancy having a go with the ocx. I can mail it. it is only 100k.
At the moment i an writing a DLL wrapper for the c api that also comes with the product.
Thanks
Trev
|
|
|
|
|
Hi all!
OK, so now I know how to use Office Primary Interop Assemblies to do Word automation, i.e. open a word document in its own window, maximize this window, toggle full screen mode, etc.
The question is: is it possible to load the document into the client area of a windows form? You know, if you open Microsoft Office documents in Internet Explorer they load into the explorer window, not into a blank window. Is this possible with Windows Forms / C#? If so, how?
Other - less important questions:
1) Is it possible to hide the caption (using automation) of the Microsoft Word when in full screen mode? The WordViewer doesn't show the caption in full screen mode, but the Word itself does.
2) Is it possible to force the Microsoft Word window to be always on top of other windows (again, using automation?)
3) Is it possible to use the Microsoft Word Viewer in a similar way? Whem I tried to browse the type libraries using oleview.exe I could find "Microsoft Word 9.0 Object Library", is there a type library for Word viewer?
Thanks in advance, any clues are highly appreciated!
Rado
|
|
|
|
|
Radoslav Bielik wrote:
Is this possible with Windows Forms / C#? If so, how?
Active Documents (formerly known as OLE documents) are supposed to be supported in Whidbey (VS.NET 2004).
In the mean time, you could host the web browser in a form and ask it to show that Word document.
RSS feed
|
|
|
|
|
Thanks for the information!
I will try that.
Rado
|
|
|
|
|
Does anyone know how to add a progress bar to one of the panels of a status bar? I'm referring to a windows application of course. I'm stuck and I can't find anything on the code project about this.
Thanks
|
|
|
|
|
You use owner-drawing to place or draw a ProgressBar into a StatusBar or StatusBarPanel . It's not difficult, and if you search the message threads you'll find many examples posted in the past.
-----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-----
|
|
|
|
|
hi,
i need to put a string into byte[]. i can't find any "smarter" method to do.
currently, i do it in this way. suppose string like this "at+cmgl=4"
byte[] data = {(byte) 'a', (byte) 't', .... ,(byte) '4');
as i can't convert char[] to byte[], that's why i need to it in this way.
so, any better method to do it?
thanks,
jim
|
|
|
|
|
System.Text.Encoding.GetEncoding("ENCODING TYPE).GetBytes(mystring)
Cheers,
Venkatraman Kalyanam
Bangalore - India
"Being Excellent is not a skill, it is an attitude"
Reality is an illusion caused by caffeine deficiency(one Microsoft Research scholor)
|
|
|
|
|
Or even simpler:
System.Text.Encoding.ASCII.GetBytes(mystring) or
System.Text.Encoding.Unicode.GetBytes(mystring) . There are several other encodings you can use. Not only is it easier to type, but it also eliminates partial human error in case your forget an "I" in "ASCII" or something. This also results in faster calls within the CLR since parsing strings is extremely slow, and lookups would have to be performed before you got the actual Encoding object.
-----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-----
|
|
|
|
|
Hi,
Is it possible to extract the first day of a given week (an integer) from a given year??? I've managed to get the number of the week after a severe struggle with the DateTime class & DateTimeFormatInfo class, but could not find anything about getting the dates in that week...
Thanks...
|
|
|
|
|
I take it you are using the ISO definition of a week number? (That is, a week starts on a Monday and week 1 is the week that contains the first Thursday of the year.)
To calculate the date of the Monday for a given week number, you need to calculate the date of the Monday for week 1 and then add (7 * (weeknumber-1)) days to that date.
The easiest way to do that is to calculate the date of the first Thursday and then subtract 3 days.
To calculate the date of the first Thursday, calculate the day of the week for 1-Jan for that year. If it is a: Monday, add 3 days; Tuesday, add 2; Wednesday, add 1; Thursday, you got it in one; Friday, add 6; Saturday, add 5; Sunday, add 4.
So, amalgamating all that: calc DOW for 1-Jan. For each possibility, the Monday of week 1 will therefore be
If 1-Jan is a Monday, the Monday of week 1 is 1-Jan
If 1-Jan is a Tuesday, the Monday of week 1 is 31-Dec of previous year.
If 1-Jan is a Wednesday, the Monday of week 1 is 30-Dec of previous year.
If 1-Jan is a Thursday, the Monday of week 1 is 29-Dec of previous year.
If 1-Jan is a Friday, the Monday of week 1 is 4-Jan.
If 1-Jan is a Saturday, the Monday of week 1 is 3-Jan.
If 1-Jan is a Sunday, the Monday of week 1 is 2-Jan.
So, at that point it's simple. Good luck!
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
That did the job! Thanks a lot!
Kaloyan
|
|
|
|
|
what happened to DateTime.DayOfWeek?
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Just to let you know I wrote a web article on calculating ISO week numbers:
http://www.boyet.com/Articles/PublishedArticles/CalculatingtheISOweeknumb.html
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
What's different between System.ComponentModel.Component and System.Windows.Forms.Control? When will me use the Component but not the Control in design?
Thanks.
Game is power!
|
|
|
|
|
If you looked at the documentation, you'd see that a Component (or other IComponent implementation) is anything that can be contained with in a container, or more specifically IContainer . The biggest difference? A Control is graphical and has concepts such as location and size, where a Component isn't necessarily graphical.
Take the FileSystemWatcher for example. It obviously has no UI associated with it since it just watches files and uses Win32/NT-based APIs. It does, however, have an icon associated with it in design-time. This is because it's a component and can be dragged and dropped onto the design surface. This allows code monkeys to click on it and set properties and event handlers using VS.NET (or any other emerging designer these days). You can, of course, forget about the whole component architecture and type it manually, but this allows the component to be "designed".
So, when should you use a control and when should you use a component? If you plan on displaying any UI, you must inherit from control since only controls in the parent's Controls collection are displayed - and it only takes a Control or a child class of it.
If you want your "object" to be tied to a designer (even extending the designer with your own ComponentDesigner ), you can make it derive from Component . .NET has several examples, such as the FileSystemWatcher , the EventLog , and many, many more. Just go to the overview documentation for the Component class and click on "Derived Classes" toward the top of the page.
-----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-----
|
|
|
|
|
I did somethings here :
1. c:\>runread.exe a.txt c.txt
2. Read a.ok
3. c = a = 20
4. c:\>
runread.exe is programed on c++ and compiled into exe file, I run it with some paramaters. As a result is to write what it read from a.txt and compare a.txt and c.txt.
I want to write a c# file to read what it print. How to read result from command line ???
|
|
|
|
|
static void Main(string[] args)<br />
{<br />
string firstFilename = args[0];<br />
string secondFilename = args[1];<br />
}
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Philip Fitzsimons wrote:
static void Main(string[] args)
{
string firstFilename = args[0];
string secondFilename = args[1];
}
I guess you have a sore thum while trying to write
<br />
Console.WriteLine("First arg = {0}, second arg = {0}", firstFilename, secondFilename); <br />
<br />
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
nah, just did not want to do all of his homework...
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
hi, i want to make chart like barchart/piechart in C#..is there any class available for that..so, i can just give data and type of graph ..it will be automatically created..its for academic purpose..so, third party controls are not allowed...can i use MSChart..if yes, then how can i use..? can anybody say? thanx in advance..
-bhavin
|
|
|
|
|
Yes, you can use MSChart. Just add it to the toolbox the same way you'd add any other control.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
thanx for the reply..but m not using Visual Studio .NET IDE. m using SharpDevelop for development. and there is no option to add ocx(component) in toolbox as per my knowledge..so, i can use it..pls tell me..and isn't there any class to create the graphs?
-Bhavin
"A winner is not one who never fails, but one who NEVER QUITS!" -Bhavin
|
|
|
|
|
Ahh, SharpDevelop! That's what I use. If you can wait a week or 2, the next version will have full support for ActiveX and custom controls. (I'm a SharpDevelop contributor, so I have access to the current internal build, but unfortunately they are in the middle of changing the parser, so the forms designer is inoperable.) Or you could add it to your form manually, and just not use the forms designer.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|