PlausiblyDamp
Administrators-
Posts
7016 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by PlausiblyDamp
-
Are the functions declared public? Other than that could you post an example of how they are declared?
-
http://www.pinvoke.net/default.aspx/ws2_32/WSAStartup.html looks promising and might give you a start...
-
Which event are you adding the buttons in?
-
Does the button in question have a DialogResult assigned to it in the properties window?
-
What is the gen_allocMsg declaration in the header file? Does it specify a return type? From the little bit you posted above it looks like the function accepts a GEN_HANDLE_t rather than returns one. This would give a delaration more like Public Shared Function gen_allocMsg(handle as IntPtr) As End Function
-
You would probably be better using the windows API to simulate activity via SendMessage, PostMessage etc, it isn't going to be trivial though.
-
The only thing that springs to mind is that both files could be marked as being essential to the deployment (I can't remember the exact term - essential or vital or required kind of thing springs to mind). If a required file is missing the installer will attempt to repair the application on launch.
-
Adding a column to an Access database
PlausiblyDamp replied to bluejaguar456's topic in Database / XML / Reporting
I am assuming ds2 is a DataSet, in which case the .Columns.Add bit is adding a column to the in memory DataSet and not the underlying database, the call to da2.Update will only send back changes to the data, not to the underlying schema. Your best bet is probably to use the Alter Table command -
Just copied and pasted your code into a new C# project (not the CF version however as I don't have that installed) and once I had created a couple of dummy classes for things like the PageList and PageItem everything seemed to work fine and I could happily use [] to index the objects. Unless there is a difference between the CF and desktop versions of .Net regarding this I have no real idea where the problem could lie.
-
In the closing event you can check e.CloseReason to discover why your application is trying to close, simply decide which should and should not block the exit.
-
http://www.mono-project.com/Mono:OSX is probably the best place to start looking.
-
Publish without rebuilding whole app (dlls,...) - how?
PlausiblyDamp replied to molat's topic in General
You could always build the individual dll projects without needing access to the entire solution or the source of other dlls. If a dll or the exe have a reference to a dll then they can be built against a compiled version and no source would be needed. If you wish to use the assemblyBinding feature of the config file then the dlls need to be strongly named and each version needs to have a different version number. The format of the assemblyBinding element can be found here -
ManagementObjectSearcher Win32_Printer - UnauthorizedAccessException
PlausiblyDamp replied to joe_pool_is's topic in General
Has anything else changed apart from installing 2008? One possibility is a change in permissions for your network account. If you have a good backup of ytour system you could try resetting the machine permissions to the default by typing secedit /configure /cfg %windir%\repair\secsetup.inf /db secsetup.sdb /verbose at a command prompt. Have you tried the executable on any other machine to see if it generates the same error? -
The problem is your code is performing all it's work an the main thread and this thread is blocking explorer. Probably the easiest fix is to use a delegate and invoke this on a background thread. The following should give you an idea. private void file_DragDrop(object sender, DragEventArgs e) { string[] file_path = (string[])e.Data.GetData(DataFormats.FileDrop, false); string file = file_path[0]; ProcessFileDelegate proc = ProcessFile; proc.BeginInvoke(file,null,null); } private static void ProcessFile(string file) { Process pr = new Process(); pr.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; pr.StartInfo.CreateNoWindow = true; pr.StartInfo.FileName = Directory.GetCurrentDirectory() + "\\Rar.exe"; pr.StartInfo.Arguments = "a -m0 -vn -ep \"" + file + "\""; pr.Start(); while (pr.HasExited == false) { Thread.Sleep(1000); } pr.Close(); } private void file_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { e.Effect = DragDropEffects.Copy; } }
- 4 replies
-
- begininvoke
- delegate
- (and 7 more)
-
Error while capturing events from an eventLog
PlausiblyDamp replied to rain_dew12's topic in General
If you use Window's event viewer to read the log is it showing the same messge for any events? -
C# is a strongly typed language (like VB with option strict turned on) and as such will verify the existence of methods etc. on your variables at compile time. In the code you have a couple of variables (MSLV and mobj) that are declared as object - this means the existence of methods / properties such as Columns, Text etc. cannot be done by the compiler - you would need to either strongly type the variables or cast them to the correct type before using them. One thing you could do is to change the method definition to strongly type the MSLV parameter e.g. public List GetRecords(ListView MSLV, string Query, Type T) this should remove several errors to begin with. If the parameter T just defines which type of listviewitem you are using then you could move this to the generic declaration part as well and this would allow you to use more strongly typed code as well. public List GetRecords(ListView MSLV, string Query) where LVI : ListViewItem, new() { if (mSqlCeConnection.State == System.Data.ConnectionState.Open) { PropertyInfo mProperty; List mList = new List(); SqlCeDataAdapter DA = new SqlCeDataAdapter(Query, mSqlCeConnection); DataSet DS = new DataSet("Blank"); DA.Fill(DS, "Blank"); foreach (DataTable table in DS.Tables) { foreach (DataRow row in table.Rows) { LVI mobj = new LVI(); // If the first column is the same as the for column in the row set the text. if (MSLV.Columns[0].Text == table.Columns[0].ColumnName) { mobj.Text =(string) row[table.Columns[0].ColumnName]; } foreach (ColumnHeader LVColumn in MSLV.Columns) { // Skip the first column as this is the items column not the sub items column. if (MSLV.Columns[0].Text != LVColumn.Text) { // Make sure the column is in the row columns list or it will fail. if (row.Table.Columns.Contains(LVColumn.Text) == true) { mobj.SubItems.Add((string) row[LVColumn.Text]); } } } foreach (DataColumn column in table.Columns) { Type T = mobj.GetType(); mProperty = T.GetProperty(column.ColumnName); if (mProperty != null) { mProperty.SetValue(mobj, row[column.ColumnName], null); } } mList.Add(mobj); } } return mList; } return null; } The only thing I was unsure of is the loop towards the end where you are looping over the DataColumns - the code above should mimic your original code however.
-
web service code for email sending not working
PlausiblyDamp replied to srinivaskr's topic in ASP.NET
If it is a web service it shouldn't be inheriting from the page class, try creating a new webservice and putting your code inside the webservice derived class rather than replacing the existing code with code from a page. -
You would want to look at operator overloading for this kind of thing. Something like the following might get you started - the general idea is there it would just need validation adding and the correct maths implemented :D Public Structure Angle Private _Angle As Decimal Public Shared Operator +(ByVal angle1 As Angle, ByVal angle2 As Angle) As Angle Dim a As Angle a._Angle = angle1._Angle + angle2._Angle Return a End Operator Public Shared Widening Operator CType(ByVal d As Decimal) As Angle Dim a As Angle 'validate the angle here a._Angle = d Return a End Operator Public Shared Widening Operator CType(ByVal a As Angle) As Decimal Return a._Angle End Operator End Structure
-
Where is the class EmailAlert defined?
-
web service code for email sending not working
PlausiblyDamp replied to srinivaskr's topic in ASP.NET
If the code you posted above is for a webservice then why is it inheriting from the Page class? Have you tried creating a new webservice and just trying to incluide the code required to send the email in it? -
web service code for email sending not working
PlausiblyDamp replied to srinivaskr's topic in ASP.NET
When you say it doesn't work can you give a little more detail... Does it report success but the email isn't sent? Does the exception (if raised) give any useful information? -
Are you trying to run this as part of a page like a flash or java applet or are wanting to make it run in the browser as a full application.