|
Thanks - found it!
Figuring out how to use is a nice task for tomorrow...
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
I have a strange question:
In .NET, is it still standard to prefix a class with "c" and an interface with "i" like has always been done with C++ and VB?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
No, and it was never standard to do that in any language that I can think of.
|
|
|
|
|
For instance, IPersist, IViewObject2, etc. and CCosmoDoc, CPages, etc. I know it is standard to prepend an "I" to the name of an interface. It was always standard in certain instances to pre-pend classes with a "C".
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
jdunlap wrote:
In .NET, is it still standard to prefix a class with "c" and an interface with "i"
Classes don't have a prefix, but the prefix on interfaces has stuck around. I presume to make them stand apart from other datatypes.
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
I already knew that I was still prefixed to interfaces, so I don't know why I lumped it in with the Class prefix thing. After reading the article mentioned below, I agree that prefixing classes with a "C" is futile.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Check out this page[^] I came across yesterday.
|
|
|
|
|
Good article though. I follow those conventions except for the "underscore on the end of class-level variables" thing. For class-level variables, I do m_varname
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Is there a utility that will take a win32 executable and generate a P/Invoke wrapper class for all the function that it exports.
|
|
|
|
|
The basic answer is no.
Imagine a tool that would do just that. Unless all functions pass and return trivial parameter types like int and char*, tell me how this tool manages to wrap the structures, classes, or whatever might be mangled in the exported functions without knowing their declarations ?
My recommendation is to use MC++ mix mode instead. That is write a wrapper library which does internally all native calls, and don't need marshaling. A bit overkill though if you only need a few interop to be done.
[edit]I have an url[^] for you.[/edit]
|
|
|
|
|
Yeah, I understand that you can't do functions that return custom parameters.
I just wan't to do the basic ones, like you said - the ones that return string, int, intptr, bool, etc.. I know that there are tools that make a list of exports. It shouldn't be that hard to take a list of exports and make the p/invoke code.
|
|
|
|
|
AK wrote:
It shouldn't be that hard to take a list of exports and make the p/invoke code.
I disagree. Suppose one of C/C++ parameters is LPSTR. How does the converter know that's an input parameter (C# string), or output parameter (C# out string). Another example, many functions in the WIN32 API use two parameters to allow to pass a fix-size LPSTR string along with the max size of it. You know this got to be translated using C# stringbuilder. Again how does the converter knows it ?
I could go on for years, especially if you get me started on marshaling issues, which add noise to it.
The only thing I see is the equivalent of the WIN32 API viewer, that tiny tool provided by MS in their site and which allows to interactively browse the WIN32API.txt file. May be someone is bold enough to write a WIN32API.csharp.txt will all premarshaled stuff in it. Here is an entry point[^].
|
|
|
|
|
System.IO.Stream sound_stream = new MemoryStream(buffer);
DirectSound.Buffer k = new DirectSound.Buffer sound_stream,applicationDevice);
--------------
Well, the buffer is a byte[] that I record from DirectSoundCapture , Now I want to play this byte[] , I study MSDN know that I should create a Stream
and write buffer in . Then create a SecondaryBuffer to play this Stream , my code is above , but it shows a error such that :
An unhandled exception of type 'System.ArgumentException' occurred in microsoft.directx.directsound.dll
Additional information: Value does not fall within the expected range.
I can't solve this problem , can anyone help me ???
Of course , I can write buffer into file and then open it , but I don't want
to waste time to do this process , I want to play sound form the buffer directly .
If you have a solution or can't understand about my post , please mail to me
j741119@Ethome.net.tw
Thank you for reading this bad grammar article .
I am Craze JmmJ !!! A student from Taiwan who are instrest in Programming.
|
|
|
|
|
JmmJ wrote:
System.IO.Stream sound_stream = new MemoryStream(buffer);
DirectSound.Buffer k = new DirectSound.Buffer sound_stream,applicationDevice);
System.IO.Stream sound_stream = new MemoryStream(buffer);
DirectSound.Buffer k = new DirectSound.Buffer<big>(</big> sound_stream,applicationDevice);
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
I knew that post would catch you.
|
|
|
|
|
.S.Rod. wrote:
I knew that post would catch you.
Yeah, nothin escapes the Code Police
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
OHHHH......... What a terrible bug it is . @@
|
|
|
|
|
I would like to create a help/info documentation for programms like in the VS .NET help.
What is the way to get on to it?
Any links?
Thanks
Stefan
|
|
|
|
|
|
http://ndoc.sourceforge.net/
|
|
|
|
|
Hi,
I'm using MSHTML in my project, as wrapped in Microsoft.mshtml. Does the .NET garbage collection automatically take care of these resources? Can I explicitly dispose of them somehow? I'm a bit concerned that there might be some memory leaks if I create a large DOM tree and then don't dispose of it somehow.
Thanks,
Arun
|
|
|
|
|
1. If you are concerned about memory internals anyhow, may be managed code is not the most adequate language.
2. Marshal.ReleaseComObject(...)
|
|
|
|
|
1. If you are concerned about memory internals anyhow, may be managed code is not the most adequate language.
Yes, that's true, but it's the best language for my task right now.
2. Marshal.ReleaseComObject(...)
Well, I tried that, and I see no indication that the memory is being deallocated.
I also have this code before that -- myObject is IOleObject for the HTMLDocument object I'm using.
const int OLECLOSE_NOSAVE = 1;<br />
myObject.Close(OLECLOSE_NOSAVE);<br />
myObject.SetClientSite(null);<br />
Thanks so much for your time, you are a true Samaritan.
|
|
|
|
|
Arun Bhalla wrote:
Well, I tried that, and I see no indication that the memory is being deallocated.
The best I can do for you is point the url[^] to one of the horses behind the CLR.
Arun Bhalla wrote:
I also have this code before that -- myObject is IOleObject for the HTMLDocument object I'm using
Internet Explorer is known for having leaks. Welcome to the club!
|
|
|
|
|
The subject pretty much says it!
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|