|
Hi,
I am going to build an editor in C#.net that can read only document and pdf files. It works very well with .doc extensions and when i go to read pdf file then it doesn't work. Act. I'm opening document and pdf file in rich text. I want to create pages just like in Microsoft word or Acrobat reader. So, plz suggest me any article or helping material.
Arslan Ilyas
|
|
|
|
|
|
Hello!
I have the following situation:
A server should call event, which are being handled by the client.
So i took the example posted on codeproject http://www.codeproject.com/useritems/RemotingEvent.asp (Remoting Event) and merged it with my existing code.
When calling soapsuds for the desired webservice-class i get all my other methodes, but for the event i only get "add_xyevent"- and "remove_xyevent"-methodes. In the code in the example metioned above the event is subscribed inside the client like a regular event:
m_server.xyevent += new EventDelegate(handlerFuncion)
So i tried to use the event-method "add_xyevent", which ran into an SerializationException telling me that SOAP cannot serialize a generic type.
m_server.add_xyevent(handlerFuncion);
=> SerializationException
My question is:
How can i subscribe to this event?
Do i have to provide a specific keyword when declaring the event on the server?
Who can help me?
Thanks a lot!
J.
|
|
|
|
|
Anybody could help me how to get the internet speed provided by ISPs.It should be some thing like the pop up displayed on system tray in windows OS.
Thanks
-- modified at 5:42 Friday 16th November, 2007
|
|
|
|
|
You can get the connections and their connection speed, but that will only show the speed between your computer and the router. The actual theoritical maximum speed provided by the ISP is not possible to get.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi all! I have to print a bar with its exact sizes. I used this code to generate a bar:
PrinterSettings ps = new PrinterSettings();<br />
Graphics g = ps.CreateMeasurementGraphics();<br />
IntPtr pHdc = g.GetHdc();<br />
<br />
mf = new Metafile(pHdc, EmfType.EmfOnly);<br />
<br />
g.ReleaseHdc(pHdc);<br />
g.Dispose();<br />
g = Graphics.FromImage(mf);<br />
<br />
g.PageUnit = GraphicsUnit.Millimeter;<br />
g.PageScale = 1;<br />
<br />
Brush b = Brushes.Black;<br />
<br />
g.FillRectangle(b, 0, 0, 2, 30);<br />
<br />
float dpix = g.DpiX;<br />
float dpiy = g.DpiY;<br />
<br />
g.Dispose();<br />
<br />
Bitmap bm = new Bitmap(mf, (int)(mf.Width / mf.HorizontalResolution * dpix),<br />
(int)(mf.Height / mf.VerticalResolution * dpiy));<br />
mf.Dispose();
Well, when I print the bm Bitmap I obtain a big bar on my page: it isn't 2x30 mm wide, but 12x188 mm wide!
Can you help me?
Thanks in advantage
|
|
|
|
|
Hi,
"mm" is not the standard for computers! Neither for the postscript i guess.
Secondly, it differs for different disply resolution. For Example:
Screen Res: 1024x768, Diagonal Size: 19", Pixel size: 0.377mm
Screen Res: 800x600, Diagonal Size: 17", Pixel size: 0.4318mm
Screen Res: 640x480, Diagonal Size: 15", Pixel size: 0.4763mm
(taken from ^ [^])
So you better calculate about your display resolution.
Hope that helps!
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Hi, thanks for your answare.
The problem is that I don't want to draw the bar on screen, but I have to print it on my printer. Pehraps I can solve the problem using the printer resolution (600 dpi in my case).
Thanks again!
|
|
|
|
|
Hi,
I want to override the windows procedure of another appication as I
need to disable the right click option on that application.
I have taken a windows form based application.
On a button click I started another application from my application(Using Process.start)and got the handle for that application .
Now I pass this Handle to MyHookclass contructor which is derived from NativeWindow. In its Construtor I assign the handle to "this" using Nativewindow Fn AssignHandle (i.e this->AssignHandle(hWnd)). I have
ovveriden the windows Procedure in MyHookClass and handled the WM_ContextMenu Msg placing a MessageBox.
Now when I right click on another application nothing happens . Is there anything Iam missing apart from assigning the handle and Overriding windows Proc? I verified the handle it is fine.But my Winwdow Proc is not called.
Any suggestions would be appreciated.
Thanks
Satya
Today is a gift, that's why it is called the present.
|
|
|
|
|
Hi!
I don't think it works this way. You'll have to inject a true hook procedure into the other application, just assigning window handles isn't enough. Take a look at this[^] MSDN page, it's the starting point for a lot of hook related documentation.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi,
I fill dataset with dateTime filed from an table, after that i am tranferring that dataset over web service to update database on srver.our server is in NL(Netherland) my client application run from India,problem is when it update databse then date time fied one day back i.e if in my dataset have date 26/10/2006 then update to server database 27/10/2006.
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
Please please don't add one day on every update method, So it will create the problem. For that problem you have to add time difference between India and netherland. Suppose time difference is around 3.48 mins. Then Add/subtract this much of minutes from the actual date.
Hope this help.
Regards
Pankaj Joshi
|
|
|
|
|
is there any other than given solution coz i am using bulk copy for update. i.e. can we change in dataset b4 sending on web service?
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
This is strange
If you are updating a dataset then the dataset should have the pre-filled values like if you are input a transaction in india on 27/01/2007 then your datatabel is having that value. how it will take server date...?
Regards
Pankaj Joshi
|
|
|
|
|
I have tried using the mdi method, but found out that it wasnt what I wanted. It opens a form within the parent form, which isnt the way I want
What I want to do is to open a form from a parent form.
If I use form.Show(); I can go back to the parent form and open the same form again. That I want not possible.
If I use form.ShowDialog(); I cant go back to the parent form, which is not what I want either.
What I want to do is to be able to go back to the parent form and open other forms, but not open the same form twice.
How do I do that?
|
|
|
|
|
For that you have to create a globally accessible class. In that just put bool variable for each form like :
IsForm1Open=false;
IsForm2Open=false;
IsForm3Open=false;
Before opening any Form from the MDI first check this variable.
And on the each form's load event make that variable true. and in the dispose method make this false.
Regards
Pankaj Joshi
|
|
|
|
|
Why are you doing this? An MDI form contains a list of child forms. Use that to evaluate whether or not the form is present. A simplistic example would be:
bool found = false;
foreach (Form f in this.MdiChildren)
{
if (f.Text == "RibbonForm1")
{
found = true;
f.TopMost = true;
}
}
if (!found)
{
RibbonForm1 frm = new RibbonForm1();
frm.MdiParent = this;
frm.Show();
}
|
|
|
|
|
Good solution
But this is OK when I am having more than 100 forms in my application. this will loop for each time 100 times..?
Performance issue...
Regards
Pankaj Joshi
|
|
|
|
|
I'd just create a central form pool somewhere and use id's to fetch the form I want. Example:
<font><font> public class FormpoolClass
{
private Dictionary< string, Form > formPool = new Dictionary< string, form=>();
public class CustomForm : Form
{
}
public formType GetForm<formType>(string form_id) where formType : Form
{
if (this.formPool.ContainsKey(form_id))
{
if (formPool[form_id] != null && !formPool[form_id].IsDisposed)
return formPool[form_id] as formType;
else formPool.Remove(form_id);
}
formType ret = null;
try
{
ret = Activator.CreateInstance<formType>();
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
Debug.Assert(ret != null);
return ret;
}
}
public class Test
{
public void dotest()
{
FormpoolClass fpc = new FormpoolClass();
CustomForm f = fpc.GetForm<customform&rt;("myform_id");
}
}
</customform></font></font>
Standards are great! Everybody should have one!
|
|
|
|
|
That's exactly how I'd do it as well. Have yourself a 5 sir.
|
|
|
|
|
And you are relying on adding a new condition and test everytime you add a new form. Hmm. Plus, how many times do you have 100 forms in an app?
More importantly, as Bekjong states, I wouldn't rely on a loop test in my code. Instead, I'd use a generic dictionary to manage this. Then your code becomes a lot simpler and a lot faster.
|
|
|
|
|
(f.text == "RibbonForm1")
what is it? could tell me that?
and do i have to set the parent to mdicontainer?
if i do that the background colors turn to gray. any way to change to the default color?
|
|
|
|
|
This is just a simple way of telling who the child form is. I wouldn't rely on this, as it was only a quick sample, and the text is the thing that appears in the titlebar.
You would create this form from the parent using.
MyForm form = new MyForm();
form.Parent = this;
form.Show();
|
|
|
|
|
its nice but i prefer to use
if(f.Name == "RibbonForm1")
and not
if(f.Text == "RibbonForm1")
because he can change the name dynamically
respect.
spaps
|
|
|
|
|
You can do this using FormCollection class. Its object will have the list of all the forms opened by your application.
FormCollection o = Application.OpenForms;
I guess this might help.
Chaos, panic and disorder - my work here is done.
|
|
|
|