|
Here is the deal I am writing an application that reads certain information from a MSI database to populate a XML File. I have got most of the info I need but running into a wall with getting the shortcut path. I have been searching MSDN and found this.
(MsiGetTargetPath) http://msdn2.microsoft.com/en-us/library/aa370303.aspx
There are 3 peices of info I need from the shortcut table.
1. The Name of the shortcut (I already know how to query this)
2. The Working direcotry (Since the database uses VARIABLES for everything I need a good way to determine what the acutal path is from the VARIABLE name)
3. The path where the shortcut is being created (Same problem as stated in # 2
If I can find a way to get this to work then I feel I am home free. Any thoughts or suggestions.
PS I need to do this without installing the MSI.
Thanks,
Cyber 
|
|
|
|
|
Hi,
Im using C#.Net 2003,framework version 1.1,In the folder we can add the user manually by right click the folder-->properties-->security-->add-->user.Here i want to add user to the folder by programmatically,how do i achieve this.Help me..
Rgrds
Kanna..
|
|
|
|
|
|
Hi
I am working with windows application where i have webbrowser control which will display the report(html) page on webbroser control. I have two panels one will show the test execution and other will show the test results. So once the test execution is finished i am loading the report (html) page into the second panel's webbrowser control and showing that panel. In between the tranisition from one panel to other panel i am trying to display one messagbox showing that whether test execution passed or failed. But some times Messagebox doesn't respond to click event (its hanging). when i analyzed the issue during that hanging time WebBrowser.DocumentCompleted Event is happening. When i googled thru the interenet i came to know that WebBrowser having some knowns issues. can anybody tell me whether WebBrowser.DocumentCompleted Event will hide all the windows events (i.e. click).. is it the reason why message box click didn't respond? Also please tellme is there any other know issues on WebBrowser control!
Thanks
Srini
|
|
|
|
|
|
Hello,
In all regular mobile phone set, I see that, JAVA applications can be installed and run. But I dont know Java and I want to use C# to make a phone application. Is it possible or not. Can u send me any reference URL ?
Regards
Bashiwala.
|
|
|
|
|
bashiwala wrote: But I dont know Java and I want to use C# to make a phone application.
Only if you can cram the .NET Framework into the phone. You can only use C# if your phone supports the .NET Compact Framework. If not, you can't use C#.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi
I'm struggling with a strange problem here, I can't set the text of a button in some circumstances.
Here's my code:
private void btnGo_Click(object sender, EventArgs e)
{
try
{
btnGo.Text = "Processing...";
}
catch (...)
finally
{
btnGo.Text = "Start";
}
}
If I remove btnGo.Text = "Start", then the text "Processing" shows up once the long operation has finished.
/edit: I solved it by calling btnGo.Refresh() after btnGo.Text. But why is this necessary, will the button repaint itself only after another Paint-Event occured?
Does anyone know what might be causing this strange behaviour?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
You need to use Asynchronous process using threads
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Immediately after settings the button text, just call Application.DoEvents() , so your application gets and processes the message to repaint itself.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
There are many ways to do it if any one want to make user wait untill the process completes he can use asyncronous process as back ground thread .
There are n number of articles available on CP .
i know it is very tidious but more effective than Application.DoEvents()
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
There are also some people who are not ready to start throwing threads around. There are also situations where threading a process isn't acceptable, or would be too much work to keep the user from waiting for 1 or 2 seconds on a simpler process.
He really didn't give any kind of information about what this process was doing. So, to keep his code simple, DoEvents is a very easy fix to the immediate problem. If he wanted to move this process to a background thread, he can ask about that all he wants and we'll help with it.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I'm absolutely familiar with Threads and right after I posted this question I found the solution myself
I may switch my app to use threads in the future, but it's just a simple app for myself which querys a small database and displays some data, so button.Refresh() will do the job here.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Greeeg wrote: I'm absolutely familiar with Threads and right after I posted this question I found the solution myself
Great!
Greeeg wrote: it's just a simple app for myself which querys a small database and displays some data,
Hence, the "simple" suggestion.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
May be the process is too fast, so the processing happens in less than second, and the finally line anyway will make it = "Start".
|
|
|
|
|
This is not a strange behavior, your should start a new thread to do the time consuming work and on the finish event of the tread set the btnGo.Text = "Start".
http://stefanprodan.wordpress.com
|
|
|
|
|
HI All
I am confused while using Thread.BeginCriticalRegion(); in my application
what i am trying after compliting specific task by thread i have to abort same thread by calling abort method see the code
<br />
<br />
private void button3_Click(object sender, EventArgs e)<br />
{<br />
ParameterizedThreadStart paramThreadDelagate = new ParameterizedThreadStart(WorkWithParameter);<br />
Thread thread = new Thread(paramThreadDelagate);<br />
thread.Start();<br />
Thread.Sleep(1000); <br />
thread.Abort();<br />
MessageBox.Show("Aborted");<br />
}<br />
<br />
<br />
<br />
<br />
<br />
private void WorkWithParameter()<br />
{<br />
<br />
Thread.BeginCriticalRegion();<br />
MessageBox.Show("1");<br />
MessageBox.Show("2");<br />
MessageBox.Show("3");<br />
MessageBox.Show("4");<br />
MessageBox.Show("5");<br />
Thread.EndCriticalRegion();<br />
}<br />
<br />
The idea behind the critical region is to provide a region of code that must be executed as if it were a single statement. Any attempt to abort a thread while a critical region will have to wait until after the critical region is compplite .so the problem is i am getting message Aborted instead of executing whole WorkWithParameter method. Can any one help me out ?
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
I'm not sure that BeginCriticalRegion does what you think it does. MSDN[^] says this about the function:
Notifies a host that execution is about to enter a region of code in which the effects of a thread abort or unhandled exception might jeopardize other tasks in the application domain.
It doesn't say anything about multiple lines of code being executed "as if it were a single statement", and doesn't suggest anywhere that it blocks Thread.Abort() from ending the Thread .
|
|
|
|
|
Hi
But it says that Thread.Abort does not make any effect if the current context is in the critical region thats why Dot.NET 2.0 has introduced this and Thread.Suspend and Thread.Resume have been retired
Actually i m reading Microsoft press book name .NET FrameWork 2.0 Application Development Foundation by Tony Northup and many more in that book they mention " The idea behind the crical region is to provide a region of code that must be executed as if it were single statement . Any attempt to abort a thread while it is within a critical region will have to wait until after the critical region is complete ." PAge number 380 Chapter 7 lesson 1 .
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Hmm . . . from that text it does sound like BeginCriticalRegion is supposed to create a non-Abortable section of code, but your own test program is showing that it doesn't. When the author uses the phrase "The idea behind the critical region" it makes me wonder exactly what he means - does he mean that the code IS executed as one statement (and is therefore not abortable), or that idealistically .Net tries to make it appear to the CLR that the code being executed is one statement? The answer seems to be shown by your test program.
Check out this[^] post - it asks the same question that you have and Peter Ritchie [C# MVP] has done a good job of answering it.
|
|
|
|
|
Look up "lock" or "Monitor" in your help.
Phil
|
|
|
|
|
Lock and Monitor concept are for mulitythreading Synchronization concept
Which are not different what i asked i think
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
|
|
Hi,
When are the properties that I set in the properties window used in my application?
I have a class that does som plotting. One property in the class is XMax. XMax is set to 10 in the class but in properties window XMax is set to 255. If I print the value of XMax in the constructor of the class "10" is the result. But when "using" the application 255 is the value of XMax.
How do I get the value of XMax that is set in the properties window? I want to store that value as a default value when my program is running.
Please, help.
/Anders
|
|
|
|