|
Under Win32 and COM development<< Windows Driver Kit, you will get all this information.
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
How Cud I get a popup in Window Application in asp.net?
|
|
|
|
|
You want ASP.NET in your C# application or launch a C# application from an ASP.NET site in the user's browser?
|
|
|
|
|
Hello,
VS 2008
I have the following code in my timer control
<br />
private void tmrVibrate_Tick(object sender, EventArgs e)<br />
{<br />
vibrateAlert = new Led();<br />
vibrateAlert.SetLedStatus(1, Led.LedState.On);<br />
Debug.WriteLine("Vibrating");<br />
Thread.Sleep(1000);<br />
vibrateAlert.SetLedStatus(1, Led.LedState.Off);<br />
}<br />
I have 2 buttons start and stop. Start will enable the timer and stop will disable the timer.
The problem was that the PDA would continuely vibrate. So I put it in the timer event and set the interval for 2 seconds. Then in the timer event I sleep for 1 second. This will vibrate it for 1 second then switch it off and do this every 2 seconds.
The problem now is, that the UI will freeze during the pause of 1 second.
Is there a better way to do this?
Many thanks for any advice,
|
|
|
|
|
You will need to do it in a background thread.
|
|
|
|
|
Hello,
I solved the problem using the code below and setting the boolean flag in the timer tick event. However, as the timer is enabled in a thread that is not the UI thread, when I set the timer to enabled to true, the timer doesn't start. I was thinking of invoking the timer. However, the timer doesn't have that property.
private int OnIncomingCall(int _callID, string _caller)<br />
{<br />
callID = _callID;<br />
caller = _caller; <br />
<br />
if (this.btnAnswer.InvokeRequired)<br />
{<br />
this.btnAnswer.Invoke(new EventHandler(UpdateAnswerButton));<br />
}<br />
<br />
if (this.lblCallStatus.InvokeRequired)<br />
{<br />
this.lblCallStatus.Invoke(new EventHandler(DisplayCaller));<br />
}<br />
this.tmrVibrate.Enabled = true;
<br />
drvAnswerCall(_callID, 180);
<br />
return 1;<br />
}
static Boolean ledStatus = true;
private void tmrVibrate_Tick(object sender, EventArgs e)<br />
{<br />
if (ledStatus == true)<br />
{<br />
vibrateAlert.SetLedStatus(1, Led.LedState.On);<br />
ledStatus = false;<br />
}<br />
else<br />
{<br />
vibrateAlert.SetLedStatus(1, Led.LedState.Off);<br />
ledStatus = true;<br />
}<br />
}
Many thanks for any more suggestions,
|
|
|
|
|
I can go from an IP to a byte array like this...
byte[] IPBytes = IP.GetAddressBytes();
How do I go back without this horrific mess?
byte[] ip = {127, 0, 0, 1};
IPaddress addr;
string str_ip = ip[0].ToString() + "." + ip[1].ToString() + "." + ip[2].ToString()
+ "." + ip[3].ToString();
addr = IPAddress.Parse(str_ip);
|
|
|
|
|
Just call a constructor of IPAddress class which accepts byte array.
Simple, isn't is? The only thing you need to do is read documentation
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
There I go trying to over complicate things. I did look through the documentation but I was to busy looking for a way to convert to look at the IPAddress Constructor.
|
|
|
|
|
Create a new instance of System.Net.IPAddress class with System.Net.IPAddress.IPAddress(byte[]) constructor.
|
|
|
|
|
hy everyone!
I do have a problem:
I insert a picture in an application and try to fetch it again with my tool. the strange thing is although i insert 300x300 dpi pics when fetching they are 299x299 dpi.
after fetching they should be converted to a pdf, but it doesn't accept the 299x299 dpi, but it works fine with 300x300 dpi. (it throws an error it can't handle the format because it is unknown)
is there a chance to check this and to correct it to 300 dpi?
to change it to 300 dpi hardcoded isn't a good idea because there could be 600x600 dpi pics as well etc.
but i wonder, where this 1 dpi was lost and why!
anyone of you a clue?
thanks!
stephan.
|
|
|
|
|
You can check/set the DPI within a Graphics object, but I am not sure how you process the image.
|
|
|
|
|
How should I abort a running procedure if it takes longer than 10 seconds?
|
|
|
|
|
By setting a 10 second timer and then changing a flag or something. What are you aborting ? I assume a thread.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
semiramisContraA wrote: How should I abort a running procedure if it takes longer than 10 seconds?
Since this is in the C# forum I'm guessing you actually mean method rather than procedure. If you do mean procedure (as in a stored procedure) then you should proceed to the SQL Server forum and ask there.
You can run the method in another thread and WaitFor it to return. When you WaitFor it you can set a time out.
|
|
|
|
|
I am trying to call a method of a web service & I want the request to be aborted if the web service takes longer than 10 seconds to answer!
|
|
|
|
|
If you are using a SoapHttpClientProtocol - derived class to invoke the web service you can set the Timeout property of it to 10 seconds.
|
|
|
|
|
I'm using MSXML2.XMLHttpClass. & it doesn't have a timeout attribute
|
|
|
|
|
Friends I want to do the following things in a function.
Forms.frmFIR fr = new uHTMCM.Forms.frmFIR();
fr.show();
where frmFIR is the form name and uHTMCM is the namespace of the project.
what I want is to send the form name and namespace name in that function(suppose the function name is frmshow(takes two parameter)) and do the above two lines in that function. Can any1 help???
|
|
|
|
|
Saiyed Alam,
You dont need to pass anything to the constructor, just add the below lines in the frmFIR, they will give you the details you want.
Class name: System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name;
Namespace name: System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Namespace;
MSDN[^]
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
a) if the form is in the same assembly of your method
Assembly asm = Assembly.GetExecutingAssembly();
Form frmTemp = asm.CreateInstance(Your_Namespace + "." + Your_Form_Name);
frmTemp.Show();
b) if the form to be called in from some other assembly
Assembly asm = Assembly.LoadFrom(AssemblyPath);
Form frmTemp = asm.CreateInstance(Your_Namespace + "." + Your_Form_Name);
frmTemp.Show();
Hope this helps
|
|
|
|
|
u can easily solve ur problem by this way...
at first create a function like:
public void fnFormShow(Form fc)
{
fc.show();
}
now, create a object and pass through with this function, like:
Forms.frmFIR fr = new uHTMCM.Forms.frmFIR();
fnFormShow(fr);
|
|
|
|
|
I need a mechanisme to handle with EXCEL, like creating and reading Excel files. For this, at starting a new C# windows application, I have added COM reference, by using the "AddReference" dialog box's COM tabsheet. In fact there are two smilar object definiton there:
-Microsoft Excel 5.0 Object Library
-Microsoft Excel 11.0 Object Library.
I have chosen the "11.0"; At the and I managed to handle Excel Files as I wish. But, when I run my application at another pc (that is the one of our customer), it causes exceptions. I noticed that my computer Excel versiyon is 11.xxx which corresponds to Excel-2003, whereas our customer has the Excel-2002. The reason seems the version's difference. Right?
Using COM isn't a good idea? Or Which manner I should use for works with Excel Files? Maybe I use the wrong Classes or Interfaces in the COM object. What to do to avoid version differences; at least close to each other versions? Or Should I prepare seperate applications for each version of Excel.?
Thanks to all of you; for help to my this problem and previous ones.
I love CodeProject and you all.
|
|
|
|
|
You may use 11.0 on your development machine and the same can be used on other machines as well (even though these machines have a different version).
To achieve this, you need to late bind the excel object using "CreateObject" method.
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
Hi
I have a server process and client process connected with Named pipes(server is sending message to client).
If the server is already running, I open the client process,only for first time communication is taking place.If I close client process and reopen again, the serverside is throwing exception at WaitForClients method:"Pipe is broken".I need to close and reopen server in order to take place communication again.
I am using NamedpipeServer Stream and NamedpipeClient Stream objects.
What could be the reason???please advise..
Thanks in adcance
|
|
|
|