|
Thanks for reponse.
From that i will get the current CPU bits, but what i want to find is that,
I will get a dll as input and from that i need to find on which platform it has been
builted. Does it support x86 or x64 or both.
Thanks
|
|
|
|
|
Well, if built with X64 it won't run on 32 bit Windows, not sure about the other way round though.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I wouldn't like to say for sure that you can't but I'd expect not. Assemblies are after all a load of metadata tables and MSIL instructions. The very essence of it all is that MSIL isn't linked to one particular processor - the JIT compiler does that at runtime.
Why do you need to know this?
Regards,
Rob Philpott.
|
|
|
|
|
Do you mean you want to find out whether it has been build for "x86" or "x64" or "I64" or "Any CPU"?
If you just need to distinguish between 64/32bit at runtime you can look at the size of IntPtr.
|
|
|
|
|
If it's built for x64, the .exe/.dll file will use PE32+.
For x86 or AnyCPU assemblies, it'll use PE32.
If you need to find the difference between AnyCPU and x86-only assemblies, you'll need to look at the 32-bit flag in the CLR Runtime Header.
You can find the documentation of the .dll/.exe file format on http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx[^].
|
|
|
|
|
Is there any built in method that create a boolean array from a byte or int - basically a bit array indicating whether each element (bit) is set or not?
I've easily created my own function to do this but wondered if there was already an in built method?
[Edit] Jst found the BitArray class that will take a byte[] parameter and set the bits accordingly [/Edit]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I dont think there is the way you describe. But depending on your needs for it you could use an enum with the 'Flags' attribute. This can be set as a whole be passing it a byte or int...
[Flags]
public enum MyFlags{
Flag1,
Flag2,
Flag3,
Flag4
}
public MyFlags myFlags = 4;//set with int or byte value
this will result in Flag3 being set and the others not set... likewise, assigning a value of '6' would set both Flag2 and Flag3.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
The BitArray class did it. It's actually a UInt16 (from an interop function) that I needed to convert.
_ChannelMask is the UInt16 and _ChannelAvailability is the Boolean[]
new BitArray(new byte[] { (byte)_ChannelMask, (byte)(_ChannelMask >> 8) })
.CopyTo(_ChannelAvailability, 0); Thanks for the suggestion
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
hi
had a look in the BitArray class in the System.Collections namespace.
maybe this will help you.
regards
|
|
|
|
|
Thanks - I actually discovered that class just after posting! Serves me right for not googling for BitArray!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
the following code plays video files by storing it in a playlist.But it stops when the last file is played. I want the files to play in repeat mode...how can i enable repeat mode, in my code
plz help-----
thanks !!!!
**************************************************************************
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
System.IO.FileInfo[] files = null;
int index = 0;
string plist;
private void Form1_Load(object sender, EventArgs e)
{
System.IO.DirectoryInfo df = new DirectoryInfo("C://Images");
files = df.GetFiles("*.wma");
WMPLib.IWMPPlaylist pl;
pl = axWindowsMediaPlayer1.mediaCollection.getByName(plist);
WMPLib.IWMPMedia m;
if (files != null)
{
if (files.Length <= index)
{ index = 0; }
else
{
m = axWindowsMediaPlayer1.newMedia(files[index++].FullName);
pl.appendItem(m);
}
}
axWindowsMediaPlayer1.currentPlaylist = pl;
}
}
}
**************************************************************************
----mist-----
|
|
|
|
|
create a bool field
bool keepPlaying = true; then<br />
<pre><br />
while (keepPlaying)<br />
{<br />
pl.Clear()
if (files != null)<br />
{<br />
if (files.Length <= index)<br />
{<br />
index = 0;<br />
}<br />
else<br />
{<br />
m = axWindowsMediaPlayer1.newMedia(files[index++].FullName);<br />
pl.appendItem(m);<br />
}<br />
<br />
}<br />
<br />
axWindowsMediaPlayer1.currentPlaylist = pl;<br />
}<br />
<br />
</pre><br />
<br />
then you can have a cancel button and in the <code>onclick handler have keepPlaying = false; . Of course that will only stop when it reaches the end of the playlist, unless you also stop the player when setting the flag to false.
You are having a lot of problems getting this application working, mostly with concepts that are elementary. I would seriously suggest that you get a C# getting started book and work through it, before continuing.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi guys,
Hope you are doing well.
I have a Onix complaint XML document that I want to validate it with some Onix complaint DTD. I did coding for same in C#
XmlReaderSettings settings = null;
try
{
string xmlPath = Server.MapPath("XML/nielsen_onix.XML");
//Load XML into XmlTextReader
// reader = new XmlTextReader(xmlPath);
//Load XmlTextReader into XmlValidatingReader
settings = new XmlReaderSettings();
//Set the validation type
settings.ValidationType = ValidationType.DTD;
settings.ProhibitDtd = false;
settings.CheckCharacters = false;
//Hook up the XmlValidatingReader’s
//ValidationEventHandler to a call
//back method named ValidationCallBack
settings.ValidationEventHandler += new ValidationEventHandler(
this.ValidationCallBack);
XmlReader reader = XmlReader.Create(xmlPath, settings);
//Read through the XML document by calling
//the Read() method
while (reader.Read()) { }
//Check boolean field named valid (located at top of code)
if (valid)
Response.Write("Validation is Successful!");
reader.Close();
}
catch(Exception ex) {
Response.Write(ex.Message);
}
This code runs good and show the xml file invaid while my xml file is valid when I validated it on
http://www.w3schools.com/XML/xml_validator.asp[^]
Could you please check what's wrong going with me?
Any help would be highly appreciable.
Thanks
Rohit
|
|
|
|
|
I am a new c# programmer and i need to create a c# program which can connect to a network printer and swap the ports i.e if printer 1's port is 192.11.36.1 and printer 2's port is 192.11.36.3 i need to be able to swap these over by the click of a button then switch them back again. Please Help
|
|
|
|
|
I am using System.Data.DataRelation object to get the child rows using DataRow.GetChildRows method. GetChildRows method works for 100000 records but when there are 100001 records it do not return any child rows. Is there any limitation for this?
Thanks
|
|
|
|
|
Hi, my project is in ms studio 2005. when i use comm component(axWinSock)
in my project and again installed it to the client pc.
the program is not running.
"it gives an error project.exe encountered an error needs to close"
however
i installed .Net Freamwork 2.0 on that machine but problem is same..
i copied the mscomm.ocx file in the system32 folder but i could not solve this..
the mswsock.dll is also available on client side...
* What is the funda behind the comm component.. ?
* is there any program that I have to run on client machine..
|
|
|
|
|
Use Dependancy Walker [^] to see if any dependancies are missing.
|
|
|
|
|
What's a "funda"?
|
|
|
|
|
Hi,
What I would like to do is to monitor the whole registry in win xp. The best would be to receive an event when a registry key has changed/created/received but in a way that I could figure out which key was it.
So far I subscribed for quite a few RegistryTreeChangeEvent to see the tree changes in every hive. But the problem with this is that in RegistryTreeChangeEvent I couldn't figure out which key changed just the hive and the rootpath. I tried to find the change in the registry but it's very time and resource consuming.
My next idea would be to register for RegistryKeyChangeEvent and RegistryValueChangeEvent for every registry key but I'm guessing it would have a huge overhead.
So if anybody knows any way to receive events when something changes in the registry or how to monitor the whole registry at all then please tell me!
And I have read some articles here which were useful in general but it didn't solve my problem:
http://www.codeproject.com/KB/system/WMI_RegistryMonitor.aspx
http://www.codeproject.com/KB/system/registrymonitor.aspx
Thanks in advance,
Geri
|
|
|
|
|
Hi Geri,
I think you may find something using "Windows Hooks" , you need to search for it , i am assuming that if registry value is changed a message or notification should be sent to the system , we can use "Windows Hooks" to get this message form the system's message queue (i am not not sure about the method , just try to mention a possible solution) , the above two methods u mentioned do pooling on to registry , which not good always
-Regards
Bharat Jain
bharat.jain.nagpur@gmail.com
|
|
|
|
|
Hi,
First of all thanks for your reply! I looked for some reading on the windows hooks you mentioned, but unfortunately I haven't had much luck. The thing is that I couldn't find any hooks which would give information about the registry. Actually I found these hook types:
* WH_CALLWNDPROC and WH_CALLWNDPROCRET Hooks
* WH_CBT Hook
* WH_DEBUG Hook
* WH_FOREGROUNDIDLE Hook
* WH_GETMESSAGE Hook
* WH_JOURNALPLAYBACK Hook
* WH_JOURNALRECORD Hook
* WH_KEYBOARD_LL Hook
* WH_KEYBOARD Hook
* WH_MOUSE_LL Hook
* WH_MOUSE Hook
* WH_MSGFILTER and WH_SYSMSGFILTER Hooks
* WH_SHELL Hook
http://msdn.microsoft.com/en-us/library/ms644959(VS.85).aspx
but none of them looks useful for me. If you have any other ideas or links where I could read more then it would be very much appreciated.
cheers
Geri
|
|
|
|
|
hi,
I m devloping a windows application in which i want to give the facility to add water mark over existing video,i am using an Directshownet library for that.Any one help me for the same?
|
|
|
|
|
hi,
What is the major differnce between private readonly fields and non private readonly fields... waiting for reply...
Regards,
Prajilal
|
|
|
|
|
Exactly what it says. Private are private, public are public. Its a basic programming concept.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
DJ245 wrote: What is the major differnce between private readonly fields and non private readonly fields... waiting for reply...
'non'?
A readonly field cannot, by definition, be written. A private readonly field cannot be read too (only an instance of the class defining such field can) while (for instance) a public readonly field can be (publically!) read.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|