|
If a control is not visible, and its background image is changed, will the image actually change? or will it only change only when it becomes visible?
|
|
|
|
|
That depends on how you specify "the image".
If the control is not visible, there is no background image drawn. If you change the property for the background image, the property changes, but as the property is not used as an image, the image can't change.
---
b { font-weight: normal; }
|
|
|
|
|
If a tree falls in the woods, and no-one is there to hear it...
If the control is not rendered, then no image is drawn.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes it will. But you won't see the change until you make the control visible.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
That means that if I have a number of pictures changed but not visible, it has potential to slow down the foreground performance right?
|
|
|
|
|
Yes, your app will take a performance hit every time you change (i.e. read) a new image (assuming you're reading them from a file).
A simple work-around would be to only remember the new image name everytime you "change" it. Then, when the control shows itself, it should load the current image (if it hasn't already done so) and set it as its background.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
How would I go about creating my own file format for an application?
Any help is appreciated
Wacky waving inflateable arm flailing tube man!
- Family Guy
|
|
|
|
|
Come up with three letters that are not commonly used ( not .doc for example ), then write the code to store relevant data to a file, and read it again.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sean89 wrote: How would I go about creating my own file format for an application?
Like Christian said, pick an uncommon extension, and use any file reading and writing mechanisms you want. For maximum efficiency, pick a file type that has lots of existing library support (like Xml or MDB), and use that file type with an uncommon extension.
Your files look like "ABC" files in explorer, but your app knows that they're really XML or Access database files when it goes to read and write them.
Share and enjoy.
Sean
|
|
|
|
|
Hi
I'm use using HttpWebRequest and HttpWebResponse to get a big xml file (about 10mb) from the web.
Now I want to parse this file and store it to the hard drive at the same time.
Problem:
When I store it first, then load it via TextReader it takes to long.
When I parse it directly via XmlTextReader, I can't save it to the hard drive any more.
Any idea, how to manage this problem? Properbly by filling an memoryStream?
Thanks
Paul
|
|
|
|
|
use the XmlTextReader, and as you parse the file, use a XmlTextWriter to save it on disk.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
i want to run my program in background.it functions like that when it found a new file HTML or PDF on harddrive.it is activated and default screen of my programs become visible to user.if any one have any idea of doing so then plz help!!!Thank you
|
|
|
|
|
Hi
i had a problem with connecting to my Data Base on the server but after giving my user the permissions it works.
Now i have a problem, when i doing an SQL Query on the table(select * from Users) i get the answer with the Query Analyzer.
when i am writing it in the source code with C# i get this error message:
"SELECT permission denied on object 'Users', database 'RTQ', owner 'dbo'. "
the exeption comes from this function:
myDataAdapter.Fill(myDataSet,"Users");
the hole code is :
mycon = new SqlConnection("Data Source=localhost;Database=RTQ;Integrated Security=SSPI");
mycon.Open();
myDataAdapter = new SqlDataAdapter("select * from Users",mycon);
myDataSet = new DataSet();
myDataAdapter.Fill(myDataSet,"Users");
mycon.Close();
Why is that????
Thanks you all
|
|
|
|
|
Does the user have SELECT permissions?
|
|
|
|
|
How do i konw this?
i gave him the login permissions, i thought that all the permissions come with that.
Do i have to give pemissions for each SQL command??
where do i do this?
|
|
|
|
|
Te easiest way is to make the user database owner. That includes permission to do anything.
---
b { font-weight: normal; }
|
|
|
|
|
That's an easy solution, but lets not open a security hole too wide.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
You are right of course. On a distributed application the premissions should ideally be minimal, for an example only permission to execute stored procedures.
In a development environment (as I got the impression we are dealing with here) security is normally less of an issue, and granting database owner access can be an acceptable way to make it work and save permission hassles for a later stage.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: In a development environment (as I got the impression we are dealing with here) security is normally less of an issue, and granting database owner access can be an acceptable way to make it work and save permission hassles for a later stage.
Ah yes... the later stage when time is tighter and the client is moaning about when they will get their application and all of a sudden it is discovered that the software is relying on some security setting being left open when really it should be shut.
I know what you mean though. It is very tempting just to open everything to make development easier (not just databases but for any secured system), but in my experience it just causes more problems later on - especially if it is in an area where I don't have much experience already and I don't know how to properly develop the app bearing in mind the security has to lock down later on. In cases where I should really know better, I always manage to forget some little thing that causes lots of problems later.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
Well, that's not really the stage I had in mind. The thread writer seems to be in the stage of getting a database connection to work at all, and at that stage it's difficult to be concerned with security issues.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: The thread writer seems to be in the stage of getting a database connection to work at all, and at that stage it's difficult to be concerned with security issues.
I suppose you're right.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
ytubis wrote: i gave him the login permissions, i thought that all the permissions come with that.
Login permission is just that: Permission to login. It does not grant any other rights.
You need to add the user associated with the login to the database you wish to access.
Then you need to <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ga-gz_8odw.asp" rel="nofollow">GRANT</a>[<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ga-gz_8odw.asp" target="_blank" rel="nofollow" title="New Window">^</a>] the user the rights to do what is needed. Normally, I just permit access to stored procedures. That way all the application can do is what is defined in the stored procedures.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
Hi everyone,
I am trying to migrate a source code from C++ to C#. This code deals with computer graphics and image filtering. It needs to be efficient, this explain why I use some low level programmation in C#.
I need to find a way to create a generic class that represent an array of whatever (this array will mostly be used to represent pixels). This class will then allow me to access any data in a width * height grid of data.
But it gets intricate when I try to get a pointer on my generic type. Here is a sample:
class Field<anyType>
{
private int nx, ny;
private anyType[] data;
public unsafe Field(int x, int y)
{
nx = x;
ny = y;
if (nx * ny != 0)
{
data = new anyType[nx * ny];
}
}
// return the anyType value located at (i, j)
public unsafe anyType Value(int parameter)
{
i = (i < 0) ? -i : (i >= nx) ? 2 * nx - i - 1 : i;
j = (j < 0) ? -j : (j >= ny) ? 2 * ny - j - 1 : j;
fixed(<b>anyType* v = data</b>) //this does not compile, see error below
{
return (anyType) *(v + j * nx + i);
}
}
}
But the compilator does not like it, it says:
<i>Cannot take the address of, get the size of, or declare a pointer to a managed type ('anyType')</i>
about the bolded line.
So what? is it impossible to get a pointer on a managed object. I thought it was the goal of the fixed statement to give possibility to use pointer on any object.
I know that I could also simply use data[j*nx+i] but anyhow, I will need this pointer later on for other purpose.
Every good ideas is welcome
Lawrence
|
|
|
|
|
Only works on types that has no managed references.
|
|
|
|
|
hello,
i find the visual c# has some feature that c++ does not,and i want to use the visual c# write something that can be used in my visual c++ project,does this possible?and what can i do?
maybe is the dll or com dll,but i do not know how to?
|
|
|
|