|
You've misunderstood my question. My concern was that the fixed variable would be placed after HugeObject in memory. Since the fixedvar can't be moved, freeing HugeObject wouldn't actaully provide any more memory to be used without the memory manager using a freelist type structure to allocate memory in the space between the nonGCed objects and the fixedvar.
|
|
|
|
|
dan neely wrote:
My concern was that the fixed variable would be placed after HugeObject in memory
No, it wouldn't. HugeObject would end up on the Large Object Heap. Your int would not be allocated on the same heap.
Also, fixed can only allocate pointers. You can't use it to allocate an int , but you can use it to allocate a pointer to an int . In order for the pointer to be valid, the fixed statement pins the target of the pointer so the GC can't move it. Once the fixed statement is no longer in scope, the pinned object is released.
Point pt = new Point();
fixed ( int* p = &pt.x )
{
*p = 1;
}
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
In client and server environment. My client make a request to the server, then server need to create a new Appdomain object "ad", then create an object "so" from this new Appdomain for client to use, My questions are:
(1)How to create a new channel and register this server object "so" in the new domain, I went through all the Appdomain class members, still don't have a clue.
I am thinking to use "ChannelServices.RegisterChannel(new IpcChannel(portName))", but how to associate this to new Appdomain object "ad" or "ad" event(I am guessing)?
(2)If (1) succeed, how I let my client know or pass the reference of new registered object to the client since client won't be able to know the channel information in advance?
You help is highly appreciated!
Hang
|
|
|
|
|
sir, i'm learning vb.net,c#.net in a institute.
can i got a job with 50,000(Rs.) salary or is there any wanted.
i want to do my project in .net
write me any concept
|
|
|
|
|
Anonymous wrote:
sir, i'm learning vb.net,c#.net in a institute.
Good
Anonymous wrote:
can i got a job with 50,000(Rs.) salary or is there any wanted.
That's about US$1,104 a year. It sounds like you're worth it.
Anonymous wrote:
i want to do my project in .net
Good
Anonymous wrote:
write me any concept
You sound like a real candidate for www.rentacoder.com. They get people with little skill in the third world, and pay them badly, to write bad code. You should check it out.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I've developed a simple C# program (for PocketPC), and It sometimes crashes with an unhandled exception... and I thing it is related to UI matters. The message is this:
Exception
Application::Run+0xf
Form1::Main+0xa
Mi application read info from serial port (from a GPS), with this event handler:
private void OnDataReceived(object sender, SerialDataReceivedEventArgs e) <br />
{ <br />
while(port != null && port.BytesToRead > 0) <br />
{ <br />
int Cnt = port.Read(portBuf, portPos, 1); <br />
<br />
if (Cnt != 0) <br />
{ <br />
if (portBuf[portPos] == '\n') <br />
{ <br />
string sentence = Encoding.ASCII.GetString(portBuf, 0, portPos-1); <br />
AddResult(sentence); <br />
<br />
portPos = 0; <br />
} <br />
else <br />
{ <br />
portPos++; <br />
} <br />
} <br />
}
} <br />
<br />
After much investigation, now I am able to cause that exception by clicking a button. The code is this, simple one:
<br />
private void btnClosePort_Click(object sender, System.EventArgs e) <br />
{ <br />
Cursor.Current = Cursors.WaitCursor; <br />
<br />
Thread.Sleep(1000); <br />
<br />
try <br />
{ <br />
port.DataReceived -= new SerialDataReceivedEventHandler(OnDataReceived); <br />
Thread.Sleep(1000); <br />
<br />
port.Close(); <br />
port.Dispose(); <br />
port = null; <br />
} <br />
catch (Exception ex) <br />
{ <br />
AddResult("-->Failure"); <br />
AddResult(ex.ToString()); <br />
} <br />
<br />
Cursor.Current = Cursors.Default; <br />
<br />
AddResult("-->Closed"); <br />
}<br />
Notes: AddResult simple does add strings into a ListBox.
The really strange thing is this: if I remove the AddResult(sentence) call in "OnDataReceive", the exception is not thrown.
Could it be any bug related to UI ?
My hardware: iPAQ 2100 , Windows Mobile 2003 SE
Hope you can help me
Thanks to all!
|
|
|
|
|
the ShortCut work fine, you just put & charecter on text, and use Alt key
with letter.
but i have problam:
we have a form with English Input textbox, but the ShortCut is on another
InputLanguage.
in MSAccess the shortcut work with 2 Language, but in dotnet the shortcut
must be on the same
language as InputLanguage!
i try to find event, or windows msg, to trap the point befor DotNet search
after control with shortcut,
but it's not work.
please help!
|
|
|
|
|
Assumption: both my server and client will use
System.Runtime.Remoting.RemotingConfiguration.Configure(configFile);
to read configuration file
Following are couple of ways I tried, none of them works:
(1)SERVER side:
<configuration>
<system.runtime.remoting>
<application>
<channels>
<channel ref="ipc" portname="IpcChannelOne">
<channel ref="ipc" portname="IpcChannelTwo">
<service>
<wellknown type="MyServer.RemoteObjectOne, ServerAssembly"
="" objecturi="RemoteObjectOne.rem" mode="Singleton">
<wellknown type="MyServer.RemoteObjectTwo, ServerAssembly"
="" objecturi="RemoteObjectTwo.rem" mode="Singleton">
CLIENT side:
<configuration>
<system.runtime.remoting>
<application>
<client>
<wellknown type="MyInterface.IRemoteObjectOne,
InterfaceAssembly"
="" url="ipc://IpcChannelOne/RemoteObjectOne.rem">
<wellknown type="MyInterface.IRemoteObjectTwo,
InterfaceAssembly"
="" url="ipc://IpcChannelTwo/RemoteObjectTwo.rem">
(2)SERVER side
<configuration>
<system.runtime.remoting>
<application>
<channels>
<channel ref="ipc" portname="IpcChannelOne">
<service>
<wellknown type="MyServer.RemoteObjectOne,
ServerAssembly"
="" objecturi="RemoteObjectOne.rem" mode="Singleton">
<channels>
<channel ref="ipc" portname="IpcChannelTwo">
<service>
<wellknown type="MyServer.RemoteObjectTwo,
ServerAssembly"
="" objecturi="RemoteObjectTwo.rem" mode="Singleton">
CLIENT side:
no change
(3)SERVER side:
<configuration>
<system.runtime.remoting>
<application>
<service>
<channels>
<channel ref="ipc" portname="IpcChannelOne">
<wellknown type="MyServer.RemoteObjectOne, ServerAssembly"
="" objecturi="RemoteObjectOne.rem" mode="Singleton">
<service>
<channels>
<channel ref="ipc" portname="IpcChannelTwo">
<wellknown type="MyServer.RemoteObjectTwo, ServerAssembly"
="" objecturi="RemoteObjectTwo.rem" mode="Singleton">
CLIENT side:
no change
(4)SERVER side
<configuration>
<system.runtime.remoting>
<application>
<service>
<channels>
<channel ref="ipc" portname="IpcChannelOne">
<wellknown type="MyServer.RemoteObjectOne, ServerAssembly"
="" objecturi="RemoteObjectOne.rem" mode="Singleton">
<channels>
<channel ref="ipc" portname="IpcChannelTwo">
<wellknown type="MyServer.RemoteObjectTwo, ServerAssembly"
="" objecturi="RemoteObjectTwo.rem" mode="Singleton">
CLIENT side:
no change
Please advise what is the right way to create both client and server side
configuration files.
Your help is highly appreciated!
Hang
Hang
|
|
|
|
|
i developed an applicatin in c#.net using the bandobjects. its a kind of deskbar like the google deskbar.
when i am trying to build its installer its doesnt register the dll which need to be registerd and if i register those twoo dll's through command line with "regasm" it starts working.
can anybody pls help me to know how can i run a batch file through a installer or is there any other way to do it.
i tried all the option available with the .net setup like the vscom register .
Thanks in advance to help me.
|
|
|
|
|
I'm not sure why the setup is not correctly registering the assemblies in the first place. First I would google and see if you can find more information.
But troubleshooting installs can be very complicated.
Alternatives are:
1) You can add an Installer class to the setup that uses conventional C# or VB.NET code to shell out the command line to register the assemblies. See the MSDN or search for articles on using Installer classes.
One disadvantage to using this approach is that you cannot rollback the process in an uninstall. By the time the Installer class code runs during an uninstall, the assemblies will already be gone, so regasm run from a commandline will not be able to unregister them. So the registry entries for the assemblies will be left on the machine.
2) You can accomplish a clean uninstall by not using regasm at all, but instead by creating all the equivalent registry entries directly. In this approach you must first determine all of the registry operations that are created during a regasm registration of the assembly. Then you add these keys to be written during during an install, and deleted during an uninstall. This approach is tedious and more difficult but it does result in a more professional setup that uninstalls cleanly. The trick is determining all the registry keys. There are various tools available that will "spy" on the registry and log any changes that can help you do this. But if you go this route, you must be careful to test, test and test again!
|
|
|
|
|
Hi all,
I just want to share this with you. There's people who loves writing software in notepad, i'm one of them. Programming with notepad can get you a big headache but in my opinion is more flexible in terms of custom components (custom editor, custom compiler, custom resource creator) and is very handy at compile time, using batch files (.bat) is the most common option for compilation when notepad is used instead an IDE.
I just found an incredible Opensource text editor for us: Notepad++
http://notepad-plus.sourceforge.net/uk/about.php[^]
You can download an executable with installer and a zipped version for people who likes "clean" apps.
It's not a resource hungry app, it's a notepad with syntax highlighting (many languages) and format encoding, and no additional features such as code completion, and others. It's a real tool for real brainy programmers.
Enjoy
|
|
|
|
|
In a Windows Form project, one inherited form from FormBase has one toolbar and one imagelist, both are public.
The imagelist object is linked to toolbar object. My problem is that the images don´t appear on the buttons of toolbar object when I add new buttons to toolbar, new images to imagelist object ,link them through Imageindex property and compile the code.
I realized that the source code generated for buttons in the InitializeComponent session are in the upper position of the source code generated for toolbar object. It may have cause the problem because the buttons have been defined before the toolbar is initialized.
How could I solve this problem? I would like to inherit others forms from FormBase and customize the toolbars per each form.
Please find below the code sample for InitializeComponent method. Please see that the ToolBarButton1 is added to toolbar before its definition.
'
'ImageList
'
Me.ImageList.ImageStream = CType(resources.GetObject("ImageList.ImageStream"), System.Windows.Forms.ImageListStreamer)
'
'Toolbar
'
Me.Toolbar.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.ToolBarButton1})
Me.Toolbar.Name = "Toolbar"
Me.Toolbar.Size = New System.Drawing.Size(345, 28)
'
'ToolBarButton1
'
Me.ToolBarButton1.ImageIndex = 0
Att,
Emerson Valente
-- modified at 16:18 Tuesday 13th September, 2005
|
|
|
|
|
Got this in English? It's an English speaking board...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am working on a touchscreen jukebox program like some of the more modern ones you may have seen in bars or pool halls. It's quite generic right now but I have been playing around with the ListView control to display an accurate representation of the current playlist. I have gotten it so that the user can DragDrop items (music files) in (*not "into" from an outside source..yet) the playlist to alter the order of the songs, i.e. move track 1 to track 3, thus resulting in track 2 becoming track 1 and track 3 becoming track 2. You get the picture. Actually it's quite like the playlist ListView in Windows Media player right now. In any cause, when the user moves the media up and/or down the list I am drawing a line on the ListView Control between the items that the chosen media is to be moved and thus inserted. I am using Graphics and Graphics.DrawLine and it works fine. However, I have to ListView.Refresh() everytime the line changes otherwise a whole bunch of lines will just continue to be drawn on the playlist ListView. It is in Detail Mode Behavior btw. This is all dandy when I have just a few items in the playlist but when I get around 30 or so when I drag an item to be moved the ListView Refreshing causes the control to flicker. Nothing major but annoying and unprofessional. How do I get this to quit? The Media Player for Windows does not flicker. Also on a side note, when the playlist becomes too big for the ListView the scrollbars take effect however on mine I get a horizontal one as well and do not want it. Do I have to resize the ListView when it reaches a certain number of items to accomodate the width of the vertical scrollbar or is there a way to tell the ListView control not to display the horizontal scrollbar at all? Any help, suggestions, or comments would be greatly appreciated.
|
|
|
|
|
Gate Crasher wrote:
I am working on a touchscreen jukebox program like some of the more modern ones you may have seen in bars or pool halls.
Cool - I wrote one of those in C# a while ago. What do you use to play the files, DirectX or WMP ?
Gate Crasher wrote:
I have been playing around with the ListView control to display an accurate representation of the current playlist
I reckon you'd be better off with your own control, I found that I was.
However, the first step to eliminate flicker is to turn on double buffering.
SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true)
UpdateStyles()
in your form object. I'm not sure if VB lets you do |, or if + will do.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
I'm not sure if VB lets you do |, or if + will do.
It's ControlStyles.DoubleBuffer Or ControlStyles.UserPaint Or ControlStyles.AllPaintingInWmPaint
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
Did you try enclosing the code within the Refresh method within BeginUpdate/EndUpdate? Something like
void Refresh()
{
listView.BeginUpdate();
...
listView.EndUpdate();
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi, I'm interested in pursuing a career in the IT field as a programmer. My question is, What language should I start out with? I already know BASIC, and was thinking about self-learning C++, but I didnt know if I should just go into .net instead. So, what do you guys think? Is learning c++ important/necessary? Also, is it a good language to kick start my programming knowledge? If not, what is a good language to start learning with?
|
|
|
|
|
It depends on what sort of stuff you want to program.
C# is great for business applications.
C++ is used for games programming and lower level stuff, and still used for business applications.
C is used mostly in operating systems.
This isn't a precise list by any means, but it should get you thinking about what direction to go in. Perhaps if you provide more information you can get a more accurate answer for your situation.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
i downloaded the popup control from this site....
added it to my toolbox and then to my app.
it worked so-so for about an hour and then, without any changes to the control....
it started giving me:
Parser Error Message: Access is denied: 'eeeksoft.web.popupwin'.
and my app will longer run.
anyone have any clue as to why this is happening???
|
|
|
|
|
You should ask on the forum at the bottom of the article page where you got this control. This is a general .NET Forum.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Hi,
I developed a Word add-in in Visual c# .net, and have been testing it in Microsoft Word running on the same machine that I developed it on. There were no real installation issues and it runs fine. I now want to install the add-in on another computer (that doesn't have Visual c# .net installed).
I tried to install as per instruction at msdn
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q316723
which says to build the <addin>Setup project in Visual C#, copy over the resulting folder to the target computer and run setup.exe in this folder. I did this and the setup seemed to work fine but when I subsequently tried opening the add-in in MS Word, I got the error message "not a valid Office Add-in". Anybody got any ideas, I'd be very grateful?
Also, I noticed another msdn article about using a shim. How does this differ from the approach above? Is it just a security issue?
Thanks in advance.
|
|
|
|
|
Sorry, I have never created an add-in using NET, only VS6. But since no one with more relevant experience has responded, one question:
Did you also install the NET framework on the target computer???
|
|
|
|
|
Hi,
Thanks for reply. Yes, I did install .Net framwork on the target.
|
|
|
|
|
I have wasted my time browsing so many stupid forums with VB vs. C# debates. What I've come to realize is that you're all arguing over the wrong thing! This is because VB = C# and C# = VB! I know you're all pissed that I've just said this, but it's true! Sure the syntax is different, but some of the time it's just a matter of whether or not to add a semicolon. Anyone who can read a VB program can read a C# program. I have used VB for over 7 years and have just made the transition to C# with very little effort. If you worship C# like a god and despise VB, then wake up and smell the coffee. C# is just as simplistic as VB. And if you're a VB programmer, don't think you can't handle C#. Just find a good web reference that explains the differences, and you can start using C# right away. For a good reference, see the VS documentation at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxgrfLanguageEquivalents.asp.
The real debate is the one that has been around since well before .NET came around - VB (or C#) vs. C++. C++ is a much richer, complex, and "grown-up" language. Neither VB or C# hold a candle to it (at least not in their current versions).
And one more thing I want to get off my chest. VB6 programmers - grow up! Stop using your COM wannabe toy that produces too much buggy crap, and start using .NET!
|
|
|
|
|