|
AS i know:the path "..\simple\abc.mdf" which must exist under the project bin directory.otherwise it cann't be found by project.
maybe you can set a proprity for path which to get the path of file and then to deal with it.
|
|
|
|
|
Ok let's see who can answer this for me. I'm trying to use a transparent form programmed in C# to be the "surface" or an overlay of another active window. With this transparent form, I'm trying to draw lines, text, polygons, etc... with DirectGraphics (or Direct3D for that matter). When I create, and clear the device, the transparent form results in a horrible flickering due to the device repeatedly clearing itself with a solid color in the buffer over that active window. Suppose that this could be for a game or such...
All I want to do...is to draw using Direct3D on a transparent form without causing flickering when placed over an active window.
Any ideas???
If you don't understand my question, let me know.
Thanks.
|
|
|
|
|
I think I know what you're talking about. The flicker is from the window underneath your transparent DirectX window?
AFAIK, you won't be able to get rid of that flicker. Reason being is that the window you've overdraw (NOT your DirectX window) has to draw itself every time you update the DirectX form above it, this will force your DirectX form to then redraw itself. It's a fight between two forms for the top spot in the screen.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
That's what it is. I thought that the flicker was coming from the transparent overlay window.
It seems to happen when I use the device.Present() command. Before this happens though, the device.Clear() is called, clearing the buffer and screen to a solid color. I thought that solid color on the transparent overlay is what was giving me the trouble.
Everytime the screen updates itself, the device.Clear() is called first, which results in flicker from the solid color being overdrawn to the transparent window.
Is the reason really the active window underneath the transparent window? I just wanna be certain before I try another method to do what I want to do.
If so, any other ways that I could do this job with DirectX? GDI+ is just too slow in drawing and I just don't like OpenGL.
Thanks..
|
|
|
|
|
This is going to be a problem not matter what you use. You're forgetting how windows work. When you have one window over another, the bottom window gets painted first, then the window over it. If you move the top window, the bottom window has to paint itself, then the window you're moving.
Transparency actually makes this process even more important! If you move either window, the bottom window has to repaint itself, thus overwriting your overlay window, then the overlay window has to repaint itself.
Now, if something in the overlay window changes, making a previously hidden part of the bottom window visible, the bottom window has to repaint itself so that previously hidden parts are painted and, therefor, visible again, then the overlay window paints itself.
No matter what, if you use two windows, one over the other, you're are going to run into this flickering problem.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Somebosy pls help me...
- As seen below the initialization of "indexComponent1" -the designer uses the default contructor :
QuickProfitz.Data.IndexComponent indexComponent1 = new Data.IndexComponent();
- What I want the designer is to use the parameterized constructor as :
QuickProfitz.Data.IndexComponent indexComponent1 = new Data.IndexComponent(this);
public class DataTable : Data.Table
{
public DataTable()
{
this.InitializeComponent();
}
//Designer generated code.....
private void InitializeComponent()
{
Data.Index index1 = new Data.Index();
Data.IndexComponent indexComponent1 = new Data.IndexComponent(); // I Want designer to use 'this' as parameter
//
// DataTable
//
indexComponent1.Caption = "NewColumn";
indexComponent1.DefaultValue = "";
indexComponent1.Description = "";
indexComponent1.Mandatory = false;
indexComponent1.Name = "NewColumn";
indexComponent1.Size = 10;
indexComponent1.SqlDbType = System.Data.SqlDbType.VarChar;
indexComponent1.SystemColumn = false;
indexComponent1.Type = System.TypeCode.String;
indexComponent1.Value = null;
index1.Components.Add(indexComponent1);
index1.Description = "";
index1.Name = null;
this.Indexes.Add(index1);
}
}
-- modified at 16:57 Wednesday 27th September, 2006
|
|
|
|
|
Make the default constructor private, if it can't be used.
You may have to create it yourself in the constructor. I don't know of any way to change how the designer generates it's code. I've had situations over the years where I need to keep changing that code manually, as the designer code won't work.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Nope it won't work to define the constructor as private.. -If so the designer won't be able to access the constructor
|
|
|
|
|
I realise that, but as a code design issue, if it can't work without being passed the parent, the default constructor needs to be private.
The other way is to have a property that sets the parent, and call that after the InitializeComponent call, and let the auto generated stuff handle the rest. But, if you *need* the parent, you'll be coding around the designer, a private constructor makes more sense overall.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You will need to write your own CodeDomSerializer. It should be something like this:
[DesignerSerializerAttribute(typeof(IndexComponentCodeDomSerializer ), typeof(CodeDomSerializer))]
public class IndexComponent
{}
internal class IndexComponentCodeDomSerializer : CodeDomSerializer
{
public override object Deserialize(IDesignerSerializationManager manager, object codeObject)
{
CodeDomSerializer baseClassSerializer = (CodeDomSerializer) manager.GetSerializer(
typeof(IndexComponent).BaseType, typeof(CodeDomSerializer));
return baseClassSerializer.Deserialize(manager, codeObject);
}
public override object Serialize(IDesignerSerializationManager manager, object value)
{
CodeDomSerializer baseClassSerializer = (CodeDomSerializer)manager.GetSerializer(
typeof(IndexComponent).BaseType, typeof(CodeDomSerializer));
object codeObject = baseClassSerializer.Serialize(manager, value);
CodeStatementCollection statementCollection = codeObject as CodeStatementCollection;
if (statementCollection != null)
{
CodeAssignStatement assignStatement = statementCollection[0] as CodeAssignStatement;
if (assignStatement != null)
assignStatement.Right = new CodeObjectCreateExpression(typeof(PopUpMainMenu),
new CodeThisReferenceExpression());
}
return codeObject;
}
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi all,
kind of a stupid question, but I just can't seem to get it. I have a SaveFileDialog and can get the path of the file select with the file name, but I just want to display the file name to the user since my display space is small. Any hint to do this?
Thanks in advance
|
|
|
|
|
System.IO.Path.GetFileName("c:\Filename")
only two letters away from being an asset
|
|
|
|
|
Thank you! You saved me a giant headache!
|
|
|
|
|
Hello
I am working with Crystal reports. I have made a parametric Crystal report and take its preview, it works good. But when I run the program it shows no data. Whats the problem... Any suggestions or ideas
Thanks
|
|
|
|
|
All,
I have a c# web service that works from my project in vis stud 05.
I need to deploy it.
I do not know which files are necessary. I have three class files in the app code folder, my .asmx files and a dll that I reference in my bin folder.
Do I need to compile the service to get a dll to deploy or do I just deploy my class files? Also do I need to change any debug settings(web config or .net build settings)? Also which files are required?
Please help. I've spent a week trying to find this answer and no luck searching.
Thanks ahead for any responses.
|
|
|
|
|
You need to copy your .asmx files, any .aspx files you have, the web.config and the bin folder and its contents to your deployment target (also you may need a global.asax file if you have one). You don't need to deploy what's in AppCode as that gets compiled into the assembly in the bin directory, so yes you must compile the service.
In VS2005, if you click on your project in the solution explorer window there is a 'Publish' menu option - this will take care of it all for you. The way I do this is to have a shared folder on the server which runs IIS (and this folder is set up as a virtual directory in IIS), and then publish using the aforementioned menu to that shared folder on the server. It's pretty straightforward when you get the hang of it.
Regards,
Rob Philpott.
|
|
|
|
|
Hi,
Thanks alot. After a week of searching, I found nothing of this publish option. This did create the correct dll and files that needed copied.
I do have another question though. When I copy the service files to another machine and create a project to access it in code, I create an object of type "MyService", and when I try to step through the code, when I run through one of the webservice functions, I get the debug error:
"Unable to automatically step into the server. Unable to determing a stopping location. Verify symbols are loaded. Breakpoints cannot be set in code that is optimized or has no symbols when the debugger option 'Just my code' is enabled."
First let me say, the function in the service did run successfully.
But, Shouldn't the test project just step through this function?
and
Is there any options I should be setting up in my webservice project before publishing? like debugger options?
Thanks for you help again. ChaciMulch
|
|
|
|
|
Hi again,
Glad to hear you managed to deploy the service ok, so I presume when say you've created a project to access it, you created a new project and added a web reference to your service?
I suspect the problem you are experiencing now is because you are trying to debug part on your local computer and part on the server. You can't step into the webservice as such as its running in a different process on a different computer. (Although apparently you can if you set remote debugging up - something I've never succeeded in getting to work).
If this is the case, best way forward is to run both the webservice and its calling program on your local computer and then when you're happy that it works ok, deploy the service to your server. If you look at the web reference you created, there is a property on it called 'Url Behavior', make sure this is Dynamic. Then if you look in the app.config of the calling program, you'll see a setting where you can specify the URL of the service. You can change this line to connect to either the local service or to connect to your deployed server version.
Web.config in your webservice project has what few debug options there are, but they're geared more to concealing you errors from your webservice consumers than helping you as a developer. Make sure customErrors is 'Off':
http://msdn2.microsoft.com/en-us/library/h0hfz6fc.aspx[^]
Hope that helps..
Regards,
Rob Philpott.
|
|
|
|
|
Ok. I got that stuff. I am using a web reference.
My question now is, I do not want to remote debug. I just want to step through the calling app. How do I get that error to stop coming up every time I'm stepping through the calling app and I call one of the WebService Functions? Or is this impossible when using a webservice?
Thanks again. Chaci Mulch
|
|
|
|
|
Can you not just step over (F10) rather than into (F11)?
Regards,
Rob Philpott.
|
|
|
|
|
Got it. Thanks so much. I have a way better understanding of this process now.
Chaci Mulch
|
|
|
|
|
Cool! Good luck with it....
Regards,
Rob Philpott.
|
|
|
|
|
Hi,
i want some help with exporting detailsview to excell.I m working on a web application and i have a search page and a result page.The result page demonstrates the results of the search in a detailsview and i want to export it to excell.I use a button for that, the code of the button is :
protected void Button1_Click(object sender, EventArgs e)
{
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.Charset = "";
// If you want the option to open the Excel file without saving then
// comment out the line below
//Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
DetailsView1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
}
public override void VerifyRenderingInServerForm(Control control)
{
/* Confirms that an HtmlForm control is rendered for the specified ASP.NET
server control at run time. */
}
But i have an error message :
"RegisterForEventValidation can only be called during Render();
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: RegisterForEventValidation can only be called during Render();"
Any ideas?????It's very important
Thanks galatia
galatia
|
|
|
|
|
The RenderControl method is really only appropriate if you are planning to push your HTML out to some other output, such as a PDF rendering component. You probably want to generate a comma separated representation of your data (I'm assuming the DetailsView1 data soure is a DataView or a typed list of some sort). A comma separated file with a .xls extension opens as an Excel spreadsheet. You could do something of the form:
StringBuilder csv = new StringBuilder()<br />
foreach(DataRowView row in theDataView)<br />
{<br />
csv.Append(string.format("{0},{1},{2},{3}\n",row["col1"],row["col2"],row["col3"],row["col4"]);<br />
}<br />
Response.Write(csv.ToString());
|
|
|
|
|
Hi,
I want to delete nodes in XML the problem is I'm using deleteSelf() but only a few nodes are deleted and not all here is the code:
foreach (XPathNavigator nav in navigator.Select("//book[@title='"+title+"']"))
{
nav.DeleteSelf();
}
doc.Save(filename);
-- modified at 6:29 Thursday 28th September, 2006
|
|
|
|