|
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
|
|
|
|
|
Simple for you may be altogether different for someone else. I googled "C# plugin framework" and got 17 million hits back, and on the first page, I found this:
http://madskristensen.net/post/Generic-plug-in-application-in-C.aspx[^]
".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
|
|
|
|
|
John Simmons / outlaw programmer wrote: I googled "C# plugin framework" and got 17 million hits back
and you just read my message title not the content
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
|
|
|
|
|
He was responding to your statement "I just want simple plugin support..."
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Nice reason to vote 1, did you also forgot to remember I wrote that in first place
"My question is, is that the only way ?"
do I have to make it in big font, so you can see ?
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
|
|
|
|
|
Xmen W.K. wrote: do I have to make it in big font, so you can see ?
Nice attitude. Good luck with getting anyone to help you now.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Have you looked at MEF[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I'm not sure why this was downvoted. MEF was going to be my recommendation as well.
|
|
|
|
|
Pete O'Hanlon wrote: I'm not sure why this was downvoted.
Simple retaliation. Read the other responses, the OP is being an a$$.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Pete O'Hanlon wrote: I'm not sure why this was downvoted.
That guy need to learn bit respect, voted me down for nothing.
Pete O'Hanlon wrote: MEF was going to be my recommendation as well.
yes I know but MEF is not really what I was needed. The following is from my post
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.
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
|
|
|
|
|
Xmen W.K. wrote: That guy need to learn bit respect, voted me down for nothing.
It's not Mark that needs to learn a bit of respect, and it's wasn't he that downvoted you...
Xmen W.K. wrote: 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.
DLL's don't get a process name. DLL's are loaded into the host .EXE process just as if it was part of the .EXE itself. There is no distinction between the .DLL code and the .EXE code, so any code in your .DLL that goes through the firewall is going to appear to the firewall as coming from the .EXE.
The only way I see to getting around this would be to host your .DLL's in a seperate .EXE process and use interprocess communication methods to talk between the two. But, considering the requirement, that's adding a LOT of weight and overhead to your application for very little to no benefit.
|
|
|
|
|
Dave Kreskowiak wrote: The only way I see to getting around this would be to host your .DLL's in a seperate .EXE process and use interprocess communication methods to talk between the two. But, considering the requirement, that's adding a LOT of weight and overhead to your application for very little to no benefit.
Thats what I asked, if you have read my question. But there is benefit, the spyware kind of plugins will always be separated and end user will be responsible for anything goes wrong, not the host application.
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
|
|
|
|
|
The end-user is going to be accountable for it no matter which executable runs the thing! If the app name comes back a normal production app, then they can just look at the plugins and see that something here isn't quite like the others.
I think you're inflating the usefulness of this idea.
|
|
|
|
|
Dave Kreskowiak wrote: I think you're inflating the usefulness of this idea.
I'm just trying to make application more separated as much as possible. I used PipeStream to communicate between processes as I wrote above...the question was simple, is that the only way ? but some people were in too hurry to read that.
Anyway thanks for the reply
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
|
|
|
|