Problem with Dictionary<T,U>.Keys enumerator returning invalid keys
I'm experiencing some wierd behavior with a Dictionary<T,U> class using
foreach loops, such that the Key returned in the foreach is not contained in
the dictionary.
code:
Dictionary<A, B> dict;
....
foreach(A key in dict.Keys)
{
bool foo = dict.ContainsKey(A); //returning false
}
Does anyone know what kinds of circumstances could cause this? Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117346
How to intercept IP packet from an application ???
I actually need to develop a Firewall.
What i want to do is intercept all the IP packets generated by an
application running in the same machine as my firewall application. Do you
know how to intercept the IP packets. Thank you very much for your help ! Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117345
Form resource files
Hi there. I apolgize for posting this again (from June 2nd) but I've been
researching for many days now with no success. I have an app that will be
reading arbitrary ".resx" or "resources" files passed on the command line
for instance. Given only a resource file IOW, does anyone know:
1) How the app can determine if the passed resource file contains
(localized) form resources (i.e., it stores a form)
2) If it does contain (localized) form resources, how can I then generate
that form dynamically
Note that the native .NET utility "Winres.exe" is able to do this but I
can't figure out how (not without using techniques that appear to be
undocumented). Any help would be greatly appreciated. Thanks. Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117342
what happen to microsoft.public.dotnet.framework.interop
can't find the group microsoft.public.dotnet.framework.interop. I even
tried searching by interop. has it been renamed or merged? Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117338
re-installing SDK 2
Looks like my SDK 2 has been corrupted,
what should I watch out for before I uninstall sdk2? I have installed
visual studio 2005 express, VB and c#. I also have some .net com class
built. Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117337
Static and non static functions
Is it possible for a class to have a function available both as static
and as instance function? Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117329
Remove unused methods and properties from the assemblies.
Hi,
My application is splitted into more than one assembly.
And I
want to clean up the methods which are not called or not used among
any of
the assemblies. And also I want to remove the code for those methods
which are not called in any of my assemblies.
1) I want to remove all methods (either private, protected, internal or
public) methods which are not called (invoked) among any of my
assemblies.
2) If public access modifier is not required for that method then I
want to make it either internal of protected which ever is applicable.
3) If no method is overridden in the derived classes which are marked
as virtual in base classes then I want to remove the virtual keyword
from the method signature in the base class.
It will be great if any one suggests me the tool which does all of
tasks and it will be great if that tool can remove the code from my
source code as well. Otherwise it will be great if any of the tools
generates a report based on my conditions.
Can any one suggest me the tools available to find and remove the
un-used
methods or members?
Thanks in advance. Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117328
Displaying video/images on 2nd monitor
I want to create an application (.NET C#) to run on a laptop with XP which
will allow me to select an image or video on the 1st monitor (I.e.. the
laptop's LCD screen) and for that selected item to be displayed in full
screen on the 2nd monitor (I.e.. the laptop's external monitor port).
(The 2nd port will be connected to a video editing desk via a VGA/Composite
converter.)
I'm an experienced application developer when it comes to database driven
data collection/manipulation, but I really have no idea where I'm going with
this one.
Any help or suggestions would be greatly appreciated,
Many thanks in advance,
Tom :-) Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117325
Assembly redirection: Publisher Policy
Hello,
I'm trying to create a publisher policy file for assembly redirection but
still my application is not able to load the assembly for which the created
the policy. Here are the steps I followed:
1. Create policy xml file: myassembly.dll.config
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="myassembly" publicKeyToken=<token>
culture="neutral" />
<bindingRedirect oldVersion="2.0.7.0" newVersion="2.0.9.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
2. Create policy assembly using: al /link:myassemlby.dll.config
/out:policy.2.0.myassemlby.dll /keyfile:myKey.snk
3. GAC policy assembly: gacutil /i policy.2.0.myassemlby.dll
Please let me know if there is any minor detail that I'm missing
Thanks Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117324
DataGrid/DataSet programmer help is needed
Hi there, Until today I was working with listviews...
but now i need to start working with the DataGrid object to show data
from my SQLMobile tables.
I would really appreciate if someone could contact me on MSN messanger:
chook_rl@hotmail.com
I have some questions that i'm sure that for you will be easy to
answer.
I'll post them here anyway:
The datagrid shows the two columns clientID and clientName,
How can I change the appearnces of those two, meanning that the
clientName will be on the right and the clientID on the left.
Moreover, how can I change the width of the columns on default without
having the user expand when he needs...
And the last for now.. how can I iterrate on the table, Where can I
find the bound..
(DataGrid.DataSource?DataBindings... too much stuff I get confused)
By the way, I'm programming C# .net2005 for PocketPC2003,
Thanks for any help you can provide. Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117323
how to recognize a new WMI instance ?
hi,
i need my client to do something everytime there is a new wmi instance
from a certain .net provider i created.
is there an async way to recognize it ?
i tried ManagementObjectSearcher.get(ManagementOperationObserver), but
it only recognized already existing instances !
thanks, Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117317
Fuslogvw.exe
I have install visual studio 2005 express visual basic and c#.. I was
trying to make use of Fuslogvw.exe to diagnose problems in an assembly. I
was able to use the com class assembly in one version of c style software
but not a newer version.
However, I searched the whole computer as a power user but could not find
Fuslogvw.exe..
right now I am still trying Google msdn, so far I came up empty handed Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117315
what is this file called test_TemporaryKey.pfx
Is any one know what is test_TemporaryKey.pfx file ? I see this file under my
application folder, and I try to publish my application, it pops up a dialog
box ask for the password to open this file . Any idea ?
Thanks Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117311
Bug in SerialPort Class NET 2005?
Hi All,
Can anyone tell me if there is a known bug and possible a fix for the
SerialPort Class (System.IO.Ports.SerialPort) in .NET 2005? More
specificly
to do with USB ComPorts?
I have found the following:
1) Open a SerialPort which happens to be a USB RS232 converter device.
2) Data can be sent and received OK.
3) Pull the plug on the USB device and CPU usage goes way up and memory
starts to leaking.
4) The only way to stop the leak and free the resources is the exit the
.NET
application then GC seems to clean things up.
5) Somes time you might event get a BSOD and the OS creashes (Win XP).
6) The type of USB harware does not seem to make any difference.
I belive this is a problem with the .NET 2005 framework as this problem
does
not happen in VB6 or when using HyperTerminal.
I managed to stop the BSOD by inheriting the SerialPort Class and
Overriding
the Dispose method.
When can we expect this problem to be fixed? Will it be in SP1 for NET
2005?
Any response would be greatful (except the ones that same "I have the
same
problem").
-aayre Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117310
.Net Framework 2.0 SerialPort - How do I get win32 handle?
Hello,
Topic more or less says it all. I'm using the SerialPort class and need to
get the win32 handle of the COM port. Any way of getting it?
Thanks in advance.
Dror. Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117304
what to install
I have been running asp for several years and want to move into dotnet. Do
they coexist? Can I just install something additional and then start with
some dotnet forms, controls, etc. while I learn, while still doing some asp
stuff? Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117290
Threading problem
I'm using System.ComponentModel.BackgroundWorker to do some drawing in my
application.
The thread seems to run fine but it runs twice and I can't see why.
I'm going to show my code with everything that I think is not relevant
removed.
Perhaps the drawBitmap function can be ignored, I just included it because
it is the
actual work the tread is performing. (It's just a test case.)
Can anyone help?
namespace Mandolin
{
public partial class MainForm : Form
{
public MainForm()
{
backgroundWorkerDraw.DoWork += new
DoWorkEventHandler(backgroundWorkerDraw_DoWork);
backgroundWorkerDraw.ProgressChanged += new
ProgressChangedEventHandler(backgroundWorkerDraw_ProgressChanged);
backgroundWorkerDraw.RunWorkerCompleted += new
RunWorkerCompletedEventHandler(backgroundWorkerDraw_RunWorkerCompleted);
}
private void goToolStripMenuItem_Click(object sender, EventArgs e)
{
if (backgroundWorkerDraw.IsBusy == false)
{
backgroundWorkerDraw.RunWorkerAsync();
}
}
private void drawBitmap(BackgroundWorker worker, DoWorkEventArgs e)
{
if (worker.CancellationPending)
e.Cancel = true;
else
{
for (int r = startRow; r < bitmapHeight; r++)
{
if (worker.CancellationPending)
e.Cancel = true;
else
{
for (int c = 0; c < bitmapWidth; c++)
{
mutex.WaitOne();
bitmap.SetPixel(c, r, Color.FromArgb(r * c));
mutex.ReleaseMutex();
if (e.Cancel)
c = bitmapWidth;
}
}
worker.ReportProgress((int)(((double)r /
(double)bitmapHeight) * 100));
if (e.Cancel)
{
mutex.WaitOne();
if (pauseButtonPushed == true)
startRow = r;
if (stopButtonPushed == true)
startRow = 0;
r = bitmapHeight;
mutex.ReleaseMutex();
}
}
}
}
private void backgroundWorkerDraw_DoWork(object sender,
DoWorkEventArgs e)
{
BackgroundWorker worker = sender as BackgroundWorker;
drawBitmap(worker, e);
}
private void backgroundWorkerDraw_ProgressChanged(object sender,
ProgressChangedEventArgs e)
{
statusBar.Text = e.ProgressPercentage.ToString() + " percent
complete.";
Graphics g = CreateGraphics();
mutex.WaitOne();
g.DrawImage(bitmap, rect);
mutex.ReleaseMutex();
}
private void backgroundWorkerDraw_RunWorkerCompleted(object sender,
RunWorkerCompletedEventArgs e)
{
toolStripButtonPlay.Enabled = true;
toolStripButtonPause.Enabled = false;
toolStripButtonStop.Enabled = false;
goToolStripMenuItem.Enabled = true;
pauseToolStripMenuItem.Enabled = false;
stopToolStripMenuItem.Enabled = false;
statusBar.Text = statusBarReady;
}
}
}
Regards
Chris Saunders Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117289
Form resource files
Hi there,
Given an arbitrary ".resx" file (not ."resources"), does anybody know how I
can identify that this file actually contains a Windows form (in code). Once
identified, I then want to collect information about the form and all its
controls. Presumably I would want to read this file into a
"System.Windows.Forms.Form" class so I can obtain the necessary info. How
would I do this. Thanks.in advance. Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117283
NetworkService - Could not establish secure channel for SSL/TLS
hi,
we've got a windows service calling a ssl- and clientcertificate secured
webservice.
running the windows service as administrator works; the webservice-call
succeeds.
switching the logon to the (preferred) 'network service'-user causes a
"Could not establish secure channel for SSL/TLS" error.
---
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest
request)
at
System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest
request)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
---
both users can access the X509Store and load the clientcertificate.
is this a rights-problem? (Win2003SP1, IIS6, .NET 2.0, win/web-service on
same machine)
thanks for your help,
stefan Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117274
Dumb question about application protection/cracking...
Hi,
If this is a stupid question, please accept my apologies!
I want to create 'trial' based software that expires after 30 days unless
the user purchases a licence.
However, it generally doesn't take long before some smartass has cracked the
software and posted in emule/edonkey, etc!
Generally these cracks come in the form of a replacement .dll that has
bypasses the checks made in the original .dll.
Since it is possible to strong name all libraries in your application and
make the application die if the correct strong name is not applied to one of
the libraries, does this make .net applications more/less/as secure than
'traidional' EXEs ?
I guess where I am leading is...
"What is the most effective way of protection applications from cracks?"
I appreciate that absolutely nothing will keep the crackers away if they are
persistent enough but I am looking for something that will make cracking my
app as difficult as possible.
Any ideas?
Best wishes. Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117267
Runtime Security Permissions
Hey All,
I've got a program running on a Network share. It works without any
problems when I add the \\server\* with Full Trust in the .Net
Configuration MMC. I also export this security set as an MSI to be
installed for users who wish to run the program.
The question is, is that sometimes a user will simply go to the share
and try running the program sometimes (start -> run ->
\\server\share\Program.Net.Exe). This will cause the application to
fail, and an unfriendly message to be displayed.
I would like to do a test to make sure the program has the correct
permissions to run, but it doesn't even reach the On_Load event. How
would I go about testing to make sure the program is able to run so if
they don't have the security permissions to run a program from the
share, I'd like to give them a nice friendly "Don't Panic!" message :)
Any examples in VB/C# work for me, thanks in advance!
-Jesse Albert Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117264
2.0 is crapping all over my Event Log!
I keep getting these two error evens in my event log, and I can't find any
information on what the cause is:
.NET Runtime version 2.0.50727.42 - CLR 2.0 does not support profilers
written for CLR 1.x
.NET Runtime version 2.0.50727.42 - Failed to CoCreate profiler.
Fifty million frigging times I get this in the Event Log. I think it has
something to do with writing to the event log. ALSO, how the heck do you get
rid of this nonsense prepended to every EventLog message my windows service
writes:
The description for Event ID ( 0 ) in Source ( MyWickedYetAnnoyingC#Service)
cannot be found. The local computer may not have the necessary registry
information or message DLL files to display messages from a remote computer.
You may be able to use the /AUXSOURCE= flag to retrieve this description; see
Help and Support for details. The following information is part of the event: Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117263
Framework 2.0 problem. Install Framework SDK 2.0 solves it!
Hi there,
I have the following situation.
I have a VB.net 2005 Windows application, which consists out of
1 exe file and al lot of DLL (classes) which reference to each other.
When I compile the lot and start the application form a pc where the
VB2005 is installed, or the 2.0 SDK, the application works fine.
On a pc with only Framework 2.0 installed, it doesn't work.
When I then install SDK 2.0, the application works.
The error is get is when a part of code references to one of the classes.
In this class the following is imported:
Imports System
Imports System.Runtime.Remoting
Imports AL_L_ifCS (Self made class, is available)
Imports System.Runtime.Remoting.Channels.Http
Imports System.Runtime.Remoting.Channels.Tcp
Imports System.Runtime.Remoting.Channels
Imports AL_L_Client.AL_DB_SCHIL (Self made class, is available)
Imports AL_L_GLOBAL_FUNCTIES.AL_L_GLOBAL_FUNCTIES (Self made class, is
available)
Imports System.Xml
Imports System.Windows.Forms
Does anyone have an idea what this could be?
Is it possible that the SDK installs a part which is missing when I only
install the Framework 2.0?
Thnx,
Dikbill Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117259
Displaying an array of custom classes in Propertygrid
Hi,
I have an array of Custom Classes that have three properties which
is displayed in the property grid. I would like to make this a bit
more user friendly. Has anyone any suggestions or articles I could use
to do this.
Thanks
Karen Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117253
Is there a Forms collection?
Is there a Forms collection in the .NET framework that contains the
instances of the currently loaded (in memory, whether hidden or
visible) forms in the current project? I am looking for something
similar to the Forms collection that VB6 had. Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117248
C# code for Outlook Calendar Color
I'm trying to access outlook calender through C#. I'm not able to
change the color of dates for holiday, and also not able to access the
properties 'Show time as' and 'Lable'.
I'm using this code:
Outlook.ApplicationClass oApp;
Outlook.NameSpace oNameSpace;
Outlook.MAPIFolder oMapiFolder;
Outlook.ApplicationClass oApp;
Outlook.NameSpace oNameSpace;
Outlook.MAPIFolder oMapiFolder;
oMapiFolder =
oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar);
Outlook.AppointmentItem appItem
=(Outlook.AppointmentItem)oApp.CreateItem
(Outlook.OlItemType.olAppointmentItem);
appItem does not accesses Label and Showtimeas properties.
Help Plz!!!
thanks in Advance. Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117247
Dynamically load user.config
Hi - is it possible to load a user.config file?
What I would like to do is to be able to load a user.config file and
then set the current properties to the properties within that file.
This would then allow the user to download their own user settings.
I could of course parse the XML and do it that way, but I thought there
may be a better and easier way.
Thanks Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117246
Line graph with crystal reports visual studio 2005 Team edition
Dear All,
I want to achive a simple line graph by the Crystal Report stuff
comming with the Visual Studio. But the documentation (even on Crystal
Reports home pages ) are not quite exhaustively.
1) Can anybody drop some basic lines of code to achive this simple
graph on my web page ?
2) Does anybody know where I can find better documentation ?
Thanks a lot for any hint
R. Kemper Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117244
ngen on win98
When I use ngen on win98 I get the following error.
ngen install app.exe
HRESULT: 0x80070057 (E_INVALIDARG))
The same exactly same command works on winXP and compiles about 70 dll's.
When I try to install dll's on win98 separately with some I succed and
with others I get the same error presented above. Anyone knows what is the
problem?
--
Piotr Perak Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117242
How do you send a windows message?
How do you send a windows message in the .net framework? Creating
messages is easy, so is intercepting messages, but I cannot find a .net
equivalent to the windows api sendmessage() function. Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117238
install .NET framework 2.0
Hi,
Currently I have .NET Framework 1.1 installed in my PC.
To upgrade to .NET Framework 2.0,
- should I uninstall the .NET Framework 1.1 first , then only install 2.0 ?
- After I install 2.0, how can I get it appear in Adminitration Tool ?
- why there is .NET Compact Framework 2.0 ? is this the right one ? I mean "COMPACT" ?
Thanks
Regards. Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117237
A little help with Reflection.Emit and TypeBuilder.GetMethod...
Good morning newsgroup!
Brief description:
I am creating a dynamic assembly. I have a class with has some properties.
These properties have data types of classes which exist in the dynamic assembly.
The class has a dynamic method in which I would like to reference the properties
within the class.
My problem is explained at the very end...
I'll present the code as it looks if typed in the IDE (both VB and IL), and
then below I'll present my dynamic code gen function (in VB):
Excerpt VB Code:
Private oSignalDetections As SignalDetectionCollection = New SignalDetectionCollection
Private oSupportBlock As SupportBlock151 = New SupportBlock151
#Region " Heavy Lifting "
Public Overrides Sub AssignBlocks(ByVal tBlocks As BlockCollection)
SetBlockBasics(tBlocks(0), Me.AdminBlock)
SetBlockBasics(tBlocks(1), Me.SignalDetections)
SetBlockBasics(tBlocks(2), Me.SupportBlock)
End Sub
#End Region
Translated to IL via ILDASM:
.method public strict virtual instance void
AssignBlocks(class RCCAlertParser.BlockCollection tBlocks) cil managed
{
// Code size 111 (0x6f)
.maxstack 3
.locals init ([0] class RCCAlertParser.IBlock _Vb_t_ref_0)
IL_0000: nop
IL_0001: ldarg.0
IL_0002: ldarg.1
IL_0003: ldc.i4.0
IL_0004: callvirt instance class RCCAlertParser.Block RCCAlertParser.BlockCollection::get_Item(int32)
IL_0009: ldarg.0
IL_000a: callvirt instance class RCCAlertParser.AdministrativeBlock
RCCAlertParser.Alert::get_AdminBlock()
IL_000f: stloc.0
IL_0010: ldloca.s _Vb_t_ref_0
IL_0012: callvirt instance void RCCAlertParser.Alert::SetBlockBasics(class
RCCAlertParser.IBlock,
class RCCAlertParser.IBlock&)
IL_0017: nop
IL_0018: ldarg.0
IL_0019: ldloc.0
IL_001a: castclass RCCAlertParser.AdministrativeBlock
IL_001f: callvirt instance void RCCAlertParser.Alert::set_AdminBlock(class
RCCAlertParser.AdministrativeBlock)
IL_0024: nop
IL_0025: ldarg.0
IL_0026: ldarg.1
IL_0027: ldc.i4.1
IL_0028: callvirt instance class RCCAlertParser.Block RCCAlertParser.BlockCollection::get_Item(int32)
IL_002d: ldarg.0
IL_002e: callvirt instance class RCCAlertParser.SignalDetectionCollection
RCCAlertParser.Alert151::get_SignalDetections()
IL_0033: stloc.0
IL_0034: ldloca.s _Vb_t_ref_0
IL_0036: callvirt instance void RCCAlertParser.Alert::SetBlockBasics(class
RCCAlertParser.IBlock,
class RCCAlertParser.IBlock&)
IL_003b: nop
IL_003c: ldarg.0
IL_003d: ldloc.0
IL_003e: castclass RCCAlertParser.SignalDetectionCollection
IL_0043: callvirt instance void RCCAlertParser.Alert151::set_SignalDetections(class
RCCAlertParser.SignalDetectionCollection)
IL_0048: nop
IL_0049: ldarg.0
IL_004a: ldarg.1
IL_004b: ldc.i4.2
IL_004c: callvirt instance class RCCAlertParser.Block RCCAlertParser.BlockCollection::get_Item(int32)
IL_0051: ldarg.0
IL_0052: callvirt instance class RCCAlertParser.SupportBlock151 RCCAlertParser.Alert151::get_SupportBlock()
IL_0057: stloc.0
IL_0058: ldloca.s _Vb_t_ref_0
IL_005a: callvirt instance void RCCAlertParser.Alert::SetBlockBasics(class
RCCAlertParser.IBlock,
class RCCAlertParser.IBlock&)
IL_005f: nop
IL_0060: ldarg.0
IL_0061: ldloc.0
IL_0062: castclass RCCAlertParser.SupportBlock151
IL_0067: callvirt instance void RCCAlertParser.Alert151::set_SupportBlock(class
RCCAlertParser.SupportBlock151)
IL_006c: nop
IL_006d: nop
IL_006e: ret
} // end of method Alert151::AssignBlocks
DYNAMIC CODE GEN:
Private Sub BuildAssignBlocksPart(ByRef tTypeBuilder As TypeBuilder, ByRef
tILGenerator As ILGenerator, ByVal tBlockIndex As Int32, ByVal tPropertyType
As Type, ByVal tPropertyName As String)
Dim tBaseMethod As MethodInfo = Nothing
With tILGenerator
.Emit(OpCodes.Nop)
.Emit(OpCodes.Ldarg_0)
.Emit(OpCodes.Ldarg_1)
.Emit(OpCodes.Ldc_I4, tBlockIndex)
tBaseMethod = GetType(BlockCollection).GetMethod("get_Item")
.Emit(OpCodes.Callvirt, tBaseMethod)
.Emit(OpCodes.Ldarg_0)
tBaseMethod = tTypeBuilder.GetMethod("get_" & tPropertyName)
.Emit(OpCodes.Callvirt, tBaseMethod)
.Emit(OpCodes.Stloc_0)
.Emit(OpCodes.Ldloca_S, 0)
tBaseMethod = tTypeBuilder.GetMethod("SetBlockBasics")
.Emit(OpCodes.Callvirt, tBaseMethod)
.Emit(OpCodes.Nop)
.Emit(OpCodes.Ldarg_0)
.Emit(OpCodes.Ldloc_0)
.Emit(OpCodes.Castclass, tPropertyType)
tBaseMethod = tTypeBuilder.GetMethod("set_" & tPropertyName)
.Emit(OpCodes.Callvirt, tBaseMethod)
End With
End Sub
The code above fails at: tBaseMethod = tTypeBuilder.GetMethod("get_" & tPropertyName)
Note that the type represented by tTypeBuilder is dynamic (it was created
earlier in the assembly building process) and is part of the same assembly
that this code gen is trying to write to.
The exact exception is:
An unhandled exception of type 'System.NotSupportedException' occurred in
mscorlib.dll
Additional information: The invoked member is not supported in a dynamic
module.
So... how would one go about this?
Thanks in advance,
-Dan Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117232
Mutex issue on NT4 with 1.1 Framework
I have recently added a mutex to the startup of an application to stop
users from opening multiple instances. Works great except the
application no longer works on NT4. The error I get is:
The Application has generated an exception that could not be handled.
Process id = 0x12b (299), Thread id = 0x100 (256)
To test my theory, I created a small windows form app and ran it with
no problems. I added the same mutex code to it and received the same
error as noted above.
I double checked in MSDN and it claims the Mutex class is compatible
with NT4, but my experience seems to be telling me otherwise. Here is
the mutex code I'm using:
public class Form1 : System.Windows.Forms.Form
{
//....(designer code and properties here)
public static bool _bFirstInstance;
public static Mutex _mtxSingleInstance;
//....(other functionality)
[STAThread]
static void Main()
{
//This mutex is used to ensure that only one copy of the
application is running at any time.
_mtxSingleInstance = new Mutex(false,
"Local\\MY_MUTEX_SINGLE_INSTANCE", out _bFirstInstance);
if(_bFirstInstance)
{
// If _bFirstInstance is now true, we're the first instance
of the application;
// otherwise another instance is running and this will not
be called and the applicaiton
// will not start.
Application.Run(new Form1());
}
else
{
string strOutput = "There is already an instance of the
application running.\r\n"
+ "Please check the Icon Tray (right hand side of the
toolbar) for the icon.";
MessageBox.Show(strOutput);
///Else we need to bring up the running instance.
///If we cannot, we need to shut it down and start it
again.
}
}
}
Does anybody have any information on this issue? IS the Mutex class
compatible with NT4 (sp6a)? Is there an issue with my code???
Any help would be great.
Cheers!
Russ Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117231
How can I tell if a WindowsForms10.BUTTON.... is a checkbox or radiobutton
I am spying on another process and I can tell that the window I am looking
at is a WindowsForms10.BUTTON.... but I don't see how to tell if this is a
regular button, checkbox or radiobutton. I looked at the window style but
this does not seem to use the styles BS_RADIOBUTTON, BS_CHECKBOX, etc. I
need to similarly differentiate controls that show up as
WindowsForms10.Window... such as picture box, group box
Thanks,
Bill Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117226
Managing scheduled tasks
What is the best way of managing scheduled tasks? My current requirement is
to be able to check on the status of tasks that are supposed to run overnight
- mostly to be able to check that they have all completed successfully. I've
seen talk about wrappers being available but haven't managed to track one
down.
(I realise that I could just grab the log file and parse that down to get at
basic information, but that seems a bit of a kludge.)
Thanks for any ideas. Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117223
Cannot create new web project on localhost after framework 2.0 install
Development box has Windows 2000 Server, IIS 5, framework 1.1, vs 2003,
sql server 2000
Everything works great until framework 2.0 installed - all I wanted to
do was read up on sql server 2005 and BOL requires framework 2.0.
After installing framework 2.0, vs 2003 window forms programs still
work fine, but I can no longer connect to existing asp.net projects on
localhost nor can I create new projects.
Error I get is: The web server reported the following error when
attempting to create or open the web project located at the following
URL: http://localhost/WebApplication1 HTTP/1.1 500 Internal Server
Error.
I've done the aspnet_regiis thing; I've gone over all the ACLs to be
sure asp.net account has needed permissions; I've checked the websites
to be sure they are all using asp.net 1.1 and not 2.
Additionally, I cannot start the asp.net state service.
If I uninstall framework 2.0, everything works great again. I've spent
a week trying to research this in google groups, msdn, and ms
knowledgebase and can find no one else with similar problems.
Any suggestions?? I would eventually like to start testing the vs 2005
waters but I have to keep maintaining my asp.net 1.1 apps at the same
time. Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117221
Problematic CodeBase key used
I'm having a problem with DLL that I'm using through COM interop from VB6.
The DLL has some custom structs that are defined as follows.
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Public Structure ToolEventStruct
Public ToolEvent_ID As Integer
<MarshalAs(UnmanagedType.BStr)> _
Public EventName As String
Public EventCode As Integer
<MarshalAs(UnmanagedType.BStr)> _
Public EventDescription As String
Public EventType_ID As Integer
Public CreateDate As Date
End Structure
When I create a msi file to install this DLL the following entry is put in
the msi registry table which then gets installed on the target computer. The
problem is that this codeBase value is hard coded to the path of my dev
computer instead of using the install directoy entered by the user when the
msi is run. The COM registry entries (inprocServer,...) for this DLL are
getting the correct codeBase value. Why is this "record" registry keys being
generated and why is the codeBase hosed. This causes my DLL to throw an
expection when the CLR cannot find the DLL and the dev location.
[HKEY_CLASSES_ROOT\Record\{0F94C157-4F0C-3A32-A1F5-1ACC74171A27}\1.0.0.1]
"CodeBase"="file:///C:/Documents and Settings/Gil/My
Documents/LEI/2XX-SparTool/Visual Studio
Projects/290b-LaSHDataAccess-Jerry/112305/LaSHDataAccess/obj/Release/LaSHDataAccess.DLL"
"Class"="LaSHDataAccess.DataAccess+ToolEventStruct"
"Assembly"="LaSHDataAccess, Version=1.0.0.1, Culture=neutral,
PublicKeyToken=475da81253b912e1"
--
Gil Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117219
Rich UI to work with?
Hello All,
I am starting to design a new UI for an application and would like it
to behave like windows Vista or Office 2007 with the general look and
feel, tabs and buttons..
any suggestions Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117217
type define _GUID,_IMAGE_DOS_HEADER,HINSTANCE__ show in object bro
Hi all,
I create a mix mode .NET library in VC .NET 2003 as a wrapper of my legacy
library. I include windows.h for loading my legacy library. When I browse
my library from the client application I see the following type define in the
library
_GUID
_IMAGE_DOS_HEADER
HINSTANCE__
I really do not know why it appears in my library.
Anyone knows how to get rid of it.
Thanks for all comments Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117215
Call a MainForm from Another Form???
I have the main form open another form, and I want the second form to
execute memeber functions on the main form? How do you do this? I
thought I could have a pointer (^) to the main form as a member variable
of the second form, and set it to the 'this' pointer just before showing
the form. But, I cannot get that to compile. The compiler does not
recognize the declaration statement (even though both forms are in the
same namespace), and if I add an include on the mainform header, it
screws up the include sequence and the main form doesn't compile
correctly (I end up with each form including the other). This is
essentially what I tried:
<inside second form declaration'
MainProj::MainForm1^ mainFormPtr; // Doesn't compile - says MainForm1
not a member of MainProj. MainForm1 and 2nd form are in same namespace
and intellisense can figure it out...
MainForm1 includes 2ndForm.h and can create it. I'm sure I'm doing
something simple quite wrong..... Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117210
QUERY: VS2003 + .NET 2.0
Am wondering if it's possible to make VS2003.NET work with .NET2.0 SDK? Just
as we were able to use VS7.1 compiler kit in VS6.0. My company bought lots
of VS2003.NET but now we want to use .NET 2.0 but without using VS2005
Express, etc. Possible? Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117209
ListView, selecting items during form load does not work
During the Load event of my form it is refusing to select any items in
my ListView.
After the ListView has been populated with five items the following VB
code always shows a message box with the value 0.
ListView1.Items(1).Selected = True
MessageBox.Show(ListView1.SelectedItems.Count)
If I move the same code to a button click event it works and the
message box displays the value 1.
Is this something that can be fixed?
Thanks,
Matt Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117208
About load app in my app
How can I load MS Word in my C# app Form Container? Or load the MS Word as a
child form? Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117206
Getting outlook contact
Hi,
Can any body help me in exporting the contact of the outlook using VSTO. Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117203
Windows Service
I'm writing a windows service that depends on sql server running. I
could add dependency on sql server in service setup, but it can be
running on different machine. Can I block in OnStart till sql server is
operational?
--
Semper Fidelis
Adam Klobukowski
atari@gabo.pl Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117201
Reflection on XML documentation
Hi,
how can I read the
/// <param name="p">My parameter p.</param>
string? I don't see any corresponding method on ParameterInfo....
If it cannot be done using reflection, then how? How does the VisualStudio
do that?
Thanks,
Jan Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117200
Web Deployment ASP.Net 2.0
I am working with VS 2005 and web projects. We were set up to use
files on a UNC share that mapped to a web root for the IIS instance.
Microsoft told us that is a "no no" due to bios limitations so we
installed FPSE and are using web folders for each project.
Now that web folders are used, when we deploy / build using the Web
Deployment we get some strange results.
1. Directories named _test or anything that starts with _ does not get
copied over.
2. Updated images or files for that matter does not get deployed.
What gives? It seems the root of the issue is these web folders? Are
there better ways to do this? We have a team of 5 developers and we
have a projects drive with all projects on it that map back to
instances of IIS.
How do you do it? Any help would be great. Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117199
Inheriting and Extending internal class
This is a multi-part message in MIME format.
------=_NextPart_000_0006_01C68561.DCD18B80
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
This is the situation I have a base class _Job that has an internal =
class PropertyNames (see code )
public abstract class _JobBase
{
private int _JobId;
private int _JobName;
public virtual int JobId
{
get{return this._JobId;}
set{this._JobId =3D value;}
}
public virtual string JobName
{
get{return this._JobName;}
set{this._JobName =3D value;}
}
public class PropertyNames{
public const string JobId =3D "JobId";
public const string JobName=3D "JobName";
}
}
When inheriting from _Job if I want to extend the PropertyNames inner =
class I am doing the following
public class Job:_JobBase
{
public string JobNameExtended
{
get{return this.JobId.ToString() & " - " & this.JobName;}
}
public new class PropertyNames:_JobBase.PropertyNames
{
public const string JobNameExtended =3D "JobNameExtended";
}
}
What I want to know is if this is the correct way of extending an inner =
class as this works, or if there is a better way.
Paul
------=_NextPart_000_0006_01C68561.DCD18B80
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2873" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><STRONG>This is the situation I have a =
base class=20
_Job that has an internal class PropertyNames (see code=20
)</STRONG><BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>public abstract class =
_JobBase</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> private int =
_JobId;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> private int=20
_JobName;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> public virtual int=20
JobId</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> {</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
get{return=20
this._JobId;}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
set{this._JobId =3D value;}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>
<DIV><FONT face=3DArial size=3D2> public virtual =
string=20
JobName</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> {</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
get{return=20
this._JobName;}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
set{this._JobName =3D value;}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> }</FONT></DIV></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> public class=20
PropertyNames{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
public const=20
string JobId =3D "JobId";</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
public const=20
string JobName=3D "JobName";</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>When inheriting from _Job if I =
want=20
to extend the PropertyNames inner class I am doing the=20
following</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>public class Job:_JobBase</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> public string=20
JobNameExtended</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> {</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
get{return=20
this.JobId.ToString() & " - " & this.JobName;}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> <STRONG>public new =
class=20
PropertyNames:_JobBase.PropertyNames</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> {</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
public const=20
string JobNameExtended =3D "JobNameExtended";</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>What I want to know is if this =
is the=20
correct way of extending an inner class as this works, or if there is a =
better=20
way.</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><STRONG></STRONG></FONT> </DIV>
<DIV><FONT face=3DArial =
size=3D2><STRONG>Paul</STRONG></DIV></FONT></BODY></HTML>
------=_NextPart_000_0006_01C68561.DCD18B80-- Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117195
.Net Remoting Exception
I am getting an exception in the following situation:
Start .Net Remoting Server
Start .Net Remoting Client
Client Request - Works
Client Request - Works
Client Request - Works
...
Close .Net Remoting Client
Start .Net Remoting Client
Client Request - *Exception*
Client Request - Works
Client Request - Works
...
Close .Net Remoting Client
Start .Net Remoting Client
Client Request - *Exception*
Client Request - Works
...
Hopefully you get the idea. The first request after closing the
application fails.
The exception is: System.Net.Sockets.SocketException: A non-blocking
socket operation could not be completed immediately.
Here is the basic code from the Remoting Client:
{{{
TcpClientChannel channel = null;
try
{
channel = new TcpClientChannel();
ChannelServices.RegisterChannel(channel, false);
IMyService svc =
(IMyService)Activator.GetObject(typeof(IMyService),
"tcp://172.1.1.1:9988/MyService");
MyObject o = svc.GetObject();
System.Windows.Forms.MessageBox.Show("o.Property: " +
o.Property);
}
catch (Exception ex)
{
log.Error("Exception:", ex);
System.Windows.Forms.MessageBox.Show("Exception: " +
ex.Message);
}
finally
{
ChannelServices.UnregisterChannel(channel);
}
}}} Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117188
locking across multiple computers
I have several computers that I want to synchronize access to a shared
resource. Can a semephore do this? If not, what can I use to synch access
to a shared resource...across computers?
Thanks.
Amil Tag: Hi! http://www.ringtones-dir.com/get/ ringtones site Tag: 117187
Hi! http://www.ringtones-dir.com/get/ ringtones site free. ringtones site free, ringtones site, Free nokia ringtones here. From website .