|
The code that NGen generates is VERY processor specific, right down to support for Intel's little math bug a few years ago. The code that's generated will work on the processor that NGen was run on, but not others. Try running the code generated for a hyper-threaded P4 on an older AMD...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If you really want to, you can add code in an Installer class to compile the application using ngen on each target machine during installation.
You may not see that much improvement though. If your application is the first (or only) active application that requires the CLR, a lengthy startup delay will come from loading the CLR itself.
|
|
|
|
|
Hi,
I am facing one problem while connecting my project to connecting with visual source safe(VSS).
I am working with Visual studio 2005 beta 2 and my project database is on some another pc which is in LAN.Till date it's working fine without any problem but from yesterday i am getting problem i don't reason.
Problem is that when i am tring to connect from my project to visual source safe database which is in another pc(in LAN),it directly ask me for visual source safe Internet database and asking for DNS and folder name in internet,which is not true becoz my actual vss database is in LAN.
I had reinstall vs 2005 beta 2 again but it is not solved.I am thinking that there must be some setting in vss administration to resolve this problem.
so any body is knowing solution about this type of problem?
if yes then pls. help me out.
thanks.
regards,
Montu3377
|
|
|
|
|
Hi,
I want to Download a list of files from an FTP site. I'm planning to do it using C#. How can I get the list of file names from the remote server.
ThankYou.
|
|
|
|
|
Google is your friend - a quick search found this[^]
Cheers,
Drew.
|
|
|
|
|
Hi Friends,
I m creating one windows service Utility (exe) where in it sends a mail
to a particular given address, but what happens is it sends more then one
mails (some it sends 3/4/5/7 mails).
For sending mail i m using ASPMAILLIB components
Thanks
Vipul
Regards,
Vipul Mehta
Software Engineer
Chenoa Information & Software Services Pvt Ltd
|
|
|
|
|
Plainly you've made a mistake in your code. You would need to post it to get more info.
Vipul Mehta wrote: ASPMAILLIB
What, in the .NET framework ? What's wrong with the mail stuff that's built in ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello.
I'm trying to make a tread-safe class, by protecting read/write over its internal properties with locks, like this:
public void Set(string lats)
{
lock(this.LatS)
{
this.LatSex = lats;
}
}
public string Get()
{
string _aux;
lock(this.LatSex)
{
_aux = this.LatSex;
}
return _aux;
}
It does compile with strings, but not with decimal type... I cant figure why.
Does decimal time really need lock protection for thread-safe?
And what about strings and enumerations?
Thank you very much!!
|
|
|
|
|
If you read the help on lock, it will say "expression must be a reference type". decimal is a value type. You don't need to lock value types, as nobody can modify them. Only reference types, something that may be referenced in many places, can be locked. Enumerations? Why would you lock on an enumeration? It's a constant.
Marc
VS2005 Tips & Tricks -- contributions welcome!
|
|
|
|
|
Thanks for your response!
So... accesing (read/write) primitive types of .NET is an "atomic" operation. Is that so?
|
|
|
|
|
Only if the size of the aligned type is less than or equal to the size of a native integer.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
No, lock operates only on reference types. If lock did accept a value type, it will get boxed. Now everytime a value type gets boxed, a new instance is created. Which means locking on it is useless, because every lock statement will lock on a new instance.
Reading and writing of value types is atomic only if the size of the aligned type is less than or equal to the size of a native integer.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Interesting... So, in order to protect a class' properties like doubles or decimals, do I need to use Mutex?
Thanks for your useful info!
|
|
|
|
|
Is it possible to create a ISAPI filter in .NET. I had gone through a couple of articles that did not seem to help me.
My purpose for this filter is, I want to block access to a site if the Request comes from certain set of IP addresses.
Is it possible using C#??
How do I go about creating one. Can some one please help me with it.
Leejo
-- modified at 3:57 Tuesday 15th November, 2005
|
|
|
|
|
Hi Folks,
I've got a bit of an irritating problem. I have a class which is a sublcass of an ArrayList. That class has an public propetry ID, which is a string. When I serialize the class the property does not get serialized. For instance I get something like this
<ArrayListSubclass>
<Item />
<Item />
</ArrayListSubclass>
But what I want is
<ArrayListSubclass ID="foo">
<Item />
<Item />
</ArrayListSubclass>
For some reason the attribute is left out, even though I mark it as an [XmlAttribute].
Any ideas why? Is there a declaration or directive I'm missing?
-- modified at 9:11 Sunday 13th November, 2005
|
|
|
|
|
How do I programmatically switch the phones profile (e.g. to silent), searched all over the web and cant find any good answers.. I’m assuming this cant be don’t via C# and has to be done via C++ unmanaged code ?
Any help would be useful, code samples would be amazing
Cant believe its so hard todo such a simple task..
Nb. Using VS2005 & Windows Mobile 5 SmartPhone SDK..
|
|
|
|
|
I'm writing an application in C# that needs to sniff
all IP packets coming into a certain server. I've
tried to create a socket, bind, listening for
connections, but I'm getting an exception when i try
to listen on the created socket. It says "the operation
is not supported on the type of object".
I tried changing how I defined the IPEndPoint, and the
SocketType and ProtocolType enumerations when creating
the socket.
Does anybody know the correct setup of the socket in
order to inspect IP packets? Not at the TCP layer, but
lower in OSI model.
Is
Here's the code.
Thx,
Tom
try
{
// Build local end point
IPAddress localAddr = IPAddress.Parse(Constants.LOCALHOST);
IPEndPoint endpoint = new IPEndPoint(localAddr, Constants.PORT);
// create new IP socket.
server = new Socket(AddressFamily.InterNetwork,SocketType.Raw,ProtocolType.IP);
// SetupSocket(server);
// Bind the socket to the local IP addr and port
server.Bind(endpoint);
// Start listening for connections, allowing for max # to be queued.
server.Listen(Constants.MAX_CONNECTION_QUEUE);
// loop until the service is stopped.
while (ServiceStarted)
{
// Wait asynchronously for connections to be accepted.
server.BeginAccept(new AsyncCallback(this.AcceptCallback), server);
// yield
if (ServiceStarted)
{
Thread.Sleep(new TimeSpan(0, 0, 5));
}
.
.
.
}
}
catch(SocketException e)
{
throw e;
}
|
|
|
|
|
AFAIK, what you are attempting to do can't be done using the .NET API as it provides only application level operations.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hello!!
Whats the real difference between these two timers? I read the MSDN but didnt understand very well.
Which one is better for main UI updating (labels... etc)?
Many THANKS!!!!!
PD: all of these is refered to Compact Framework 1.1
|
|
|
|
|
The Forms timer fires on the UI thread, which means you don't have to do Invoke/BeginInvoke when updating UI controls. But because it fires on the UI, it is not very accurate and is dependent on your application not holding up the message pump.
The Thread timer runs on a threadpool thread and will therefore fire more accurately. However, you'll need to do Invoke/BeginInvoke if you're updating UI elements.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks for your invaluable info! 
|
|
|
|
|
I am writing a managed C++ app that must retrieve all shared public contacts from outlook. I have a list of 484 contacts - but my code retrieves always exactly 250 of them and then exceptions start occurring when converting the enumerated MAPIFolder items into ContactClass's in order to print out the details of the contacts.
Here is some of my code :
<code>
//----------------------------------
// Get Contacts
Outlook::NameSpaceClass* outlookNS = dynamic_cast<Outlook::NameSpaceClass*>(outLookApp->GetNamespace("MAPI"));
Outlook::MAPIFolder* publicFolder = outlookNS->GetDefaultFolder(Outlook::OlDefaultFolders::olPublicFoldersAllPublicFolders);
//Print out some basic info.
String* s = String::Format("You have access to {0} public Outlook folders.", __box(publicFolder->Folders->Count));
Log(s);
IEnumerator* en = publicFolder->Folders->GetEnumerator();
while(en->MoveNext())
{
Outlook::MAPIFolder* item = dynamic_cast<Outlook::MAPIFolder*>(en->Current);
if (item)
{
String* st = String::Format("-> Public Folder: {0}", item->Name);
Log(st);
if (item->Name->Equals("My Shared Contacts"))
{
//Print out contact info.
String* s = String::Format("You have access to {0} public contacts.", __box(item->Items->Count));
Log(s);
IEnumerator* i = item->Items->GetEnumerator();
int count = 0;
while (i->MoveNext())
{
if (i->Current)
{
try
{
if (count == 248)
{
Log("BANG! - from now on exceptions occur when performing conversion below");
}
Outlook::ContactItemClass* contact = dynamic_cast<Outlook::ContactItemClass*>(i->Current);
if (contact)
{
Log(String::Format("Item {0}",__box(count)));
Log(contact->ToString());
Log(contact->FileAs);
//Log(contact->LastName);
//Log(contact->Email1Address);
Log("--------------------------------");
}
}
catch(InvalidCastException* e)
{
//I end up here from item 250 onwards. why does this happen?
Log(e->Message);
}
}
count++;
}
break;
}
}
}
</code>
|
|
|
|
|
Hi,
I am working on Microsoft Visual Studio .NET 2003 VC++. I have created a solution & i am trying too build it & i am facing the following error:
LINK : warning LNK4001: no object files specified; libraries used
libcmtd.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
Debug/MP1G.exe : fatal error LNK1120: 1 unresolved externals
When this error came i went to the properties in linker\system i changed the subsytem from Console (/SUBSYSTEM:CONSOLE) to Windows (/SUBSYSTEM:WINDOWS)
& in the advanced tab changed the entry point from mainCRTStartup to wWinMainCRTStartup.
But then the following error is coming:
LINK : warning LNK4001: no object files specified; libraries used
ibcmtd.lib(wwincrt0.obj) : error LNK2019: unresolved external symbol _wWinMain@16 referenced in function _wWinMainCRTStartup
Debug/MP1G.exe : fatal error LNK1120: 1 unresolved externals
How to solve this problem as fast as possible.
Thanks in advance
|
|
|
|
|
Is your application a console app or a GUI app? In case it's a console app, you need to define a main function which acts as the entry point for the program. For GUI apps, it depends on whether you're using MFC or not.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I just made a BIG, STUPID mistake. I deleted all the .resx and .aspx.vb files on my machine through Dreamwaver Test Server view! It will kill me to re-write all the code .
I have recently re-built the project into .DLL file before deleting those files. Is there anybody know how to decompile .DLL file to get source code back????
I also find there is a tempporary folder "_vti_cnf" under my wwwroot/project folder. In this folder, there are .aspx.vb and .RESX files. However, .aspx.vb file only contains the information like :
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR| 17 Oct 2005 16:58:30 -0000
vti_extenderversion:SR| 4.0.2.8912
Could anybody help me out???
Thank you in advance!!!!!

|
|
|
|