|
Thanks for the reply. Message queuing must try to serialize the object differently to your project because I still get an error. Its complaining it cant reflect the class because of security? I just have a wizard created Windows Forms project and have done nothing with security. Am I missing something? Heres a quick sample of code:
<br />
System.Messaging.Message msgRequest = new System.Messaging.Message();<br />
DALException apex = new DALException("Database Error", inner);<br />
msgRequest.Body = apex;<br />
msgRequest.Label = "Test";<br />
requestQ.Send(msgRequest);
System.InvalidOperationException: There was an error reflecting 'Send.DALException'. ---> System.InvalidOperationException: The property 'Source' on type 'System.Exception' cannot be serialized because it is decorated with declarative security permission attributes. Consider using imperative asserts or demands in the property accessors.
|
|
|
|
|
hm, apperently your problem is not with the serializer but with code access security.
there is a tutorial available in the online help focusing on declarativ and imperativ code access security: "ms-help://MS.VSCC/MS.MSDNVS/csref/html/vcwlkSecurityTutorial.htm#vcwlksecuritytutorialsuppressingsecurity" or type "Security Tutorial" in the search screen of the online help.
i didn't have time to look into code access security up to now, so i wont be much help on this topic. if you find a solution to this problem it would be great if you drop me a mail.
the help also states that a default XMLMessageFormater is used if you do not provide your own. perhaps you could write your own XmlMessageFormatter class and let the message queue use this one instead of the default.
cheers
franz
|
|
|
|
|
Okay, I searched the message board and it looks like this is a new topic.
From the point of view of having code that does not require changes and compiles, I have had a few designs that really would work best if I can dynamically load a DLL. So this has led to a few questions:
1. Just what are the steps I have to take to dynamically load a DLL
2. In all cases, each DLL is an implementation of a template DLL (or an inheretance of a base class...just with a different name in each case. So we were thinking of creating reference to the base class, establishing an object of that type, but dynamically setting it to whichever DLL I want to load.
3. Has anyone done any testing to determine if a dynamic load via Reflection has as bad of a throughput effect as late binding in VB6?? (early binding having a performance edge of 1000 fold over late binding) I was thinking that since we are doing what I explained in point 2, that I would have the flexibility of 'late binding' in that I am loading one of n-fold objects, but with the speed of early binding since I have the base object defined.
I would appreciate any input on this topic!
Thanks, Michael
_____________________________________________
I have a tendancy to where my mind on my sleeve I have a habit of losing my shirt...
|
|
|
|
|
How can this be a new topic when you see the "how to make a plugin" thread just below ?
Back to real work : D-23.
|
|
|
|
|
I searched for dynamic load, created the thread, then read the stuff on plug-in. ooops.
_____________________________________________
I have a tendancy to where my mind on my sleeve I have a habit of losing my shirt...
|
|
|
|
|
Hello!
I made following steps:
1) Created a Winform with DataForm-Wizard.
2) Now I created a Button next of one textbox. In this button i
open a findfile-form which returns a string. This string i want
to write into my textbox with:
textbox1.text = returnvalue
If I start my project now I clicked my button and choose a File.
After that I see that in my textbox1 the filename comes up.
Then I jump to the 2nd textbox which is bound to the same dataset.
After I changed the 2nd textbox the value of the first textbox change
automatically to null.
I searched some newsgroups for this problems and found some useful but
nothing which can help me!
A tip was to add the command "bindingcontext[].EndCurrentEdit()" after
the command "textbox1.text = returnvalue" but then i get the error-msg
that some fields of my dataset are null. So it looks like the i can only
make a "EndCurrentEdit" at the end before updating.
What can i do to update my textbox and also get the changes to the dataset!
Thanks
Christian
|
|
|
|
|
can any body tell Process.id propertey is an int32 in vc++.net managed code? am i right ?
in vc++ process id is in DWORD data taype
if i want to get Process id in DWORD How to type caste it in DWORD?
r00d0034@yahoo.com
|
|
|
|
|
DWORD strictly speaking is UInt32. But you can you any data type with the same width. IOW UInt32 or Int32 or IntPtr on 32-bit systems.
Hope this helps
"I dont have a life, I have a program."
|
|
|
|
|
hello
i want to know can i make a plugin using c sharp
can someone help me out.
ASIM
Asim
|
|
|
|
|
Yes
1. Define a common interface.
2. Let all plugins implement the interface.
3. Load plugins via Assebly.Load.
4. Instantiate plugins with Activator class.
Stick to that, and it will work. NOTE: plugins cant be unloaded unless they in a different AppDomain, but that is another beast altogether that I havent been able to figure out (maybe its time to try again with renewed knowledge).
Cheers
"I dont have a life, I have a program."
|
|
|
|
|
The dynamic loading is a lot of extra work. If you want to try this, you might want to read this column:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp05162002.asp
|
|
|
|
|
|
eric, just a quick question...
when reading your article on using win32 api I remembered that vb use to have a file which had all the api declarations and constants defined so that vb programmers did not have to type them in.
is there going to be such a thing for c# - its too easy to translate and api call incorrectly....
thanks in advance
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Somewhere on GotDotNet there is a VB program submitted which will take that file and produce the equivalent C#/VB.NET code for the DllImport.
Unfortunately that api file is so old that the few functions I wanted to use it for weren't in there
James
Sig code stolen from David Wulff
|
|
|
|
|
|
What is the main advantage of using a typed dataset? I am trying to model a bunch of data being inserted from several aspx pages and wondering if I should just have a basic class or if I should use a typed dataset and allow the data adapter to do the update for me.
My leaning at this point is not to use the typed dataset; there won't be any manipulation of data on the client side, I am rather building a row to do an insert into a table. There would be overhead associated with the dataset that I'm not convinced would be beneficial. Hm....
Any criteria anyone can think of?
Thanks much,
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
afronaut wrote:
wondering if I should just have a basic class or if I should use a typed dataset and allow the data adapter to do the update for me.
Yes yes yes SO much easier!
afronaut wrote:
My leaning at this point is not to use the typed dataset; there won't be any manipulation of data on the client side, I am rather building a row to do an insert into a table. There would be overhead associated with the dataset that I'm not convinced would be beneficial. Hm....
I use datasets generally for SELECT queries only. I ussually create my own SQL commands for INSERT UPDATE DELETE. The big plus point of a dataset is the ability to have very easy databinding, although using the DBReader is faster.
SO to conclude. Dataset ease of use, auto mapping. Reader speed, manual mapping and "casting".
Its up to you really.
Cheers
"I dont have a life, I have a program."
|
|
|
|
|
I've played around with both approaches, and I just wrote an app that had to do a bunch of different queries. It turned out that it was simpler for me to write a method that used a SQLCommand and a data adapter with textual SQL to fetch the data and process it instead of a strongly-typed dataset and a data adapter created in the data designer. The first one took a little while, but then I could easily generalize to the other queries.
The thing you lose is the strongly-typed feature, and the graphical query designer. The first is a bit of an annoyance, but I tend to use enterprise manager for queries anyway.
YMMV
|
|
|
|
|
I try uploading a stream to a
textfile on a webserver. This is the code:
WebClient webClient = new WebClient();
Stream stream = webClient.OpenWrite
("http://localhost/accept/newfile.txt","PUT");
StreamWriter streamWriter = new StreamWriter(stream);
streamWriter.WriteLine("Hello world");
streamWriter.Close();
the example I am trying says the directory "accept" has to be writeable. I have tried various
permission settings but the webserver keeps saying it's unauthorized when
I run the example. Any ideas on what the proper settings should be ?
|
|
|
|
|
remember the webserver runs as a particular user - you need to give that user write permission to the directory you are trying to put the file in.
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Yes, I asume the is IUSR_[MACHINENAME] and I gave this user write access to the "accept" directory.... It still gives me a 401 error
|
|
|
|
|
yes it is the problem of authority,did you try this URL: http://username:password@webhostname ???
If it still in trouble,you will have to use HttpRequest instead.
lost my way
|
|
|
|
|
aoa
The problem is how to display a picture, i.e we want to open a word document and want to get some picture if any and then to show it, now this is where the problem is we have opened word and got the picture from it but now problem is how to show it.
this is how we got the paragraph from word doc ,
Word.Range rngtext = aDoc.Application.ActiveDocument.Paragraphs.Item(2).Range;
MessageBox.Show(rngtext.Text);
now how to get show the picture?
Asim
|
|
|
|
|
You've only displayed code showing how to get a paragraph. Show us the code you used to get the picture.
ASP.NET can never fail as working with it is like fitting bras to supermodels - it's one pleasure after the next - David Wulff
|
|
|
|
|
I don't know why you can't figure out an easy way to get what you need. It's straight forward.
You don't know the MS Word object model ? I don't either, but who cares ?
Here is what I have done. I have opened MS Word, started the macro recorder, and inserted a picture. Then I edited the macro, and guess what? it showed me exactly the object used to manage pictures in Word. That's ActiveDocument.Shapes . You can either insert one of more picture, get an enumerator and get the pictures, etc.
Now that you know the right keyword to use, "Shapes", you could even start a google search and get a code snippet ready for use.
I hope that one answers not only your question, but also all others questions you may ask about the use of object models. Indeed, in our developer lives, what counts more is the ability to solve a problem regardless of the plumbering.;P
Back to real work : D-24.
|
|
|
|