|
|
Thanks Pete. That deserves a good looking at. I've often coded along those lines without being aware that the tactic was 'formalised' as a design pattern.
|
|
|
|
|
Hi,
We have a WPF Windows Application and this application would be used by all our client having VISTA OS. For any error occured, system will create an entry in Application event log using the custom event source - "Application Manager". When the User Access Control (UAC) is turned ON, VISTA does not allow to register custom event source in the registry. But this works well when the UAC is turned OFF.
Is there any way where in we can create a custom event source (on the fly/programatically) with UAC turned ON?
Note: Our application gets installed using "Click Once".
Regards,
Vipul Mehta
|
|
|
|
|
Unfortunately, your app needs to be running with elevated privileges to
create a custom event log.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hi,i am new developer in vb.net.i have using vb.net2.0 and ms access.actually i am doing project on college student's attendence. a getting all the connection and at all but a would like to knoe the DATE difference parameter query for the attendence report by 'TO DATE to FROM DATE'.
|
|
|
|
|
If you want to know the diffarence between two dates you can use following sql function
DATEDIFF ( datepart , startdate , enddate )
refer following link also
http://msdn.microsoft.com/en-us/library/aa258269(SQL.80).aspx
|
|
|
|
|
Hi
My VB.NET Library references ADODB. When I build it, the above message comes out.
Should I run tlbimp.exe ?
Thanks
Marcello Turnbull
|
|
|
|
|
Sounds like you have signed your assembly, and that .NET wants you to sign the assemblies that you have referenced also.
Does the message go away if you build it without the signing-key?
I are troll
|
|
|
|
|
Hello friends.
I want to create an application in .net or VB 6.0 to search file in my systems. file may be Word, Excel or PPT.
As in Windows Xp it is inbuilt file searching option but still i want to create an application like that. By which i can be able to search my files using the contents based. Any body please help me and if you have the code please mail me at anandbpsri@yahoo.co.in
with regards.
Anand Srivastava
|
|
|
|
|
Did you read the sticky? The first thing it says is don't post and ask "do you have the code to do this or that". People are very helpful here, but nobody likes a parasite.
|
|
|
|
|
Hi
i got problem in setup project welcome dialog to get new line in welcom text. am not getting new line here. How cani get new line in welcome text.
Thanks in Advance
--Naren
|
|
|
|
|
Hi Friends, In my project, i am using two classes suppose A and B. Class A contains two functions suppose SetInputF1 and SetInputF2 with same code and same return type just differ in function name (both functions are used to assign input values of class A to static global variables), and class B contains one function suppose f3. SetInputF1 is called by many functions.
Now if i call SetInputF1 in f3 then the values of static global variables are not setting properly and if i call SetInputF2 in f3 then values are setting properly. I am using SetInputF2 function only due to this problem. But due to this my code length is increasing. How to overcome this problem , please help me if you can...
http://nnhamane.googlepages.com/
|
|
|
|
|
One more thing, SetInputF2 function is not called by any function. If i call SetInputF2 function in any other function then same problem occuring as with SetInputF1 function.
http://nnhamane.googlepages.com/
|
|
|
|
|
i think due to the cause of other functions your global variable values are changing.
better to clear those variables before calling your function.
|
|
|
|
|
I don't think you have a good understanding of the problem. Chances are one of the methods doesn't actually assign the static field under some circumstance, and you need to understand what those circumstances are in order to see how to proceed from here.
Also, I cannot help but wonder why you're using static fields. If they really belong to the class rather than an instance of the class then fine, but then you should also use static methods to work with the fields. Not that this would affect whether or not the fields get set; it just doesn't make any sense to require instance methods to be used to set class state - at least in most cases it wouldn't make sense.
The short answer to most questions of the sort "my code says to add together two and two and store the result in the variable 'n', but after the code has run the value of n is five. Why?" is "attach the debugger". Step through your code and step into the "SetF.." methods and inspect local, instance, and class variables, and you'll probably soon find out exactly why it doesn't work as expected, while at the same time learning invaluable debugging skills you can use to solve hundreds of other problems.
If that's not possible, post the minimum code required to reproduce the problem. If the problem is what you say it is, you should be able to reproduce it with simple classes a bit like this:
public class A
{
static int n;
static public void SetN(int value) { A.n = value; }
static public void GetN() { return A.n; }
}
I presume you have a way to GET the value that is being set as well, although I do not understand why you'd use this approach over static properties.
|
|
|
|
|
Thanks dojohansen for your reply. Actually static variables i have mentioned above are not actually variables..they work like static variables but they are objects of user defined classes(in dll) which are created for mapping the inputs, and the objects works as keys and can be used anywhere in the project. If i assign any input value to object then its value can be used throughout the program. So we use it...but sometimes value becomes undefined(error) as mentioned above. I thought that it was due to half code in .cpp and half in .h, so integrated all in .h file then also not working...while trying a lot i got the solution. I need to write same code with different function name and that function should not be called by any other function, then values are setting properly but code is increasing...dojohansen i have posted my query after lot of debugging and discussing with colleagues, hope you better understand my problem now. Thanks and Regards - Nilesh.
http://nnhamane.googlepages.com/
|
|
|
|
|
Is available, realised in language C # the project dll-components "Windows Forms Control Library" at which the main form is inherited from System. Windows. Forms. UserControl. Given a dll-component can display Tiff files. It is necessary to make so that in Internet Explorer at opening of the reference to a Tiff-file for file display it was used this mine of a dll-component as ActiveX.
For this purpose:
1. In Properties the project on a bookmark “Application\Assembly Information …” has established a tag “Make assembly COM-visible”, and on a bookmark “Build” - a tag “Register for COM interop”.
2. By means of a command “sn.exe-k ImagingSedoControl.snk” has created a file of keys and has placed on it the reference in file AssemblyInfo.cs of the project.
3. Has compiled dll-ku and then has placed assemblage in GAC. Thus in the register all necessary keys and sections were created.
4. Further being based on http://msdn.microsoft.com/en-us/library/aa751976 (VS.85).aspx has registered CLSID the basic class of component ImagingSedoControl. MainForm in section «HKEY_CLASSES_ROOT\MIME\Database\Content Type\image/tiff» in parametre CLSID.
After that Internet Explorer at opening of the reference to a Tiff-file, for example «C:\2886456.tiff», for its display began to load my component. But to display Tiff a file, in the basic class dll-components it is necessary for me to learn that line which has been entered in an address line Internet Explorer.
How it to make?
|
|
|
|
|
If you make a plug-in that handles a content type you do NOT need to know the URL of the resource, much less of the page containing it. That would only be useful for various sniffing or spying purposes.
The browser takes care of request and your component needs only the bytes that make up the response body. I wouldn't be surprised if plug-ins *can* obtain rather more information than this, but it's certainly all you need to draw the image.
|
|
|
|
|
The matter is that mine UserControl the component is Windows Form.NET the application, instead of component ASP.NET. This component is used as usual ActiveX Plugin adjusted for that it.NET a component. Clone of it is, for example Adobe Acrobat Pdf Plugin, which boots in Internet Explorer when in its address bar it is introduced, for example "C:\designpatternscard.pdf". It is obvious, that when Internet Explorer loads Adobe Acrobat Pdf Plugin it somehow transmits it string "C:\designpatternscard.pdf" since. Otherwise Adobe Acrobat Pdf Plugin "would not know" which file to it it is necessary to map.
|
|
|
|
|
I've never made any IE plugins and don't know the architecture, so I cannot claim how it actually works. However, there is certainly no need for the plug-in to know about the location of the file, or even it's name. The content of the file is enough.
However, rather than argue with your logic I'll try to point you in the direction of a solution: Have a look at SpicIE[^], the "Simple Plug-In Creator for Internet Explorer" project. It should give you everything you need and more.
|
|
|
|
|
Is it possible to detect that a file in a project is saved from a VS2005 add-in?
|
|
|
|
|
As from any program, you can detect that using a FileSystemWatcher. This won't indicate if the file changed in Visual Studio or somewhere else, but it will give you a notification whenever the file changes on disk.
Also, depending on what your plug-in is, it may be that it should not be a plugin at all but rather a "custom tool". If so, VS will re-run the tool whenever a file associated with the tool is saved. Look for example at the Coco/R for Visual Studio article here on CP.
|
|
|
|
|
I am not getting my program to update my access 2003 database. What the hek am I doing wrong.
This is the only problem that I still have in my program
Here is my code (function)
Public Function Edit() As String
Try
Dim OleDbConn As OleDbConnection = New OleDbConnection(ConnString)
OleDbConn.Open()
Dim MyOledbCommand As OleDbCommand = New OleDbCommand()
Dim String1, String2, String3, String4, String5, string6, string7, string8, string9, string10, string11, string12, string13 As String
String1 = TxtLuidraad.Text
String2 = txtA1.Text()
String3 = txtA2.Text()
String4 = txtA3.Text()
String5 = txtA4.Text()
string6 = txtA5.Text()
string7 = txtA6.Text()
string8 = txtA7.Text()
string9 = txtA8.Text()
string10 = txtA9.Text()
string11 = txtA10.Text()
string12 = txtA11.Text()
string13 = txtA12.Text()
MyOledbCommand.CommandText = "UPDATE Tblokkies SET WHERE leidraad = ?, A1 = ?, A2 = ?, A3 = ?,A4 = ?, A5 = ?, A6 = ?, A7 = ?, A8 = ?, A9 = ?, A10 = ?, A11 = ?, A12 = ?"
MyOledbCommand.Parameters.AddWithValue("@string1", Me.TxtLuidraad.Text)
MyOledbCommand.Parameters.AddWithValue("@string2", Me.txtA1.Text)
MyOledbCommand.Parameters.AddWithValue("@string3", Me.txtA2.Text)
MyOledbCommand.Parameters.AddWithValue("@string4", Me.txtA3.Text)
MyOledbCommand.Parameters.AddWithValue("@string5", Me.txtA4.Text)
MyOledbCommand.Parameters.AddWithValue("@string6", Me.txtA5.Text)
MyOledbCommand.Parameters.AddWithValue("@string7", Me.txtA6.Text)
MyOledbCommand.Parameters.AddWithValue("@string8", Me.txtA7.Text)
MyOledbCommand.Parameters.AddWithValue("@string9", Me.txtA8.Text)
MyOledbCommand.Parameters.AddWithValue("@string10", Me.txtA9.Text)
MyOledbCommand.Parameters.AddWithValue("@string11", Me.txtA10.Text)
MyOledbCommand.Parameters.AddWithValue("@string12", Me.txtA11.Text)
MyOledbCommand.Parameters.AddWithValue("@string13", Me.txtA12.Text)
MyOledbCommand.Connection = OleDbConn
MyOledbCommand.ExecuteNonQuery()
OleDbConn.Close()
DisableTextboxes()
NeroBar1.Value = 0
FillDataGrid("Select * from Tblokkies")
FillListBox("Select * from Tblokkies")
btnaddNew.Enabled = True
btnDelete.Enabled = True
' btnupdate.Enabled = True
SaveOrEdit = "Cancel"
'StatusLabel.Text = " Inligtin Verander."
StatusLabel.Text = "Leidraad :" & TxtLuidraad.Text & ": Verander."
Catch err As System.Exception
StatusLabel.Text = err.Message
End Try
End Function
My update button
Private Sub btnupdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnupdate.Click
StatusLabel.Text = " Kies Leidraad om te verander"
If ListBox1.SelectedIndex <> -1 Then
SaveOrEdit = "Edit"
Else
StatusLabel.Text = " Bestaande leidraad is nie verander nie"
End If
End Sub
My save button
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
If SaveOrEdit = "Save" Then
Dim add As DialogResult
add = Cls_MessageBbox.Show("Is jy Seker jy will Leidraad" & Environment.NewLine & TxtLuidraad.Text & Environment.NewLine & "Byvoeg", "Byvoeg.", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
AddNew()
'add = Cls_MessageBbox.Show("Leidraad" & Environment.NewLine & TxtLuidraad.Text & Environment.NewLine & "is Bygevoeg", "Byvoeg.", MessageBoxButtons.OK, MessageBoxIcon.Information)
ElseIf SaveOrEdit = "Edit" Then
Edit()
Else
StatusLabel.Text = " Geen Leidraad is bygevoeg"
End If
End Sub
|
|
|
|
|
hendrikbez wrote: MyOledbCommand.CommandText = "UPDATE Tblokkies SET WHERE leidraad = ?, A1 = ?, A2 = ?, A3 = ?,A4 = ?, A5 = ?, A6 = ?, A7 = ?, A8 = ?, A9 = ?, A10 = ?, A11 = ?, A12 = ?" MyOledbCommand.Parameters.AddWithValue("@string1", Me.TxtLuidraad.Text)
Okay - at least part of your problem lies here. You use positional parameters (?) in your statement, but named parameters in your parameters list. They need to be consistent.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
even if I use this
MyOledbCommand.CommandText = "UPDATE Tblokkies SET leidraad = @string1, A1 = @string2, A2 = @string3, A3 = @string4,A4 = @string5, A5 = @string6, A6 = @string7, A7 = @string8, A8 = @string9, A9 = @string10, A10 = @string11, A11 = @string12, A12 = @string13"
I can not get it to save to the database
|
|
|
|
|