|
kd7gim wrote:
I have a C# application I have already written, and I am adding a MDI Graph page.
Okay, sounds reasonable.
kd7gim wrote:
The graph page is already written, and the parent document is a C# Data Base Management System
Document? Did you ever program with MFC? WinForms applications don't have anything equivalent to the MFC's Document/View implementation of the MVC (Model/View/Controller) pattern, so you generally have to roll your own.
kd7gim wrote:
load data onto a stack
A stack? Do you mean a System.Collections.Stack[^] object? If so, why?
If not, then remember that all object except for intrisnsic objects and other value types (like Point, DateTime, etc.) are created on the heap in C#.
In your original post, you asked about passing an integer between two classes (specifically Form classes). Now that I know one is an MDI Parent Form and one is an MDI Child Form I can show you at least one possible example:
In the parent MDI form you will have some method that needs to send data to the child MDI form. So some piece of code like:
MyGraphFormInstance.MyDataValue = someDataValue;
In the child MDI form you will have a corresponding piece of code ready to receive this data, something like:
public int MyData
{
get
{
}
set
{
}
}
Or you may like to implement the above getter as a method and send multiple items of data at the same time, or have some return value sent back to indicate some change in state. It depends on what you need to do.
Does this help?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
Coming soon: The Second EuroCPian Event
|
|
|
|
|
I have worked with the get{}; set{}; passing from private to public on both ends, and using a sender and receiver. I have also worked with global structs. I believe there is a major hole in .Net Version 7. This is also what Mueller, ".Net Framework Solutions, In Search of the Lost Win32 API" claims.
It upsets me to think that I should pay a minimum of $549.00 for an upgrade so that I can get what should have been in Ver 7 in the first place. I think passing public variables has been addressed in Net 2003, as they now advertise their "Global Assembly Cache." Going that far, they are sure to have covered the more basic ground.
I am going to play with pointers, after that I am going to create another external file prototype. I will give it a .ini, or .ocx suffix, and then I will open, and read that file form my second Win Form. This provides me with the job security that a programmer so richly deserves.
|
|
|
|
|
I am at a loss as to understand what you are trying to achieve and even what you are saying.
kd7gim wrote:
I think passing public variables has been addressed in Net 2003
What do you mean by this? It certainly isn't what I think you mean because the context of the rest of your email doesn't support my interpretation of your words.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
Coming soon: The Second EuroCPian Event
|
|
|
|
|
Can one modify the icon shown in the setup wizard easily? is there a property somewhere for this that I'm missing?
--Tony Archer
"I can build it good, fast and cheap. Pick any two."
|
|
|
|
|
The one at the top? Yes. You can change this in VS.NET by opening the User Interface view with your installer project selected. Click on the form and you'll see a BannerBitmap property in the PropertyGrid. You can change it here, but it has to either be a file installed with the product, or there's a nifty little trick where you can put a bitmap in the File System Editor but mark the file as excluded (this gets compiled into the Binary table of the MSI package anyway - so a destination bitmap isn't necessary).
The problem is that you need to do this for each form. If you download and install the Windows Installer SDK (part of the Platform SDK, which is currently the Feb. 2003 edition), you can install the Orca utility. Load your compiled MSI into Orca, go to the Binary table, the double-click the second column for the DefBannerBitmap record (that's the key name). Just import a different bitmap of proportional size. This replaces the bitmap for every dialog in one shot.
If you need a better installer, I recommend either one from Wise Solutions[^] or InstallShield[^]. I have a lot of experience with both (having a been a beta-tester for Windows Installer since before 1.0) and I prefer Wise for extensibility (if you know how to modify the tables, which InstallShield added support for not until 4.0) and for cost.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you. Modifying the form's graphic will do fine for my purposes. Just didn't want it to look too crappy
--Tony Archer
"I can build it good, fast and cheap. Pick any two."
|
|
|
|
|
Hello. I've asked this in many places but nobody could help me. Let's try again.
I need to pass a custom object that has a collection (I don't mind which if it's a problem: I like the ArrayList) to a web service.
The class is defined in a DLL and the clients are Pocket PCs (Remoting can't be used).
My problems are because I have to use a modified version of my class to use with the web service. This class only exposes the properties. The main problem is that I don't find a good idea to make the List public, but then it's not accesible as the class only shows properties.
The original class can't be casted to that new class. The only thing that could save me is that I could wrap my class in any other object that can easily travel through the web service. XML or something.
Can you please help me?
|
|
|
|
|
What classes are you talking about? The client-side proxy for the web service? Some other class? And who says you can't expose your ArrayList as a public property? Take this for example:
private ArrayList list;
public IList MyList
{
get { return this.list; }
} You need to be a little more specific about your architecture. It's no wonder you can't get any help elsewhere. Remember - we don't know anything about your implementation, the what little "details" you give does not help one bit.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you for your answer. I'll try to be more specific.
I have a main class that is declared in a DLL. There are clients (Pocket PCs) that fill these objects and send them to a web service. The web service has to store these objects (in a Hashtable for instance) temporarily because the clients will access the objects later.
The problems:
- The web service has some web methods that receive and return my objects, but the proxy creates a ligth class with only the properties (not the methods). This class is incompatible with my original class, so I have to use this new class in my clients to use the web methods. The first problem with this is that the clients can't use the DLL; instead they'll use the modified class.
- I did some tests and it works with basic classes (with basic types as strings as attributes) but my original class has an ArrayList. In the modified class, the ArrayList is converted to Object[] and worst, I have to expose directly the ArrayList (well, the Object[]), instead of using methods, so the clients are more complex and I can't change the structure without modifying the clients.
My question:
- Is there any way to wrap the original class and send all to the web service(any kind of XML structure), so I can work in the clients with the original objects and send them directly to the web service?
If not, is my design wrong? I can't use Remoting as Compact Framework does not support it.
Regards,
Diego F.
|
|
|
|
|
You should be able to modify your web service proxy and use the original types of whatever you're talking about. So long as the serialized form is correct, it really shouldn't matter. The biggest problem is that the Type references in the SOAP will be different. You can get around that using an intermediate step, such as transforming the SOAP body using XSLT or changing the DOM.
Another suggestion is to create a shared assembly (if possible) that both the client and web server use. Change the references in the web service proxy so that the shared Type (that the web service expects) is specified instead. This is common in .NET Remoting and I don't see why it wouldn't work in this case. You just have to do a little hacking on the VS.NET-generated class files, but it's really not so difficult.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
ASP.Net seems to be getting the majority of the attention from Microsoft. Apparently that is where the money is. There are some really cool methods already written for ASP.Net for passing values to wherever.
My article is intended for us poor, lonely, forgotten, C# Windows applications developers, that don't get that kind of attention from the experts.
Dave Brighton
|
|
|
|
|
I am hosting a .NET control inside of IE.
Syntax:
<object id="PrintConfig" classid="http:PrintConfig.dll#PrintConfig.PrintConfig" VIEWASTEXT></object>
However, I want my .aspx page to be able to pass params to the PrintConfig.dll, is this possible ? If so, could you point me to a reference or documentation ?
Thanks.
R.Bischoff
.NET, Kommst du mit?
|
|
|
|
|
First, your classid attribute should not include "http:". Use a relative path or an absolute path. Only include "http://" plus the host name if you want to use a control from another site (in which case that site needs to be configured in the Url evidence for the code access security group that must be created - all covered in my article I linked the other day.
On your class interface, declare a property of type object or IWebBrowser2 (requires that you reference the shdocvw.dll native COM server, which creates an interop assembly (default is typically Interop.SHDocVw.dll ) that must be in the same directory (or if you read the documentation about the assembly binding configuration settings - you can figure out other places to put it) as the PrintConfig.dll.
Make sure you implement this property in your user control.
Then, in your .aspx page for the onload event of your OBJECT (to make sure it's loaded first, otherwise an error will occur), set that property to the window object of the web browser.
You must use a dispatch interface or the scripting engine cannot access the object model. My article I linked also covers this, as well as why auto-generated class interfaces should not be used (declare them explicitly and implement them as the first interface in your class declaration).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Sorry about that Heath, I just skimmed your article, I should have read more thoroughly. Filling the gap of the .aspx page (server) and the embedded control (local machine) with the web browser interface makes perfect sense.
I'll give it a go!
Thanks again for the tips.
R.Bischoff
.NET, Kommst du mit?
|
|
|
|
|
|
No, but you could use onreadystatechanged :
<object id="myControl" clsid="MyAssembly.dll#MyNamespace.MyControl"
onreadystatechanged="setProperties();">
</object>
<script language="javascript">
function setProperties()
{
if (myControl.readyState == "complete")
myControl.Prop1 = "something";
} Don't forget, though, that you can use the <param> tags inside the <object> element to set public properties on the control as well.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I read in a chunk of a file in bytes, converted it to ascii, made it a string and now I am trying to clear out the '\0' characters. Any advice?
|
|
|
|
|
The simplest single-line call is to do this:
<your string>.Replace('\0'.ToString(), ""));
or
<your string>.Replace("\0", ""));
I would probably recommend stripping unneeded chars as you're reading in the bytes, or when you convert to ascii, if you're doing that work yourself and can find a good place to insert the logic; it'd probably be faster that way.
-Jeff
here, bloggy bloggy
|
|
|
|
|
dammit I knew it was somthing simple like that thanks
|
|
|
|
|
I just started wondering how are those modern 3D RTS-games made. The 3D world structure I mean. How are those 3D mountains (that are not models but can be dynamicalle be altered in runtime) and stuff like that made ...
Isn't there a article somewhere covering something like this ?
Regards, Desmond
|
|
|
|
|
|
Search for books on Amazon about DirectX. I'm reading a couple and they explain a bit of this, though not using the advanced techniques of modern 3D engines for games. That takes experience and deep research into modern game programming.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
No, Mueller hints at this in his book "In Search of the Lost Win32API."
I have not seen anybody actually write code for a Windows Application.
All the texts write their code for Console Applications.
Dave Brighton
|
|
|
|
|
I want to know how to send data from one form to another? Like lets say I want my program to put data in the textbox of another form, how would I go about doing this?
Thanks,
K
|
|
|
|
|
This was anwserd so many times in thsi forum ...
Search a little.
But the idea is to pass a refrence of the form with the textvox to the form that wants to change that textbox in the constructor.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|