|
Examine properties of the DrawListViewItemEventArgs parameter that the DrawItem event receives.
|
|
|
|
|
hi,
Thanks for your suggestions.
i have drawn the image and the text using the properties of drawlistitemeventargs(thanks). but still i am not able to figure out how to draw the border for that item.
Could you please help me by suggesting some links?
Thanks once again.
Regards
Anuradha
|
|
|
|
|
The drawlistitemeventargs parameter called e has a graphics property which you use for drawing. So you need to call e.Graphics.DrawRectangle method to draw rectangle around the item. In order to pass the desired rectangle to this method explore e.Bounds property and e.Item.Bounds property. Hope this helps
|
|
|
|
|
hi,
Thanks a lot for your help.
I am able to draw the border now for each item.
Thanks once again.
Regards
Anuradha
|
|
|
|
|
You are welcome
|
|
|
|
|
Hi everybody,
I'm new bie to SCORM and I have to create a project like xmlScormstudio. I have downloaded the project from CVS on http://sourceforge.net/projects/xmlscormstudio. But i can't build it. It seems to be omitted many files. Are there any one know how to build it? Please help me!!!
Thank you!
xyz
|
|
|
|
|
I would suggest that this should be addressed on the project Forum on Sourceforge. I will say, though, that you will probably need CVS to get all of the files.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I have posted the question on the project Forum on Sourceforge, but there seem no one visit it and I downloaded source from CVS
xyz
|
|
|
|
|
I'm sorry. It seems as though the project is dormant then. I don't think anybody here will be able to help.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
I'm having a .NET 2.0 application with an application-scoped setting with a default value. Now I'd like to change this settings before starting the application (not in the source). How can I achieve this? I didn't find any file and in the .NET 2.0 configuration tool there's no possiblity to change the settings. I already added the assembly to the GAC and I tried to configure it with the configuration tool.
Thanks in advance, Tobias
|
|
|
|
|
Hi, does anyone know how to use GetAmbientProperty() to get a specific property from the container? I'm talking about custom properties instead of the colour, font etc...
I need to know this because I am trying to develop a custom control to be used in an application (written in VC++6) and the container provides specific details through the use of ambient properties. These details are account name, account number, version numbers and one or two more. I have the Dispatch IDs for these properties but I don't know how to retrieve them in C#.
Thank you for helping!
|
|
|
|
|
If no one knows how to use that ability in C# does anyone know how to do a similar thing in C#?
|
|
|
|
|
Hi,
I am sending data in the form of a COPYDATASTRUCT to a second application using the SendMessageTimeout() API function. The data is sent accordingly and the COPYDATASTRUCT retrieved at the other end using Marshal.PtrToStructure. I would now like to pass back a new COPYDATASTRUCT in the Message.Result, I do this with the following:
<br />
Win32.COPYDATASTRUCT cds = new Win32.COPYDATASTRUCT();<br />
cds.dwData = 1;<br />
cds.lpData = mydata;<br />
cds.cbData = Win32.GlobalSize(cds.lpData);<br />
<br />
IntPtr pResult = Marshal.AllocCoTaskMem(Marshal.SizeOf(cds));<br />
Marshal.StructureToPtr(cds, pResult, true);<br />
m.Result = pResult;<br />
Now the correct IntPtr value is passed back in the result param of the SendMessageTimeout function but when I try to retrieve the structure using Marshal.PtrToStructure() all 3 members of the strucure are zero.
I'm sure I'm missing something obvious here but I've been staring at it for hours and can't seem to see the problem.
|
|
|
|
|
I'm guessing you are sending a WM_COPYDATA message (with your COPYDATASTRUCT) to the other application. In general, Windows keeps each application in it's own virtual memory space. This virtual memory space is completely independent of other applications. So if you allocate memory in application#1, then the pointer returned is only good for application#1.
If you look at the MSDN[^] documentation for WM_COPYDATA, the first line under Remarks states that "The data being passed must not contain pointers or other references to objects not accessible to the application receiving the data". Because pointers are only valid for the given application. You can pass the memory location (a.k.a. the pointer's value) to another application, but the other application cannot do anything with it.
To copy data back, you would have to send a WM_COPYDATA message back to the first application. You could also use named pipes[^], .Net remoting, or maybe this[^].
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi to all,
I am trying to delete all the files in a specified folder in my project. for that i have written the following function....
==============================================================================
Code
==============================================================================
public void DeleteTempFiles()
{
DirectoryInfo DirInfo = new DirectoryInfo(Server.MapPath("~/temp/"));
if(DirInfo.Exists)
{
foreach (FileInfo FI in DirInfo.GetFiles())
{
FI.Delete();
}
}
}
==============================================================================
But whenever i am running the program it gives the error as....
Error Deleting File or Folder
Cannot delete <filename>: It is being used by another person or program.
Close any program that might be using the file and try again.
.....
Anybody help me to solve this problem.
Pravin
|
|
|
|
|
It means that the file you want to delete is in use either by your program or by other programs. If your program has an open handle to the file then close it.
|
|
|
|
|
Hy,
Try using this code
string[] files = Directory.GetFiles(Server.MapPath("~/temp/"));
foreach (string s in files)
{
File.Delete(s);
}
Hope it helps.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
That will still suffer from same problem with files in use, or not?
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
It won't suffer any problem, because the application doesn't open the file, that's why I used the static methods of the Directory and File classes.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
Nope, original code that enumerates over temp files and tries to delete them didn't open any files as well. That's not the problem. Problem is that OTHER parts of application, or other applications keep the file opened. File.Delete does pretty much the same work as FileInfo.Delete (both check permissions and then call Win32Native.DeleteFile, just look with Reflector).
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Andrei Ungureanu wrote: It won't suffer any problem, because the application doesn't open the file
It may not open the file, but it will still fail if some other process has a handle to that file. Specifically, it will throw an IOException.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Depending on what's running on your system, the temp directory will pretty much always have files that can't be deleted because an application has created te file and still has a handle to it. The only thing that you can realistically do here is to try/catch the file delete and continue with the processing as appropriate.
public void DeleteTempFiles()
{
DirectoryInfo DirInfo = new DirectoryInfo(Server.MapPath("~/temp/"));
if(DirInfo.Exists)
{
foreach (FileInfo FI in DirInfo.GetFiles())
{
try
{
FI.Delete();
}
catch (IOException ioex)
{
}
catch (Exception ex)
{
}
}
}
}
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Is it your own temp folder, or the system one? If it shared (system one) you can't really avoid this, and you can do what Pete said... if it's your own temp, you are probably forgeting to close some file - which is something you should fix. You can see who is locking the file with ProcessExplorer[^]
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
What about acess rights of the folder being deleted?
|
|
|
|
|
Wouldn't error message be different?
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|