|
Hi
Put the config-file in the application data path in the Home-directory of the User on NT-based OS (C:\documents and settings\%UserName%\Application Data\).
André
'A programmer ist just a tool which converts caffeine into code'
|
|
|
|
|
Hello Thanks for the reply!
Can I read the Home-directory folder out of the system settings? Or how should I handle multi language installations (french, german, ...) which do not name the folder 'documents and settings' but 'dokumente und einstellungen' for instance?
Greetings
|
|
|
|
|
|
Yes, that's the right solution.
'A programmer is just a tool which converts caffeine into code'
|
|
|
|
|
Hi,
I'am starting to learn how to write a custom control to use in my C# applications. Actually it's designed to the Compact Framework but as my tries say to me, my problem is the same in the normal Framework.
I need to have a textbox and a command button joined to it at its right border (think a textbox including a browse button). Actually my custom control inherits from the Panel, and I instanciate the textbox and the button in the constructor. It works perfectly, but when I use it in the designer, as it derives from the Panel, I can put other controls in it (it's a container). I don't wan't this behaviour (which also doesn't permit to click in it to move it, I have to point the borders, like a real Panel).
Is there another way to do that ?
Thanks all !
Stephane.
|
|
|
|
|
Just found the answer : I inherited my control from Control instead of Panel, as it has a Controls collection too.
Maybe this can be useful to someone else !
Thanx, Stephane
|
|
|
|
|
Im trying to call the function ChildWindowFromPoint but it seems that it always asumes the Parent window is in the Upperleft hand corner, meaning even if the parent form is in the lower right it wont find the child control until i click around in the area in the upper left hand corner. Its all a little hard to describe here but in anycase ill include the code on how im calling the function. Im using global mouse cords, with the upper left of the screen being 0,0.
[DllImport("User32")]
public static extern IntPtr ChildWindowFromPoint(int handle, int x,int y );
int chihan = (int)Form1.ChildWindowFromPoint(handle,e.X,e.Y);
//show if it found a pointer
MessageBox.Show(chihan.ToString());
//try to display the window text of the child control
StringBuilder s = new StringBuilder(1024);
Form1.GetWindowText(chihan,s,1024);
MessageBox.Show(s.ToString());
I dont know what im doing wrong, i can find the parent control without a problem, reguardless of where it is located on the screen, and im using the same cords as i use in the function above,
Thanks alot for your time
~Jesse
|
|
|
|
|
You probably need to convert the coords to the parents client coords. And, its going to depend on what coord system its coming from as to what you'd have to do. Try looking into PointToClient and PointToScreen.
--
Joel Lucsy
|
|
|
|
|
Just wondering if anyone can point me in the right direction or give me some useful pointers on how to pass data from a pop-up window to a crystal report.
I have worked out how to get the fields I want, the values populate and everything is fine, but i need it to be able to have a date selection on it (Ie load this report where date between start and finish)
I appreciate the feedback.
Paul.
Carnal (Car-Lan) Car and Computer Club http://carnalonline.org.
|
|
|
|
|
private bool SaveFile(string path, ref byte[] buffer)
{
System.Security.Principal.WindowsImpersonationContext impersonationContext;
impersonationContext = ((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();
FileStream newFile = new FileStream(path, FileMode.Create);
newFile.Write(buffer, 0, buffer.Length);
if (newFile.CanRead)
{
newFile.Close();
impersonationContext.Undo();
return true;
}
else
{
impersonationContext.Undo();
return false;
}
}
I get an invalid cast on this line:
impersonationContext = ((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();
Any idea why? This is when i try to impersonate while uploading a file. I can;t seem to solve the problem.
-----------------------
In addition, if i remove the impersonation stuff, i get prompted, if i enter the username and password it works fine. So am i using the right code to impersonate?
-- modified at 23:14 Wednesday 2nd November, 2005
|
|
|
|
|
Use a debugger to inspect the type of User.Identity, apparently it is not of type System.Security.Principal.WindowsIdentity.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Morality Apart from God
Judah Himango
|
|
|
|
|
When i compile it, there is no error, but its hosted on a remote server. If i run it on local server its fine, on the remote server i get the error.
|
|
|
|
|
Apparently, there are four classes implementing IIdentity, according to this[^] page. Maybe you're getting an instance of some other class among the four?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Although I maintain a fair size WinForms app, I've not really used the tab control much. I'm using one now, and I find that if I set the buttons to appear on the left, no text appears on them. I got some text on there once, but I have no idea how, or why it won't work. I've made the buttons big to make sure it's not that the text doesn't fit, I'm not sure what else to try before I draw the damn things myself.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hey CG.
Yeah, I've run into problems with the WinForms tab control many times. There are several owner-drawn implementations out there that draws tabs correctly for tab orientations other then the top orientation.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Morality Apart from God
Judah Himango
|
|
|
|
|
Hello,
I'm quite new at this and have a question. How do I run one of the demos after I have downloaded the code. Do I create a blank solution and paste the folder in as a new project?? Help please. Thanks.
|
|
|
|
|
The code you download should include a project file. If it doesn't, ask the author.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sorry but I've downloaded several of the available source codes and I can't get any of them to work. I'm getting all kind of errors. I'm just not doing something right. All the programs are webforms if that helps. Also, I'm not getting the common localhost error. I don't think I've gotten that far yet.
|
|
|
|
|
Nkdnt wrote: All the programs are webforms if that helps
Ah - in that case, you need to set up IIS to run a virtual folder in your apps root directory.
Or you may have installed IIS after VS, or for some other reason your ASP.NET ISAPI filter may not be registered. Try running aspnet_regiis in your .NET install folder.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I hate to be the guy how seems to know absolutely nothing but I'm still having problems. I believe my IIS is running fine. I am able to create my own webforms and fun them. I just don't know how to get other peoples code to work. I downloaded the code from this site to my desktop, I extracted all the files, now what? Everything I tried hasn't worked.
Thanks for all the help.
|
|
|
|
|
I guess the obvious thing would be to create a new form in your project which works, then copy the code from the form in the project you're having trouble running.
I have to admit, if I've ever downloaded a web article, I've probably copied the code right into the project I want to use it in.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have writen an app that uses DirectX for 3D graphics. It runs fine on my system but the 3 people i have given the program to, to run have all had errors like this:
process id=0x1c8(456), thread id=0x774(1908)
I have made sure they have the latest .NET framework and DirectX.
But as far as i can understand it only work on my system.
If any one is intrested you can download the executable and the source form this page:
http://www.monkeycmonkeydo.co.uk/Stage4/hm.htm
Any help wiht this would be great.
MAny thanks
|
|
|
|
|
The most likely source is different graphics cards, I would have thought.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
Is managed DirectX installed on all other machines?
'A programmer ist just a tool which converts caffeine into code'
|
|
|
|