|
There are several reasons I don't make my own control:
1.) MSChart has a lot of nice functionality I would like to reuse.
2.) It is not in my job decription. If I spend too much time making a chart control I will be looking for a new job. I need to pick my battles carefully, and make sure I can win them quickly. As a scientist, I have some discretion on what I work on, but I must justify it in the end.
|
|
|
|
|
OK, so yes, derive from it and create your own functionality. Use Reflector to explore what it does if necessary and override where needed.
spainchaud wrote: It is not in my job decription.
Not to be rude, but what the hell are you doing here then?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Learning something, I hope.
Where I work the scientists typically hand poorly written and undocumented Fortran code to the application engineer, and say "it's your problem to make it work".
I am trying to change that by wrapping the Fortran in properly documented and tested C# classes, before the software engineer gets it. Then work with that engineer to integrate my library with his application.
A really good plotting package will help me with my testing. The software engineers get licenses for fancy commercial plotting packages, the scientists have to scrounge around.
|
|
|
|
|
spainchaud wrote: I am trying to change that by wrapping the Fortran in properly documented and tested C# classes, before the software engineer gets it.
I understand your goal, yet from the perspective of a professional software developer, I would rather the time be spent on improving the process of gather and documenting the requirements. I don't want code from some novice that will most likely be thrown away and never used anyway. You understand the problem you need solved, it is the job of the software engineer to know and use his tools, skills and experience to meet your requirements.
How would you feel if one of the engineers started mucking about in the lab and making suggestions to you on how to do your work?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I does not bother me if they throw my code away, since I know it would be used as a starting point to write even better code, and I would learn from that process. I throw my own code away often, and replace it with better code.
But I know that wont happen. The software engineers were very happy to hear that I was making a library that would be readily integrated into there application, be under source control from the start, and my responsibility to debug. They are also happy to give this novice pointers on design and organization.
The end product will see lots of inflexible undocumented Fortran replaced with a flexible class library in C#. The only Fortran left will be the core Fortran calculations, that very few understand. If the software engineers really wanted to do this job I would have been glad to help define requirements and test their code, but there we no volunteers, except me.
This is also a good project to get me started in C#, after 30 years of Fortran a change of pace is nice.
|
|
|
|
|
spainchaud wrote: so the question is can I derive my own control from MSChart, s
Yes technically this should be possible to do.
The question for you however would be, how useful would it be for you to do that.
Too much of heaven can bring you underground
Heaven can always turn around
Too much of heaven, our life is all hell bound
Heaven, the kill that makes no sound
|
|
|
|
|
It probably wont be necessary. I found out my company has an ActiveX control that will do the log plotting. I think I will still need MSChart to control some user input, but the fancy plotting will be done by something else.
|
|
|
|
|
I am trying to send the fax from my windows service which is written in vb.net. I am facing problem with windows 7 and windows 2008 Server. It works fine with Windows XP
Fax is not getting visible in fax console's outbox. I saw three files in "C:\ProgramData\Microsoft\Windows NT\MSFax\Queue" for every sent fax but this is not visible in fax queue.
I also observed that, when i am trying to send the fax from windows application then it works but anyhow it is getting failed when i am trying to send that from windows service.
I have following code :
Dim oFaxSvrType As Type = Type.GetTypeFromProgID("FaxcomEx.FaxServer")
Dim oFaxSvr As Object = Activator.CreateInstance(oFaxSvrType)
Dim oFaxDocType As Type = Type.GetTypeFromProgID("FaxcomEx.FaxDocument")
Dim sFaxServerName As String
Try
sFaxServerName = Environment.MachineName.Trim
oFaxSvr.Connect(sFaxServerName)
oFaxSvr.Connect(sFaxServerName)
Dim oFaxDoc As Object = Activator.CreateInstance(oFaxDocType)
With oFaxDoc
.Sender.FaxNumber = "1112223333"
.Body = asfilename
.Sender.Name = "test recipient"
.Sender.OfficePhone = "123456789"
.Recipients.add("1113332222")
End With
Dim sFaxJobIds() As String = oFaxDoc.ConnectedSubmit(oFaxSvr)
oFaxDoc = Nothing
Catch ex As Exception
Throw New Exception(ex.Message)
Finally
' clean up com components
Try
oFaxSvr.Disconnect()
Catch ex As Exception
End Try
oFaxSvr = Nothing
End Try
I observed that in task manager, rundll32.exe is getting started when i tried to run this code from windows application but this rundll32.exe is not getting started when i am trying to run this code from windows service.
I am not getting any exception after executing this code but not able to see the fax on outbox.
I ensured that allow service to interact with desktop in service console is checked for fax service and my own windows service.
I need this little bit urgent. Any help ?
|
|
|
|
|
Have you tried logging on as the same user as the service runs under and sending a fax?
Tosch
|
|
|
|
|
Change the account the service is running under to your own. Then you should be able to see the fax in your outbox.
|
|
|
|
|
I have just struck the identical problem.
ConnectedSubmit works fine in a harness app, but becomes a black hole in a Windows Service.
EventLog statements sprinkled through code before the submit are visible, nothing after. No exceptions caught. Service responds to stop.
A threading issue? (My code was kicked off by a timer.) Issue with unmanaged underlying COM?
Have you a solution?
|
|
|
|
|
Have any of you got into this problem?
I've got a .Net 2.0 Winform app for tracking days off and resource management, I'm using Microsoft Application Blocks to connect to an Access db, providing connection string and everything works just fine! Issue is, some of my users have been required in their projects to install Teradata(v 12) which has caused that the application cannot open the Access db. I know, for the type of company and customer they have, that their machine conf is exactly the same, the pc's are configured the same with software installed from the same image, and none of the have admin rights, so I know that it's because they had Teradata installed that they are facing the problem. People that has not required yet to install it are working happily with my app.
Any insights or ideas will be very much appreciated!
"Whether you think you can, or you think you can't--either way, you are right." — Henry Ford
"When I waste my time, I only use the best, Code Project...don't leave home without it." — Slacker007
|
|
|
|
|
Just a SWAG, but the only thing I can imagine that might be affecting this is that the Teradata package has installed a different version of the Jet engine, one that isn't compatible with your software. Can you get a copy of the Teradata stuff and install it on one of your own machines for testing?
Will Rogers never met me.
|
|
|
|
|
Compare the Jet Database engine version if your Dev PC and in the PC where your app doesn't work, most probably, your Jet engine DLLs must have been overriden with different versions. Here's a link that tells your how to check the Jet DB version: http://support.microsoft.com/kb/141796[^]
|
|
|
|
|
|
Collin Jasnoch wrote: <layer>Say I have an object (Poster) with an event, and another object (Listener) is listening to that event (i.e. a Weak Reference) and has the delegate locally.
Unless you code it up that way explicitly, an event hook is a strong reference, not a weak one.
As for hooking the delegate itself, yes, as long as object A has a reference to object B, it'll keep object B alive.
You can avoid this by using a WeakReference in the variable behind the DoStuff property. You'll just have to verify that the reference is still alive before attempting to call it.
|
|
|
|
|
Ian Shlasko wrote: You'll just have to verify that the reference is still alive before attempting
to call it
(which you should do anyway)
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
The .NET garbage collector is actually quite good. It can clean up objects that are holding links to each other (keeping each other alive via A holds a reference to B and B holds a reference to A again).
When this pair gets orphaned from the memory root(s) (i.e. there is no path of references from the base-objects of the program to the A-B pair) then the garbage collector will see that this pair is cut off from the rest of the program and thus clean it up (as always, when this clean up is done is not predictable).
|
|
|
|
|
Technically speaking it isn't a memory leak. Worst case, posterObject wont be garbage collected until Listner is disposed. It's definiately something to consider but once the applicaion is closed, there will be no memory leak handling events in .NET.
"You get that on the big jobs."
|
|
|
|
|
Hi everyone,
I've got a problem when trying to include a CSS file from within a HTML file when the HTML page is loaded as a resource (see below). I'm writing the application in VB.NET, it basically loads the HTML in a web browser control fine, but if I try to include a CSS relative to the EXE or HTM file the stylesheet does not apply.
Dim objMemoryStream As System.IO.MemoryStream
objMemoryStream = New IO.MemoryStream(System.Text.Encoding.Default.GetBytes(My.Resources.wpHtmlPage))
wbApplication.DocumentStream = objMemoryStream
The only way I can get this to work at them moment is to hard code the full path to the CSS file (see below), what I'd like to be able to do is either make it relative (and work) or add the CSS as a resource but this fails to work as well.
<link href="C:/temp/styles/default.css" rel="stylesheet" type="text/css" />
Any help or/and advice on this would be much appreciated, thanks.
modified on Monday, July 4, 2011 9:57 AM
|
|
|
|
|
Hi Jonathan,
You are displaying the Html page by reading it from a resource file as against the file being rendered by a web server. There is no location from where your html can locate the css file.
One solution is to save both the html file and the css file to a temporary folder and display the html from there (I believe the WebBrowser control has a Navigate method or so).
Alternatively, you can use inline stylesheet using the <style> tag.
|
|
|
|
|
Thanks Shameel for your quick reply.
If what you're saying is correct (and it does make sense to me) and there's no other solution I think I will just have to include the CSS code within the
<style> tags.
Unfortunately, this just makes the management of the style harder as I'd have to tweak every HTML file as and when required.
|
|
|
|
|
Or you can explore the other option I suggested, i.e., save both the html and css files in the same temporary folder and use WebBrowser.Navigate(<<html path>>) .
|
|
|
|
|
If this is a winforms app, and you're using the web browser control, you MUST supply the fully qualified path to any style or javascript file you want to load. I do it this way:
string html = string.Format("<link rel='stylesheet' type='text/css' href=\"{0}\" />", System.IO.Path.Combine(Application.StartupPath, "myFile.css"));
If you made the css and html files embedded resources, they will be extracted when the program runs to the executable folder. This way, you can use the Application.StartupPath as the path to the files.
You may find this article helpful in this regard:
CodeProject Article Scraper, Revisited[^]
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
I'm trying to have plugin functionality in my application. So first thing came in mind was to just load the DLLs and call the common abstract class methods. After completing all that, I noticed that there could be many security issues. The next thing I used was different AppDomain. But that solve half of problem. Assume this, if a plugin wants to connect a server over internet, the firewall will show the name of my application and user may allow without knowing its the plugin who is trying to connect. After that I started using NamedPipeStream, separated them in processes, connected plugins and application through PipeStream, it does exactly what I needed but each plugins means a different process.
Even everything is working fine but its not satisfying, something still feels not so good. My question is, is that the only way ?
PS : I just want simple plugin support, not some complicated library like System.AddIn.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|