|
I'm fairly new to the C# environment but coming from Delphi, most of what we've been doing has been very familiar. Primarily, the difference has been syntax and a few new features we didn't have. An important technique we used a lot was the reusing of forms. This was done by creating a form, such as an address form, and reuse it in several areas. The exact same form would be used in the maintenance of people, shipping, billing, etc. while and underlying class property dictated the rules of the form.
Why do this? The flexibility and look of MDI was not nearly what we desired or needed. Instead, we created a form with panels in it. We then positioned the panels where we wanted them. We could then take a completed form (whose parent is SELF by default) and set the parent property to the panel. The second line of code set the form's alignment to client. This essentially pasted the form into the panel. This gave us the ability to have a developer build the central application while other tasks were divided by specialty. Now, if I were putting together something that needed the module that needed an address, I'd put a panel in the main application and just paste the address form into the panel at run time. I'd them use the class methods and procedures to move information appropriately.
What I'd like to do is perform this same type of task in C#. I've tried a few things but I'm not getting past the fact that a form is a "top level control". The impression I get is C# treats controls in a heirarchal form and a panel is lower than a form. Once the form is identified as such, I'm not allowed to put the form into a "lower" type control.
Are there any suggestions for doing something similar to this? This is quite a powerful technique that can be utilized even better in C# than in Delphi because of the ability to build multiple interfaces (shipping address maintenance, billing address maintenance, personal address maintenance, etc) and utilize them as the task requires.
|
|
|
|
|
make these "forms" as usercontrols instead.
|
|
|
|
|
An instance of MyClass is running in Thread A. This instance of MyClass instantiates an instance of YourClass.
As part of the constructor of YourClass a worker thread (Thread B) is started. When this worker is completed it calls a delegate callback function in MyClass.
In which thread context is the delegate function executed? Thread A or B?
|
|
|
|
|
I think that any function called from a delegate will normally be executed on a thread from the thread pool. Thus it will not be executed on Thread A or Thread B.
I have some memory of a way of getting a delegate to execute on a particular thread, but can't recall the details right now.
|
|
|
|
|
Hi all,
I've been trying to subscribe to SourceSafe events (BeforeCheckin, AfterCheckin etc.) through c# and interop. I've used tlbimp on SSAPI.dll to get access through c#.
In the Init() function I subscribe to events (BeginCommand += new ....) and the rest.
I change by ssaddin.ini file appropriately. When I open SourceSafe, my Init function gets called the way it should.
The only event handler that gets invoked consistently is the EndCommand handler. Depending on the order in which I subscribe to the events (+=), I can get different event handlers to be invoked but I can never get all of them invoked. (unexpected)
Looking at what tlbimp generates as a signature for the event handlers I came accross something strange. The BeforeAdd method (for example) expects as a first parameter a VSSItem, but if I implement the interface in Visual Basic 6, the signature for the same method expectes a IVSSItem.
Can anyone point me in the right directed to how I can get this working. I'm all out of ideas.
Thanks in advance.
|
|
|
|
|
Hi,
Please tell me about compile an project in C# for run under Windows 98, Win98 SE.
I try compile but it don't run, it's missing very library.
Thanks.
H.Dung
|
|
|
|
|
What errors do you get? Did you install the .net framework on the 98 machine? Did you install mdac 2.7 if you are doing db access?
|
|
|
|
|
Hi,
I don't compile C# run in Windows 98 because I install it in Windows 2000. Now I want compile C# project for run in Win98.
Please help me.
Thanks.
|
|
|
|
|
There is nothing different to do. Just install the framework on the 98 machine and then your app. As long as you don't use framework objects that are only supported on 2K you are fine.
|
|
|
|
|
Thanks for your suggest very much.
Now I can run my app in win98.
H.Dung
|
|
|
|
|
Hi,
I write an application in C# but I don't want user run it more one instance. How do I know numeric of instance of this app when user fire it? And how to I resolve this problem?
Please help me.
Thanks.
H.Dung
|
|
|
|
|
|
Hi,
Thanks you very much.
H.Dung
|
|
|
|
|
Hello, I'm making HTTP requests with System.Net.HTTPWebRequest and I want to capture the entire header of the request as a string. I'm able to do this with responses but now the requests. Am I missing it in the API somewhere or is there another way?
thank you
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
Hi,
I'm creating a COM+ Client/Server in C# and so far things are going relatively well. The client talks to the server, the server puts the data sent to it into the database, it then sends a successful message back to the client. It all runs under the Component Services until start looking at calling the server from a remote machine. If I move the client to a remote machine I get a wonderful 'System.IO.FileNotFoundException' error referring to the server DLL. Surely I don't need to distribute the DLL along with the Client EXE file? Do I?
All I want to do is have a COM+ service running on a server and my client to connect to it! Could some one help me figure out what I missed?
Thanks in advance.
Graham
|
|
|
|
|
SpudgunDoogal wrote:
All I want to do is have a COM+ service running on a server and my client to connect to it! Could some one help me figure out what I missed?
I know that it is an obvious question, but have you exported a COM+ application proxy to the client computer?
ORACLE One Real A$#h%le Called Lary Ellison
|
|
|
|
|
I completely forgot to do that bit! It's been a while since I last did any COM! When I try to export the application proxy I get the error:
"Error Code 8002801D - Library not registered"
All the registry entries are there and appear fine. I'm running the component under Windows 2000 with service pack 3. Any ideas?
Thanks
Graham
|
|
|
|
|
Using RegMon I discovered that there seems to be some registry keys missing. The COM+ exporter is looking for the CLSID value in HKLM\SOFTWARE\Classes\NameSpace.Class\CLSID. Which doesn't exist for this component.
Why would that be the case? I've added it to the GAC and used regsvcs to register it with Component Services. Have I missed another step?
Thanks again for all your help.
Graham
|
|
|
|
|
SpudgunDoogal wrote:
Why would that be the case? I've added it to the GAC and used regsvcs to register it with Component Services. Have I missed another step?
Try generating a Type Library with regsvcs /tlb and registering this tlb by hand, see if it helps.
ORACLE One Real A$#h%le Called Lary Ellison
|
|
|
|
|
I'm writing a small application that needs to take a DataSet and dump it to either a Comma Delimited text file or a Tab delimited text file. I was wondering if there are any "proper" ways to do this, using built in functions or classes, or if I should just manually write out the proper format to a standard text file. Writing it out myself is trivial, but if theres an established way of doing this with .NET I would like to know.
Thanks
Dave Ratti
|
|
|
|
|
Nope, just a "proper" way to write it out to XML.
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
|
|
By now you have probably already solved this problem, but just incase you havent I recently put the following code together to read a file as a dataset and vice versa :
public static DataSet ReadFileAsDataSet(string filePath, string fileName)
{
OleDbConnection oCon = new OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + filePath + ";" +
"Extended Properties=\"text;HDR=NO;FMT=Delimited\"");
OleDbDataAdapter oCmd = new OleDbDataAdapter(
"select * from "+fileName, oCon);
DataSet ds = new DataSet();
oCmd.Fill(ds);
oCon.Close();
return ds;
}
public static void WriteDataSetAsFile(string filepath, string fileName, DataSet ds)
{
if(File.Exists(filepath + "\\" + fileName))
File.Delete(filepath + "\\" + fileName);
StreamWriter sw = new StreamWriter(filepath + "\\" + fileName, true);
foreach (DataRow dr in ds.Tables[0].Rows)
{
object[] objRowData = dr.ItemArray;
string strRowData = string.Empty;
foreach(object obj in objRowData)
{
strRowData+= "\"" + obj.ToString() + "\",";
}
strRowData = strRowData.Remove(strRowData.Length - 1, 1);
sw.WriteLine(strRowData);
}
sw.Close();
}
|
|
|
|
|