|
leppie wrote:
aka ~Class or Finalize() done by GC
So I have to implement the ~Class for my component or just override the Finalize()?
Make the component implement both deterministic and non-deterministic finalization
"...if you don't want to hear things that piss you off don't piss off other people. SIMPLE." - Steven Hicks This signature was created by "Code Project Quoter".
|
|
|
|
|
A component derived class should already implement IDispose, override Dispose() (if and only if you have unmanaged resources that need to be freed)
<a TITLE="See my user info" href=http:
|
|
|
|
|
Here[^]) is an article that is newer than the other one, which has a nicer design pattern for handling disposing and finalizing.
|
|
|
|
|
Arun,
Thanks for pointing that article out. It is much better. (If fact one example in the older article will not compile w/ .NET 2003).
Thanks again.
|
|
|
|
|
Hello,
I'm looking for a way to get the memory adress of a C# object.
Any idea is welcome .
Thanks,
R. LOPES
Just programmer.
|
|
|
|
|
This is specifically hidden to the user as object address change continuously due to the GC. If you debug a program with CorDbg, these addresses will be shown, but like said, unlike C/C++ they are likely to move during each garbage collection.
Cheers
<a TITLE="See my user info" href=http:
|
|
|
|
|
Hi Leppie,
I was expecting something like that. It makes totally sense. I'm now sure.
Thanks,
R. LOPES
Just programmer.
|
|
|
|
|
You wont believe it, but I'm stuck with this issue as well (building a VM emulating the CLR VM on top of .NET). If you are intereseted look at the ld.XXXa IL instructions. There seems to be no highlevel functions for this. Maybe something like this would work (no it wont dammit). Maybe...
load an address on stack and then return that as IntPtr, but you have to carefull...
As you can see I'm bit lost too! What I do know (think rather) is that be default GetHashCode() returns the signed addr of a non Value /String object.
I could be wrong.
<a TITLE="See my user info" href=http:
|
|
|
|
|
Hi Leppie,
What is this crazy idea of yours to build a VM on top of the VM of .NET ?
Nevertheless, thank you for sharing with me your researches.
By the way, for your nBass project, the BASS library has just been updated to 1.8a.
Cheers,
R. LOPES
Just programmer.
|
|
|
|
|
This does the job perhaps:
.method private hidebysig static void*
GetAddr(object& o) cil managed
{
.maxstack 1
ldarg.0
ret
}
You need to pass a ref object, so cast the 'o' to object.
GriffonRL wrote:
What is this crazy idea of yours to build a VM on top of the VM of .NET ?
Just what you say: Crazy! But the ideas change all the time! The new idea is to have a Side by Side VM, with a different IL language (read more simplified).
GriffonRL wrote:
By the way, for your nBass project, the BASS library has just been updated to 1.8a.
Thnx, I havent worked with it for ages... maybe when I'm bored...
<a TITLE="See my user info" href=http:
|
|
|
|
|
Actually from that previous IL method it appears that when passing any object by ref, the CLR creates a pointer that holds the object, still not what you are looking for though.
<a TITLE="See my user info" href=http:
|
|
|
|
|
OK here is what works:
.method private hidebysig static void*
GetAddr(object& o) cil managed
{
.maxstack 1
ldarg.0
conv.u
ret
}
Output from Cordbg (after calling meth, but passing only c1, NOT ref c1):
object c1 =(0x00c41910) <testing.class1>
void* h = 0x00C41910
I cant see a way to do this via C# though.
<a TITLE="See my user info" href=http:
|
|
|
|
|
Here is a full sample, see the comments:
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 1:0:3300:0
}
.assembly Testing
{
.hash algorithm 0x00008004
.ver 1:0:1272:38245
}
.module Testing.exe
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 )
.imagebase 0x00400000
.subsystem 0x00000003
.file alignment 512
.corflags 0x00000001
.namespace Testing
{
.class private auto ansi beforefieldinit Class1
extends [mscorlib]System.Object
{
.method private hidebysig static void
Main(string[] args) cil managed
{
.entrypoint
.custom instance void [mscorlib]System.STAThreadAttribute::.ctor() = ( 01 00 00 00 )
.maxstack 1
.locals ([0] object c1,
[1] void* h,
[2] int32 i)
newobj instance void Testing.Class1::.ctor()
stloc.0
ldloc.s c1
call void* Testing.Class1::GetAddr(object&)
stloc.1
ldc.i4.5
stloc.2
ldloca 2
call void* Testing.Class1::GetAddr(object&)
stloc.1
ret
}
.method private hidebysig static void*
GetAddr(object& o) cil managed
{
.maxstack 1
ldarg.0
conv.u
ret
}
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
.maxstack 1
ldarg.0
call instance void [mscorlib]System.Object::.ctor()
ret
}
}
}
I dont know how one would call a ref object without adding the ref keyword in C#???
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
|
|
|
|
|
Hi Leppie,
I'm amazed !
Thank you very much for this. Coding at the IL level looks very hardcore for me . Good for you. .NET has no secret for you .
Cheers,
R. LOPES
Just programmer.
|
|
|
|
|
I want to convert word docs to XML in my app...
Anyone has any ideas?
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
Try MS Office 2003 SDK.
"...if you don't want to hear things that piss you off don't piss off other people. SIMPLE." - Steven Hicks This signature was created by "Code Project Quoter".
|
|
|
|
|
Microsoft Word XML Content Development Kit.[^]
WordML Opens Up the Word File Format
Word 2003 can use standards internally as well as externally. When you save a Word document, one of your choices is to save it as an XML file. By default, this will use Word's own XML schema, informally called WordML. WordML is now a completely open, non-binary format that captures all of the information and formatting from a document. For the complete WordML schema, download the Microsoft Word XML Content Development Kit.
"...if you don't want to hear things that piss you off don't piss off other people. SIMPLE." - Steven Hicks This signature was created by "Code Project Quoter".
|
|
|
|
|
Does c# support the "throws" keyword at method declaration?
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
No, this aint Java!
<a TITLE="See my user info" href=http:
|
|
|
|
|
yup coz I found out that it supprts the same functionality without using the throws keyword...
If I understood that properly the Exception bubbles up until it is caught...
This is much better!!
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
Hi all,
Here's my problem:
I have a webservice that works fine from a normal win forms apps, but if I try to to call it from a windows service on the same machine it just hangs. The strange thing is that it hangs on the line where the webservice object is created (MyWebservice objWS = new MyWebservice()). The webservice url is the same for both. The windows service runs fine apart from this, I've tried installing it to log on as the domain administrator and the same domain user that is logged on to the machine. I'm using windows 2000 and version 1.0 of the .net framework (1.0.3705).
Any ideas?
Regards
Andy
|
|
|
|
|
Hi. I created winform application.
And There is a empty tabcontrol. When i click menuitem to add tabpage,
i create tabpage and add tabpage to tabcontrol.
It is simple.^^
But, What i want to do is to hadle tabpage focus.
When i press mouse right button on a tabpage,the tabpage must have focus and
show the context menu. when i clicked context menu to close tabpage,that tabpage must be closed.
I don't know how to get the tabpage reference,when i press a right mouse button. Would you tell me the way to solve this problem?
As soon as possibe,i hope you write sample codes.
Help me,please.
|
|
|
|
|
Hi All!!
I have binded my text fields to DataColumns of table at runtime.In data navigation mode, all text fields of my application are disabled. When I press the 'Add New' button, all fields are enabled and cleared.
Problem is that when I focus to next control, all the data of current record is again loaded in all textboxes . While I want to remain them clear.
plzzzzzzzzzzzzzzzzz help me.
Thanx in Advance
sorry for my bad English.
|
|
|
|
|
Hi,
A few seconds past I asked to access a toolbar with
shortcuts.
Now I want also find a solution for followin problem :
My Form consists of a panel, in that panel I have other
panels (a panel for the header, for the footer and one for
the body). These subpanels have some controls.
Now, I also want to access the subpanel (ex. the
footerpanel) with a shortcut key and then use the arrow-
keys too scroll in the controls of that panel.
Is there somebody who have a hint?
Thanks in advance,
Vic
.
|
|
|
|
|
Hi,
I have a windows form with a toolbar and some other
controls.
Normally you access the toolbar-members with the mouse.
But how can you access the toolbar with a shortcut (lets
say for example Alt-T). So, you are positioned on the
first member, And too access the other members you have
(you could) to use the arrow-keys.
I need this things for the case that the mouse is broken.
Thanks,
Vic
.
|
|
|
|