|
i am very buzy in my personal works
|
|
|
|
|
Hi everyone,
I have developed a WPF application that works fine, but if I put a link to this app's .exe in Environment.SpecialFolder.Startup so that it is started at system startup, when I boot the computer, what I get is the typical error: "my app" has encountered a problem and needs to close.
If I start the application later on (not at system startup), it works, so I think it maybe has to do with CLR is not full ready when the app is executed at startup.
Anybody knows how to resolve this situation? It seems that in computers with long startup (a lot of apps have to run at system startup) this error doesn't happen. I guess it is so because CLR is completely up when my app is launched.
How do you think this could be 'workarounded'?
Thank you.
|
|
|
|
|
What about adding exception handler block that logs errors? Is the app accessing any files on startup that reside in the same directory as the executable itself?
|
|
|
|
|
Thank you very much for the exception handler tip. I'm going to check it.
Yes, the app accesses some dll files that reside in the same directory as the executable, but I don't understand why this could be a problem. Could you explain me, please?
Thank you.
|
|
|
|
|
Luis_codeProject wrote:
Yes, the app accesses some dll files that reside in the same directory as the executable
Looks similar to the problem I had. I guess you are using relative path for accessing the files, don't you?
When you launch the application yourself the current directory is the same where the executable resides but when it is launched at startup current directory is set to c:\documents and setting\youruser
So you can either change the current directory or use absolute path
|
|
|
|
|
Thank you for your support.
I have some "Environment.CurrentDirectory" in the code, but the point is that on some computers the app starts at system startup with no problems... So that should not be the problem, I guess.
I'm going to test the app catching AppDomain.CurrentDomain.UnhandledException so that I can log the exceptions to a file.
I hope this is the right way.
|
|
|
|
|
|
Yes, you were right
I don't know why it only happens in some machines but not in others. Anyway, the problem was related to the Environment.CurrentDirectory path.
I used it to load some i18n resources. In some cases, the current directory was changed externally and that was producing the unhandled exception.
I have read that Environment.CurrentDirectory has nothing to do with the application and can be changed outside of the application so for my purpose, it's better to use the following:
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
instead of:
Environment.CurrentDirectory
That change solved my problem. I really appreciate your very useful help. Thank you very much!!!
|
|
|
|
|
You are welcome
|
|
|
|
|
Hi all,
I am working with a non-profit organization on a project for elderly and people with disability. The project is on "re-adjusting" a normal computer mouse. Some of these folks can not double-click, nor hold the left-click down for dragging files/folders. I found the following codes off this website for changing the middle-click to left-double-click.
http://www.codeproject.com/KB/cs/MBtn2DblClick.aspx
http://www.codeproject.com/KB/cpp/MBtn2DblClickVC.aspx
This program would be very handy for them.
Regarding the 2nd part, what I am looking for, should work like the following:
1. Move the pointer on a file/folder
2. Press and release the Middle/Wheel Click
3. Move the pointer and it moves/drags the file/folder.
4. Press and release the click again and the pointer releases the file/ folder
This should work for the Windows environment. Does the description make sense?
Can somebody please point me in the right direction for the second part?
Thanks,
-Farzad
|
|
|
|
|
Hello Farzad,
I know this was posted a while back, but I want to help.
As it turns out, I was working on a similar program not to long ago and was able to modify it for your use.
It's kind of hodge-podged together. It uses a Mouse-hooking class written in C# I came across somewhere on the net and modified for my use. The main form is written in Visual Basic .NET.
You can download the code from: HERE
Hope that's what you needed,
Ray
|
|
|
|
|
Hi All.
I have bound the Text property of several Textboxes to the properties of an Object with DataSourceUpdateMode.Never .
A foreach loop cycles through all textboxes and the DataBindings.WriteValue() function is called for each modified textbox to give the changes back to the object (which stores them in a database):
foreach (TextBox ctrl in gbCAddress.Controls)
{
if (ctrl.Modified)
{
ctrl.DataBindings["Text"].WriteValue();
ctrl.Modified = false;
}
}
This works fine so far, but after calling WriteValue(), all other DataBindings reload the data from the object, which overwrites the changes made to the other textboxes (probably because the Datasource changed ?).
Example:
textbox1 and textbox2 were modified.
The loop calls the WriteValue() function for textbox1
All Bindings reload their data - textbox2.Text is now the old value
The loop calls the WriteValue() function for textbox2
Can I suppress this reloading somehow ? I cannot see why everything is reloaded after one field changes...
Help !
|
|
|
|
|
Hi ezeew.
you binded all text boxes to DB.
As you and all people know! the data in those text boxes will change when DB update.
so I suggest you to collect your all data in each text box (if it modified) and in the end Update them to DB. (not exactly after modification)
I dont know, probably into a dailog form. It depend on you.
sorry, my english is not good
|
|
|
|
|
I have a big size xml dom.
Each node has lots of sub node and each subnode has lots of child sub nodes.I want to read,validate and save this xml data to database.
Each node having attributes under a parent node is considering a transaction bcoz these row of node having attributs are geting saved in different table in database
How can i count a transaction and transaction time while save xml data to database.
Can anyone plz give me some idea.
thanks and regards
tarak
|
|
|
|
|
It doesn't matter how many times you ask the same question you'll get the same response.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: how many times
The number of XmlNodes perhaps.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
NOONE KNOWS WHAT YOUR TALKING ABOUT! What do you mean by "COUNT TRANSACTION TIME AND NUMBER OF TRANSACTION" and how do it relate to your XML file???
|
|
|
|
|
Is there a way to modify/add to the list of file extensions that ResXFileCodeGenerator recognizes as text files?
I'm on a project where the (DB2) queries are all accessed through resource files. I have a visual studio add-on that gives me editor support (color coding, etc) for working with DB2 queries when editing text files with the db2 extension.
The problem is that the ResXFileCodeGenerator doesn't recognize these files as being text files, so when I add them to the resource, they get returned as byte arrays.
I'm well aware that there are other, better ways to manage these queries, but I have to stay with the design that's already in place.
At this point all I want to do is make ResXFileCodeGenerator recognize files with a .db2 extension as text, so the ResourceManager will return them as strings.
Thanks.
Grim
MCDBA, MCSD, MCP+SB
SELECT * FROM users WHERE clue IS NOT NULL
(0 row(s) affected)
|
|
|
|
|
I have a big size xml dom.
Each node has lots of sub node and each subnode has lots of child sub nodes.I want to read,validate and save this xml data to database.
How can i count a transaction while save xml data to database.
Can anyone olz give me some idea.
thanks and regards
tarak
|
|
|
|
|
TARAK NATH ROY wrote: How can i count a transaction
What do you mean?
only two letters away from being an asset
|
|
|
|
|
What do you mean my "count a transaction"?? That doesn't make any sense the way you wrote the question.
|
|
|
|
|
TARAK NATH ROY wrote: How can i count a transaction while save xml data to database.
For each transaction, add one to the previous count.
|
|
|
|
|
Also you should initialize the count with 1. You can use a different number, and subtract that later, but its not as efficient as just starting with 1.
|
|
|
|
|
I think that you mean zero...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
So I made a datagridview, table adaptor, dataset, etc and it's all working fine. I can view data perfectly but I can't save it. I tried doing this:
Me.TerritoryTableAdapter.Adapter.Update(Me.TerritoryDataSet.Territory)
But it just says I need a DeleteCommand or UpdateCommand, etc. I'm using the ODBC driver for MySQL if it makes a difference. Please help
|
|
|
|