|
Hi,
I am the maintainer for Little Registry Optimizer. My program is getting error code 17 (The system cannot move the file to a different disk drive) whenever it tries to call RegReplaceKey to compact the registry hives. The weird thing about this error is that the old and new hives are both assigned using the same API and they are in the same directory and drive. I have been able to reproduce this error on my friends computer but not on mine. I have attached the error log below and the location of the registry hives on my friends computer. Please let me know if you have any ideas!
This is the code that is causing the error:
int ret = PInvoke.RegReplaceKeyA(this.hKey, null, this.strNewHivePath, this.strOldHivePath);
if (ret != 0)
throw new Win32Exception(ret);
This is the code that assigns the old and new hive paths
string tempPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
if (File.Exists(tempPath))
return GetTempHivePath();
return tempPath;
Error log: http://tinypaste.com/51dde[^]
Registry Hive Paths: http://tinypic.com/r/10pya37/6[^]
Thanks!
|
|
|
|
|
Does this happen all the time on your friends computer?
Do you run as admin on your? On his?
Can you copy a random file to those paths his computer?Opacity, the new Transparency.
|
|
|
|
|
According to the log you are trying to do a move (rename) of a file from one drive to another. This is not allowed by Windows. I have no idea what the actual paths are as your images are unreadable. Try posting the actual names with your log, in the message above rather than on obscure websites. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Hi,
The files are being moved from one drive to another. If the picture worked, then you would see that the files are both in the same directory and on the same drive. I am going to see if it will work if they go to a different directory like C:\Temp because the other directory could be locked by windows. In regards to the other thread, this is being ran as admin and the process is getting all the privileges required to call the API. This is happening all the time on his computer but not my windows 7, vista, or XP.
Here is the picture of the hive paths:
http://www.pixhost.org/show/564/1626974_registry-woow.jpg[^]
Thanks
|
|
|
|
|
The problem is that these message boxes are not connected to the log. Try listing both names at the time that you log your error message so that you can see exactly which path is being complained of. It may be that there is a bug somewhere in the code that is corrupting a path. Also please post the details in your message here on the forum rather than linking to some external site. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Ok well, I guess I am on my own on this one cause you seem to be a jackass cause my logs and pictures arent together and on a different website. If you would click on the first thread you would see that the log is there. Nice to see that someone wont give me a decent answer for some retarded reason...
|
|
|
|
|
ub3rst4r wrote: you seem to be a jackass
ub3rst4r wrote: for some retarded reason.
I made a perfectly reasonable request to you for some consistent information, and you respond with these insults. Hardly the way to encourage people, who freely give their own time, to offer to help you in the future.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
There exist two table in DB, one contains the number of sets purchased, second contain sets send/delivered to customer.
there is a form on which i am showing details of sets i.e how much available in stocks.
DataTable dt = cINI.GetDataTable("Select [sName],[sPrice] from [sSet] Order By [sName]");
foreach (DataRow dr in dt.Rows)
{
ListViewItem lvItem;
lvItem = lvSets.Items.Add(dr["sName"].ToString());
lvItem.SubItems.Add(dr["sPrice"].ToString());
object inStock = cINI.ExcuteSQLScalar("Select Sum(mQuantity) from [mPurchase] where [mName] = '" + dr["sName"].ToString() + "'");
object sendSet = cINI.ExcuteSQLScalar("Select Sum(Quantity) from [SendSet] where [setName] = '" + dr["sName"].ToString() + "'");
if (inStock != DBNull.Value && sendSet != DBNull.Value)
lvItem.SubItems.Add( (Convert.ToInt32(inStock) - Convert.ToInt32(sendSet)).ToString());
}
Is there any other way to acheive this?
As its taking 4-5 seconds in showing up.
regards
|
|
|
|
|
You coud load table in Background thread.
How big is your database, and is it local or Remote, And is it Sql or accsess?
|
|
|
|
|
Saksida Bojan wrote: You coud load table in Background thread.
Need help on this, as no idea
Saksida Bojan wrote: How big is your database, and is it local or Remote, And is it Sql or accsess?
it's daily order booking, so eventually it will grow by day.
Its local, can be used on LAN. It is access.
|
|
|
|
|
Hum Dum wrote: Need help on this, as no idea Frown
Beginners Guide To Threading In .NET Part 1 of n[^]
If you use this approach. Data to be populated will still need 4-5 second, but it will not prevent UI from showing.
ps: I do not know where i read about foreach, but it is not recomended in some case. it is better to use for loop. It is said each loop will always recalculate how many it has
|
|
|
|
|
Saksida Bojan wrote: it is better to use for loop
No difference. Both takes same time.
|
|
|
|
|
Now i remeber where i read it. it was stream read using while(!reader.EOF) it is completly diffrent thing
|
|
|
|
|
I can think of two things you might try:
1. Instead of creating and executing the Sum(Quantity) queries every time through the loop, create them once as prepared statements then simply set the parameters each time. That should reduce the amount of work the database has to do and it should go noticeably faster for relatively little code changes.
2. Depending on how strong your SQL skills are, you could combine the queries together into a single query which gives you the data you need all in one go. That way, the database is doing the work of joining the tables together which you are currently doing in your foreach loop, and databases are designed to do that sort of thing efficiently.
|
|
|
|
|
my problem is like this
i have two different application like on-screen keyboard and excel sheet
in my problem i have:
1st application: form with number buttons.
2nd application: few forms with many texboxes in each.
now i need to fill those text boxes with number using 1st application
i want to how will 1st application know which text box of which form is having cursor and how will it send the data to it. i think it require knowledge of win32 api calls and all. which i very little idea. can u help me out in this .
thanks in advance
|
|
|
|
|
|
Hi,
Is there any sample code (C#, VC++) for parental control provided by Windows (XP/VISTA/Windows 7) to extend them and write our own parental control in .Net with all features provided by Win 7.
|
|
|
|
|
If you're still interested in this please contact me
I am trying to build a team to work on C# parental control software
pascal 2007 at ganaye dot com
|
|
|
|
|
Hi,
I need to send and read sms throw my PDA (WM5.0).
Can you help me with an example?
Thanks.
|
|
|
|
|
|
Hi,
I am using the code below to generate a 10 by 10 matrix
I can run it through the main and console application. If I wanted to create a class how would refer to the class? What would be the simple code to create a new instance of the class and run the Generate() method? Would it be random.Generate()?
public static void Generate()
{
//Declaring Array
int [,]Arry=new int[10,10];
//Random Class
Random random = new Random();
string str = string.Empty;
//Loop ith element
for (int i=0; i<10; i++)
{
//loop jth element
for (int j = 0; j < 10; j++)
{
//get random number between 1 and 1000
Arry[i, j] = random.Next(1, 1000);
//printing elements a00,a01,a02....
Console.Write(Arry[i, j].ToString()+" ");
}
Console.WriteLine();
}
Console.Read();
|
|
|
|
|
Iman Mohtashemi wrote: What would be the simple code to create a new instance of the class and run the Generate() method
If you wanna use it as static so that you will not create instance of a class, the best option is to return a value as Arry[][]. But there is no problem if you want it to print to console. Also in my experience both are very simple tu use as long as you know witch one is better suited in witch senario
Iman Mohtashemi wrote: Would it be random.Generate()?
No, It woudn't be. it would be: ClassName.Generate()
|
|
|
|
|
I think you need to get a beginner's book on c#/.NET
But here you go.
public class MyClass
{
static Random s_random = new Random();
public int[,] IntArray = new int[10,10];
public MyClass()
{
for(int x = 0; x< 10; x++)
{
for(int y = 0; y < 10; y++)
{
IntArray[x, y] = random.Next(1, 1000);
}
}
}
public override string ToString ()
{
StringBuilder sb = new StringBuilder();
for(int x = 0; x< 10; x++)
{
for(int y = 0; y < 10; y++)
{
if(y>1)
sb.Append(", ");
sb.Append(IntArray[x, y].ToString());
}
sb.Append(Environment.NewLine);
}
}
}
public static void Generate()
{
MyClass array = new MyClass();
Console.Write(array.ToString())
} Opacity, the new Transparency.
|
|
|
|
|
I want to know that if we want to insert a second video while playing first video (eg. a news strip while broadcasting video seen in the channels). How would i do that?
There are two type of ads.
1) Strip scrolling at the bottom of screen
2) L shaped ad.
Any help will be appreciated...
|
|
|
|
|
Process each frame and compose the new frame as necessary (e.g., overly an ad over the video). Add the processed frames to the output video.
|
|
|
|