|
I have two classes one for the form called form1 and one for the socket called CMySocket
Are you saying that I need to add this to the form1 class or the CMYsocket class?
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Never mind I figured it out. So how did you raise your event for the disconnect? Did you do it when you tried to recieve data and got back a socket error?
I have to admit that events on sockets in MFC are a lot easier.
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Hi im jus wondering if anyone knows anyway to change the layout of a datagrid. at the moment im returning rows from the database and displaying the column names across the top like normal but im just wondering if anyone knows how to display the columns down the side of the datagrid. Thanks in advance
|
|
|
|
|
I don't know how you'd do it with a standard grid, but Developer Express[^] have a Vertical Grid component, if that's any help.
|
|
|
|
|
Hi buddies,
Suppose we have created an AppDomain with FriendlyName "NewDomain" in the current AppDomain named "CurrentDomain" and have created an instance of class A in that, now we call some method of that instance, Here is the code:
AppDomainSetup domainSetup = new AppDomainSetup();
domainSetup.ApplicationBase = @"c:\myApp";
domainSetup.ShadowCopyDirectories = @"c:\myApp";
domainSetup.LoaderOptimization = LoaderOptimization.SingleDomain;
AppDomain appDomain = AppDomain.CreateDomain("NewDomain", null, domainSetup);
// Here the constructor is called in the 'NewDomain' domain
A obj = (A)appDomain.CreateInstanceAndUnwrap(assemblyName, "A");
// Here the 'MyMethod' is called in the current application domain
obj.MyMethod();
While tracing "AppDomain.CurrentDomain.FriendlyName" in class A, I see:
1. In its constructor scope, it is "NewDomain", that is ok
2. In the called method scope, it is "CurrentDomain".
It means that the method is called in the 'CurrentDomain', while I wana the method be called in the "NewDomain" application domain.
How can I perform it ?
Thanks
---
"Art happens when you least expect it."
|
|
|
|
|
Make sure that A derives from MarshalByRefObject and isn't just serializable.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Yes, that solved it,
Thank you Andy very much
---
"Art happens when you least expect it."
|
|
|
|
|
Hi,
After filling a dataset I would like to further filter the results without repopulating the dataset. Any help would be appreciated.
"She folds her legs...in doing so I glimpse Xanadu."--Gilby
|
|
|
|
|
Hello All,
I developed a Com+ Application it will work in the clients machin and do some work in the SQL Server. this SQL server inside a DMZ.
the problem is the component in the clients can reach the SQL Server to do the work. how can i solve this problem
Please help
Hoho
|
|
|
|
|
you need to get the appropriate ports opened up through your firewall etc
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312960 has some info on the issue, specifically how to keep it down to 2 ports.
hth
Russ
|
|
|
|
|
There is a need for custom data types to be passed and returned in Web Services methods. As far as i know WS type marshaling is been handled by XmlSerializer which has some certain limitations.
According to some of these limitations only the public fields properties and fields are serialized and any private and protected members will be ignored.This fact leeds to a certain problem because either infriges data encapsulation or break business objects' logic and rules (e.g. some properties of the business objects returned by the WS-method should have a "getter" only in order to serve the logic and i can make any compromise in this issue.)
So...
The questions are :
1.) Can i bypass this fact of ignoring private or protected members ? (Reflection does so...)
2.) If WS were not marshaling via a XmlSerializer whould the problem still existed due to some technical specs of WSs ?
3.) Let's suppose this is a limitation of XmlSerializer can i substitute it with another formatter to achieve my goal ?
Thanx in advance, i would appreciate very much some help.
|
|
|
|
|
Keep in mind that the client doesn't get the full type information of your object. It only gets an object containing your public fields. The web service is really just a collection of methods which pass simple data objects back and forth. Think C-structs rather then C++ objects.
If you are returning the data from an existing object, you can markup your object with various XmlSerialization attributes to determine which properties and fields are serialized.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
You are right...A WS doesnt actually returns the object but a simple representation of it.I achieved to bypass the XmlSerialization in a way (not completely) by returning from my methods a byte array which actually is a memory stream of the object after being serialized via a binary formatter.This helped me achieve the consistency of my business objects and saved me from marking every single property from the XmlSerialition attribute.
Thanx.
|
|
|
|
|
I'm interested in why you serialised as binary and not XML - was it just a matter of personal choice ?
I have similar issues to solve - did this approach work OK for collections as well ?
|
|
|
|
|
No its not a matter of personnal choice.I did it because of the following reasons.
1.) XmlSerialization serializes mainly primitive types and if not, every property,class or WS-method should be marked with XmlIncludeAttribute where needed (rather time consuming and very ugly code output). In addition XmlSerializer fails if there are circular dependencies in the non-primitive type.
2.) By returning a byte array i get rid of the ugly proxies generated in the web service stub.e.g if i returned from ws-method a BusinessObject (hypothetical class) i would end up in my client code with one real definition for BusinessObject in my business access layer code and one in the ws stub. Boring and messy.
3.) Because of XmlSerializer reflection issue (see my initial thread) i could not keep up with the consistency required by my business objects.
3.) Binary formatter serializes all objects as long as are marked with SerializableAttribute or if they implement ISerializable.
4.) I can compress the output directly when its created with minimal overhead (especially network overhead).
5.) I wanted a more generic approach of my middleware so future changes wouldn't affect clients. So because WS doesn't allow Generic methods in the shake of interoperability i considered using a byte array
Yes it's ok for collections see point 3.)
I hope i covered you.
|
|
|
|
|
Great feedback - thanks. My motives for querying this are really based on point (2) - I don't want unneccessary business entity proxies being duplicated in the WS consumer/client; I actually have a leaning towards binary serilisation and its great to hear that it addresses all concerns.
|
|
|
|
|
Like when you press a button, can I imittate someone pressing it?
(And I dont mean just to run the code for the button press)
|
|
|
|
|
Button has a PerformClick method, but that wont animate the button being pushed.
|
|
|
|
|
Hi Everybody,
Can we use DLLs developed in VC++ 6.0 into C#.net
Thanks.
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
Yep (i guess), a DLL is A DLL, no matter where it was made.
If i'm wrong you can shoot me
|
|
|
|
|
What sort of DLL is it? eg. COM/Vanilla/MFC extension....
Regards,
Rob Philpott.
|
|
|
|
|
DLL is ordinary one. It contains C functions.
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
|
in shortcuts when we put &Open then O becomes underlined. I have around 20 forms. and on all those forms I made toolbar but on some forms & does not make the chracter underline instead it shows like & in the text.
can any one guide me how ..
Problem 2.
I have made icon on left and text on right. now in some forms like I have written "Save" it shows it like S... Can any one guide how to make it fix.
Rizwan Bashir
-- modified at 6:26 Tuesday 15th November, 2005
|
|
|
|
|
hi,
first of all i am new to this reflection.
i am writing a simple code (Compute.cs) that will be compiled & executed on runtime. i have no problem if this Compute.cs class does not refer to any other classes or dll. when the compute.cs class calls a method referring to another dll then when i compile it in runtime it says the referred dll or classes could not be found. (are you missing a using directive or an assembly reference?).
how do i specify in the Compute.cs class that the class that compiles it on runtime uses this extra dll?
regards,
rnv
|
|
|
|