|
Hi,
Can anyone tell me wat will be the return type if i am returning a interface?
i.e. My code has a function which has to return an interface..so wat should be my return type for that function.
Thanx,
SRUJANA
|
|
|
|
|
I don't get the question. If you need to return an interface, then that interface is the return type. So, if you want to return an IDisposable, then IDisposable is your return type.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: I don't get the question.
You aren't the only one. I couldn't figure out exactly was being asked. Must be getting tired here
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
You can return an object which impelement interface.
marcin
|
|
|
|
|
The return type will be your interface, as already said. The underlying object should be one that implements your interface, directly or indirectly.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Hi,
Anyways thank u all. I guess my question was not clear. I found the solution to the problem.
Thank you,
SRUJANA
|
|
|
|
|
Hi Fellows:
I am facing an error of access voilation while running a piece of code with Unsafe Context...I am developing steganographic application.And I want to embedd DataImage into Cover image using LSB method with the help of Lockbits() and UnLockBits () methos..
But when I compile the code it is compiled & Build succesfully.But at run time the app. frozes and with the following error message for the statement.
<code>byte bb=ptr1[0] //where ptr1 is byte type pointer that points to Scan0 ,i.e 1st byte of locked image array. </code>
<b>Error :AccessVoilationUnhandelled exception</b>
Plateform :Visual C# Express edition VS.Net 2.0,Win XP
<b>Error Message:</b>
AcessVoilation: attempt to read or write protected memory.This is the oftenindication that other memeory is currupt.
also I am thanfull to Chorrina John...who write very helpful articles on Steganography...I request If she is there please help & Supervise me in my project.
Waiting for ur good response...
Thanks
I am getting B.S. degree in Computer Science.And want to enhance career in Software development.
pineer programmer
|
|
|
|
|
Most likely cause - you're looking past the bits that contain the image, or you're looking past an individual scanline, not taking the stride value into account. You can read my image processing articles to see how you should iterate over the bits of an image.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi guys,
I am new to file operation in .NET.I read few articles on FileStream class.I know seek() method.But guys how can i insert some text say "xyz" at
2nd line and at 5th index.Example
File1.txt
---------
hello
billgates
how r u?
---------
output :
hello
billgxyzates
how r u?
Solution wud be appreciated.
Thank u in advance
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
You can't insert text. You need to read the whole file, insert the text in memory, and write it out again. There may be a helper method that does that, but under the hood, that's what it will do.
If there is a helper method, it will be a File. method ( static on the File class )
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi, anyone can advice me on how to add a new rectangle or other shapes on a custom control.
How to ensure that the shape selected(mayb using a button with the specified shape name) is added/drawn on the custom control AND that the shape can be treated individually. For example, only the selected shape can be resize.
Please note that, there can be more than one shape that can be added into in the custom control by using the button.
|
|
|
|
|
If you want to deal with the shape after it exists, you need to keep track of the shapes you are drawing, draw them in your paint event, and write the code to work out when the user interacts with the shape specifically, and what it does as a result. You have to write it all, you can't just add a box to a control and expect the control to know where it is, or what you want to do with it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi, i was wondering if i were to use a custom control just like another form or canvas to do my drawing, one way is putting conditional 'if' statements to check when or where to draw the things i wan to draw in the custom control. Is there any other way to do my drawing instead of putting all the drawing codes in the OnPaint?
thanks in advance.
|
|
|
|
|
No, that's what OnPaint is for.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am working on some drag and drop code.
When some data is moved over a target which accept it I want to show a data preview.
For this I attempt to create an UIElement with the default DataTemplate.
Problem is, I don't know how to setup the UIElement returned by the DataTemplate! (i.e. setup it binding correctly)
IDataObject ido = ......;<br />
object data = ido.GetData("some key");<br />
FrameworkElement target = sender as FrameworkElement;<br />
DataTemplate dt = target.FindResource(data.GetType()) as DataTemplate;<br />
UIElement ui = dt.LoadContent() as UIElement;<br />
<br />
ui.....= .....
PS: I do need to get the UIElement, as I measure it to position it relatively to the mouse position.
|
|
|
|
|
I'm just curious.
I have about 5 years worth of web development experience. Back in April, I decided to go back to School for programming in .net. The track I'm tacking will have me completing different exams before I'm all done. Are MS certifications held in high regard in enterprise situations? Every job I see advertised seems to want a BS in computer science (which is ironic becuase most computer science studies do not delve very much into .net. I guess I'm a little nervous that after I have my 5 certs and no BS degree, will I still be able to get decent programming jobs, or am I crippled because of no degree?
|
|
|
|
|
In my experience most employers are looking for the degree, but in my opinion knowledge, ability & experience mean the most. Yes my employer helped me get my MCAD & MCSD (.Net for both) certifications but when they hired me there were more interested in:
1) Knowledge/Experience
2) Education (they wanted a BS Degree)
Certifications never entered into the conversation. Like I said, this is just my experience & opinions.
"It's only that urgent if you have to pee."
Dave Kreskowiak
|
|
|
|
|
Psycho-*Coder*-Extreme wrote:my experience most employers are looking for the degree
Seems like it. It probably depends on the area labor pool.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
how do you hide unsupported method from a base class ? so that they don't show up in intellisense.
|
|
|
|
|
Make them private.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Hmmm, after further research, I don't think you can.
I thought this would do it:
public class ClassA
{
public void DoStuff( )
{
}
}
public class ClassB : ClassA
{
private new void DoStuff( )
{
}
}
But the ClassA's DoStuff is still accessible.
I tried this too:
public class ClassA
{
public void DoStuff( )
{
}
}
public class ClassB : ClassA
{
[Obsolete]
public new void DoStuff( )
{
}
}
But that just tells you that the method is depricated in intellisense.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Steve Echols wrote: just tells you that the method is depricated in intellisense
You could just put it there to kind of shoo people away from it. Get them thinking "I better not use this method, it might not be there in the next release of the class"
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
The question isn't clear. Does he want the method hidden to the subclass or to the outside world?
Of course, he can opt to implement the method anyway and have it throw a NotSupportedException.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Vikram A Punathambekar wrote: implement the method anyway and have it throw a NotSupportedException
I never thought of that. Could be done.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
You can't hide the method from the base class.
Actually this is because of OO design principles: the derived class can only extend the interface not narrow it.
Maybe you should work with two different interfaces - one for your base class and one for your derived class.
btw: yes I know that in the .NET framework there are subclasses that do not fulfill the interface of the base class (some UI controls have this behaviour, but I can't remember which ones at the moment).
-^-^-^-^-^-
no risk no funk
|
|
|
|