|
Ok, I was lucky enough to find a great source off the web. Now I have this understanding that WebService is more like transferring data rather than "objects". DUH!
If anyone wish to elaborate, that would be helpful as well. I now understand what is is mainly used for.
|
|
|
|
|
I think you're misunderstanding the purpose of web services. Typically, web service are used in distributed applications where one part of the application needs to consume some service e.g. request data or initiate a process on another remote part of the application. Web services are part of the business layer of an application. They are not suitable for UI-related operations.
Paul
|
|
|
|
|
I don't think you would want to try and control the visibility of a gridview in a webservice. You may want a webservice to return a dataset which is the data that the gridview is displaying.
Ben
|
|
|
|
|
Thanks all. I appreciate it. I've misunderstood the usage of WebService indeed. Looks like I'm on the right path now. Off to the yellow brick road.
|
|
|
|
|
I try to make import the DLL that i wrote in C# to C++ project and i getting this message
Error 1 fatal error C1083: Cannot open type library file: 'c:\.... DLL file path ....\maintdll.dll': Error loading type library/DLL. c:\.... DLL FILE PATH ......checkinguiincpp\checkinguiincpp.cpp 6
Someone can help me ?
|
|
|
|
|
Are you trying to import .Net dll to Unmanaged C++ ?
|
|
|
|
|
Is your C# COM dll registered on the system using the RegAsm utility in the .NET SDK? Can you look at your C# COM dll using the OleView utility?
|
|
|
|
|
I can see the TLB file - but i cant see the dll in the oleView.
The registration with RegAsm does not help.
What to do next ?
|
|
|
|
|
Yanshof wrote: The registration with RegAsm does not help.
When you run RegAsm on your dll, what happens?
|
|
|
|
|
I run it on the command line - and i getting back this message
Types registered successfully
|
|
|
|
|
Hiya
How can i create a sub form. Actually what i want is after i press a button on my parent form. It should open up a new sub form and hide the parent form and when i close the sub form, my parent form should comes up again.
Do i have to add sub forms to the application or how does it work basically....
Any help would be greatly appreciated.
Thanks
|
|
|
|
|
To simply create a sub-form that forces the user to use that sub form and not switch back to the parent form, use subForm.ShowDialog(parent); it will create a modal form that forces the user to use it before going back to the main form.
|
|
|
|
|
Can you pls tell me in a bit detail...
I have created a windows project and at the moment it has only one form. Over that i added a button and double click over button to write certain code to open up a new form and hide that one. So do i have to add another form first or how does it work. If i add another form i.e. Form2 then i can't write the code you said under the button action ...
i.e Form2.ShowDialog(Form1);
Nopes the intellisence doesn't give me any ShowDialog option...
Thanks
|
|
|
|
|
Software_Specialist wrote: i.e Form2.ShowDialog(Form1);
Nopes the intellisence doesn't give me any ShowDialog option..
Create an object of Form2 and then do a ShowDialog() .
private void btnOpenForm_Click(object sender, System.EventArgs e)
{
Form2 objForm = new Form2();
objForm.ShowDialog();
}
If you want to hide a form and reshow then you would need to send an object of your current form to Form2
In Form1
private void btnOpenForm_Click(object sender, System.EventArgs e)
{
Form2 objForm = new Form2(this);
objForm.Show();
this.Hide();
} In Form2 you store the object of Form1 and when you close the form, do a Show() on the object you sent from Form1.
private Form frmParent;
public Form2(Form objForm)
{
InitializeComponent();
frmParent= objForm;
}
private void btnClose_Click(object sender, System.EventArgs e)
{
this.Close();
frmParent.Show();
}
|
|
|
|
|
Thanks for your reply..
But only one part of your explanation is working. i.e. first part. Now i am able to open a second form.
But i am unable to hide it and also 3rd part is not working. If i include this then i get error over the main form button control that Form2 needs argument...
Form2 objForm = new Form2();
public Form2(Form objForm)<br />
{ InitializeComponent(); <br />
frmParent= objForm;<br />
}
So any guesses...???
|
|
|
|
|
I suggest you take a beginners cource in C# first and study the chapters on classes and methods.
You specify the a class Form2 with a constructor that reuqires an argument. So he compiler tells you to include the argument. In this cae, you want to pass a reference to the calling form, so you should specify:
Form2 objeForm=new Form2(this)
this refers to the current object in this case.
Rudolf Heijink
|
|
|
|
|
well ok ill take beginner lesson in windows programming...You know any good book for that ?
And yeh what you said i already tried that and it isn't working.
Well you said its too simple but still no body could answer me correctly...strange..
Are you advance level programmer or a beginer ? May be some one experience in this could give me correct answer..
|
|
|
|
|
a book can only teach you so much, unfortantly they can teach you how to think, if they could i would read more than i do.
a book form wrox is probably best to start with as they do a lot of beginners books.
but with problems like this, you really need to turn the internet off (e.g dont ask for help) get a pen and paper and go through the logic of how it would be done.
the code given above shows you the syntx (passing control to second form show and hide) the rest is up to you to piece together.
i've posted below how to do it, look at it and try and figure out the logic behind it, if you want to become a programmer.
|
|
|
|
|
Well said
Yeh i am not a beginner but yes i don't have much experience with windows programming and this was one of the problem. I have read many books but they don't mention anything about windows programming. So i though may be somebody could help me out as i knew it was a simple problem.
Anyway thanks for your input and i have now solved this problem forever.
|
|
|
|
|
To behosest, no there are no good books that cover all topics of programming C#, object orientation and .NET to give you a structured background. I am an experienced C++ programmaer and for some time I am learning C#. If it is not working, you may try posting your code and the error messages you receive. It is difficult to see what you do wrong without code.
Learning programming is a tough job. You need to understand lots of rules and concepts and you will make many mistakes. Maybe one practical tip: try to use intellisense in de Visual Studio IDE. For instance, if you just type:
Form2 myform=new Form2(
and wait a second, it shows you the required parameters. This may be very helpful.
Stuyd the samples on Codeproject helps a lot and start with very simple applications.
For learning C# and .NET I use following books:
Programming C#, jesse Liberty (O'Reilly). I think it is reasoable good.
Windows Forms2.0 programming, Chris Sells and Michael Weinhardt (Addison Wesley). usefull, but not really for beginners. Covers a lot of topics.
.NET book 0 by Charles Petzold. Its about C# programming a good introduction if you have programming experience. You can dowload it for free from Petzolds website.
Applied Windows .NET framework programming by Charles Petzold. Its old, you should buy his new book with somethiong like CLR programming in it. This contains mainly advanced stuff, but is usefull.
There are more books, but either they are poorly written or advanced stuff or they stop where it gets really interesting. I did not find any complete overview explaining whats in .NET
Rudolf Heijink
|
|
|
|
|
I got one more part working i.e. when i close the form2 then form1 doesnt get closed..
The code is...
Form1 code ->
<br />
public partial class sForm1 : Form<br />
{<br />
public sForm1()<br />
{<br />
InitializeComponent();<br />
}<br />
<br />
private void sformbtn_Click(object sender, EventArgs e)<br />
{<br />
Form2 objForm = new Form2();<br />
objForm.ShowDialog();<br />
<br />
this.Hide();<br />
}<br />
}
Form2 code ->
public partial class Form2 : Form<br />
{<br />
private sForm1 frmParent;<br />
public Form2()<br />
{<br />
InitializeComponent();<br />
<br />
}<br />
<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
<br />
this.Close();
<br />
}<br />
}
So where am i going wrong..any idea..
Thanks
|
|
|
|
|
Lots wrong there.
in form2.cs
public partial class Form2 : Form
{
private Form frmParent;
public Form2(Form objForm)
{
InitializeComponent();
frmParent = objForm;
}
private void button1_Click(object sender, EventArgs e)
{
frmParent.Show();
this.Close();
}
}
In Form1.cs
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 objForm = new Form2(this);
this.Hide();
objForm.ShowDialog();
}
}
-- modified at 8:12 Friday 3rd August, 2007
modified decided to spell it out after reading other posts
|
|
|
|
|
great
So it was basically sequence problem.
Thank you its working now.
|
|
|
|
|
My requirement is on button click the cursor should be focused in the particular cell of the datagridview control.
Presently on button click i am selecting the required cell and when i click on that cell the cursor is focusing to that cell..... but i need this focus should be on button click itself.
Please help me on this
Thancks in advance
PraveenKumar Palla
|
|
|
|
|
So you want to position the cursor over a particular cell? Have you tried getting the cell coordinates in screen coordinates and then call Cursor.SetPosition?
(this is all assuming you're using Windows Forms, not some web-based grid)
|
|
|
|