|
Hi,
If the file is already exist in C:\Windows\System32 folder then it might be possible that the file has been corrupted.
You may need to register/replace the dll again.
Please visit the following link to get more details:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q192934
I hope this helps.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
i want to convert string into byte....this can be done in vb.net..can somebody help me in doing this in vb6.0..here the simple code..
Private Sub Form_Load()
Dim str1 As String
Dim i As Byte
i = CByte(Val(str1))
Text1.Text = i
End Sub
but this code still not able to convert string into byte....and still giving type mismatch error....i m unable to solve this small problem
farah
farah
|
|
|
|
|
Which line gives the error?
farah mazhar wrote: Text1.Text = i
Perhaps the problem is:
Text1.Text (String Datatype) = i (Byte Datatype) MisMatch...
Not sure why you convert Integer to string, and then back to string for the Textbox?
This may be of interest (but its vb.Net so not sure about VB6):
Convert a decimal value to binary, octal, or hexadecimal
The ToString method of the Convert class lets you easily and quickly convert a decimal value into a string representation of that number to binary, octal, or hexadecimal base:
' convert to binary<br />
Convert.ToString(11, 2)) ' => 1011<br />
' convert to octal<br />
Convert.ToString(123, 8)) ' => 173<br />
' convert to hexadecimal<br />
Convert.ToString(254, 16)) ' => fe
The ToString method is overloaded to take a Byte, a Short, an Integer, or a Long value in the first argument; the second argument can only be 2, 8, 10, or 16, else an exception will be thrown
-- modified at 6:18 Thursday 8th November, 2007
|
|
|
|
|
thanx for ur help but i need the code in vb6.0....can anyone help me for this...i need this for my project....thanx in advance
farah
|
|
|
|
|
+convert byte array to string
StrConv(btArray, vbUnicode)
+convert string to byte array
make the byte array the same size as the string
use copymemory api.
CopyMemory btArray(0), ByVal sText, UBound(btArray)+1
|
|
|
|
|
i have developed an application.. i want it to be minimized in the system tray when the application is minimized.. how do we t\do that. is there a spl property for that????
Thank u,
Freak8802
|
|
|
|
|
Use NotifyIcon Component, Drag a ContextMenuStrip and use it to assign different actions like to Show your software etc then assign this to the ContextMenuStrip Property of NotifyIcon then on runtime just hide your program and make visible property of your NotifyIcon to 'True'. Explore the properties of NotifyIcon for more functionality !
Hope it helps !
AliAmjad(MCP)
First make it Run THEN make it Run Fast.
|
|
|
|
|
wil try it out.. tx in advance..
Thank u,
Freak8802
|
|
|
|
|
i am doing a project for secure data transfer without encyrption.. i need sum1 to tell me how quantum cryptography is implemented?? intend to do the front ends in vb6.. wil it suffice or shud i do with java??
Thank u,
Freak8802
|
|
|
|
|
thanx in advance.
please provide me project(inventory related) in vb6.0 and sql.
PRIYA
|
|
|
|
|
Please read the forum guidelines, especially point 2.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
She has just posted the same crap all over today including the 'Weekly Survey'. And her profile also carries the same 'Give me code ...' in the Biography.
Precisely, it qualifies as a JTSW (Joke To Start Week)
Vasudevan Deepak Kumar
Personal Homepage
Tech Gossips
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
i am in problem.
i am making a project in vb6.0 and sql.
i have inventory related problem.one table for receiving items and another is issued items.when we issue an item then firstly checked what is the quantity of this item.opening quantity,closing quantity,receiving quantity,issued quatity,balanced quantity.
PRIYA
|
|
|
|
|
PRIYA (P) wrote: i am in problem.
i am making a project in vb6.0
I think I found the problem...
PRIYA (P) wrote: i have inventory related problem.one table for receiving items and another is issued items.when we issue an item then firstly checked what is the quantity of this item.opening quantity,closing quantity,receiving quantity,issued quatity,balanced quantity.
And how is that a problem?
Do you have any question?
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
PRIYA (P) wrote: i am in problem.
Yes. Because it is VB.
Vasudevan Deepak Kumar
Personal Homepage
Tech Gossips
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Hey All
I just wanted to get some feed back on my concept?
I quite literally spent days trying to work out why when I exported data to excel I could not no matter what, remove the instance of excel form the task manager…I tried every know method in every possible combination I could find on Google and ideas on these forums but it would not die
I didn’t want to use the known kill all excel instances loop as although an easy fix isn’t very user friendly as if the user has an instance of excel open, that will be close too and they probably wont like that too much…so I managed to come up with this solution which I hope or believe will finally solve the problem but has one perk to make it different
The code boasts that you can export data to excel…dispose of the excel instance in the task manager …BUT THEN … opens the file for the user to view… with the difference being, when the user now closes the file, the instance of excel is removed from the tack manager unlike if when closing an instance of excel created though automation which will stay in the task manager
vb.net 2005
<br />
Public Sub CreatExcel()<br />
Dim priorSum As Integer = 0<br />
Dim newSum As Integer = 0<br />
Dim xlProcID As Integer = 0<br />
For Each proc As Process In Process.GetProcessesByName("excel")<br />
priorSum += proc.Id<br />
Next proc<br />
Dim excelApp As Object = Nothing<br />
Dim excelBook As Object = Nothing<br />
Dim excelWorksheet As Object = Nothing<br />
Try<br />
excelApp = New Application<br />
excelBook = excelApp.Workbooks.Add<br />
excelWorksheet = CType(excelBook.Worksheets(1), Worksheet)<br />
excelApp.Visible = False<br />
For Each proc As Process In Process.GetProcessesByName("excel")<br />
newSum += proc.Id<br />
Next proc<br />
xlProcID = newSum - priorSum<br />
With excelWorksheet<br />
' Add/export some data to excel<br />
' Handy hint <br />
' This code will apply border ALL the way around a group of cells 'x,x' i.e. 'A1:A5'<br />
.Range(x, x).Borders(XlBordersIndex.xlEdgeLeft).LineStyle = XlLineStyle.xlContinuous<br />
.Range(x, x).Borders(XlBordersIndex.xlEdgeLeft).Weight = XlBorderWeight.xlThin<br />
.Range(x, x).Borders(XlBordersIndex.xlEdgeLeft).ColorIndex = XlColorIndex.xlColorIndexAutomatic<br />
.Range(x, x).Borders(XlBordersIndex.xlEdgeRight).LineStyle = XlLineStyle.xlContinuous<br />
.Range(x, x).Borders(XlBordersIndex.xlEdgeRight).Weight = XlBorderWeight.xlThin<br />
.Range(x, x).Borders(XlBordersIndex.xlEdgeRight).ColorIndex = XlColorIndex.xlColorIndexAutomatic<br />
.Range(x, x).Borders(XlBordersIndex.xlEdgeTop).LineStyle = XlLineStyle.xlContinuous<br />
.Range(x, x).Borders(XlBordersIndex.xlEdgeTop).Weight = XlBorderWeight.xlThin<br />
.Range(x, x).Borders(XlBordersIndex.xlEdgeTop).ColorIndex = XlColorIndex.xlColorIndexAutomatic<br />
.Range(x, x).Borders(XlBordersIndex.xlEdgeBottom).LineStyle = XlLineStyle.xlContinuous<br />
.Range(x, x).Borders(XlBordersIndex.xlEdgeBottom).Weight = XlBorderWeight.xlThin<br />
.Range(x, x).Borders(XlBordersIndex.xlEdgeBottom).ColorIndex = XlColorIndex.xlColorIndexAutomatic<br />
.Range(x, x).Borders(XlBordersIndex.xlInsideHorizontal).LineStyle = XlLineStyle.xlContinuous<br />
.Range(x, x).Borders(XlBordersIndex.xlInsideHorizontal).Weight = XlBorderWeight.xlThin<br />
.Range(x, x).Borders(XlBordersIndex.xlInsideHorizontal).ColorIndex = XlColorIndex.xlColorIndexAutomatic<br />
<br />
End With<br />
<br />
<br />
' Hany hint you can remove grid lines and name your sheets like so<br />
With excelApp<br />
.ActiveWindow.DisplayGridlines = False<br />
.ActiveSheet.name = "My Export"<br />
End With<br />
<br />
<br />
' Edit as required:<br />
excelApp.ActiveWorkbook.SaveAs("My File Location Path\My File Name.xls")<br />
<br />
' You must save the file here are some ideas for saving the file so as not to<br />
' have any issues with existing files that you previously exported that may have<br />
' the same file name as your new exported file which of cause would throw errors<br />
<br />
<br />
'Method 1 Unqueek File name when saving :=<br />
'You don’t have to use this but this is just my way of ensuring file names is never <br />
'the same as an old version export<br />
'###############<br />
Dim PublishDate As Date<br />
PublishDate = Now()<br />
Dim FormattedDateAsString As String<br />
FormattedDateAsString = Format(PublishDate, "F") & " " & Format(PublishDate, "(h:mtt)")<br />
Dim FixString As String = FormattedDateAsString<br />
Dim GetDate As Date = Format(PublishDate, "d")<br />
Dim TestString As String = GetDate.Day.ToString<br />
If TestString.EndsWith("1") And TestString <> "11" Then<br />
FormattedDateAsString = FixString.Insert(FixString.IndexOf(TestString) + 2, "st ")<br />
ElseIf TestString.EndsWith("3") And TestString <> "13" Then<br />
FormattedDateAsString = FixString.Insert(FixString.IndexOf(TestString) + 2, "rd ") 'FixString.Replace(TestString, (TestString & "rd"))<br />
Else<br />
FormattedDateAsString = FixString.Insert(FixString.IndexOf(TestString) + 2, "th ")<br />
End If<br />
TestString = GetDate.Year.ToString<br />
FormattedDateAsString = FormattedDateAsString.Replace(TestString, (TestString & " at"))<br />
FormattedDateAsString = FormattedDateAsString.Replace(":", ".")<br />
' Save the file<br />
excelApp.ActiveWorkbook.SaveAs("C:\My Report Created on - " & FormattedDateAsString & ".xls")<br />
'###############<br />
<br />
<br />
<br />
'Method 2 remove old file :=<br />
'You could also delete and replace old file if you rather<br />
'#############################<br />
If File.Exists("C:\My Report.xls") Then<br />
File.Delete("C:\My Report.xls")<br />
End If<br />
'#############################<br />
<br />
<br />
' You don’t have to have this but I do to be sure everything is saved <br />
For Each w In excelApp.Application.Workbooks<br />
'save all the work sheets<br />
w.Save()<br />
Next w<br />
' close the work sheets with out prompting...may not need this either<br />
excelApp.ActiveWorkbook.Close(SaveChanges:=False)<br />
<br />
<br />
'Now kill excel but only the excel instance we created and NOT any other excel applications running at the same time<br />
If Not excelApp Is Nothing Then<br />
GC.Collect()<br />
GC.WaitForPendingFinalizers()<br />
GC.Collect()<br />
GC.WaitForPendingFinalizers()<br />
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(excelWorksheet)<br />
excelWorksheet = Nothing<br />
If Not excelBook Is Nothing Then<br />
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(excelBook)<br />
End If<br />
excelApp.Quit()<br />
excelBook = Nothing<br />
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(excelApp)<br />
excelApp = Nothing<br />
Dim proc As Process = Process.GetProcessById(xlProcID)<br />
proc.Kill()<br />
End If<br />
<br />
' Now if you want you can open the excel file view. The advantage of this code is that<br />
' when the user closes the excel it wont get stuck in the system task manager<br />
Dim p As New System.Diagnostics.Process<br />
<br />
' Set this to the file location and file name of ythe excel you just exported<br />
' Example: "My File Location Path\My File Name.xls" or "C:\My Report.xls" or "C:\My Report Created on - " & FormattedDateAsString & ".xls"<br />
' Edit as required:<br />
p.StartInfo.FileName = "C:\My Report Created on - " & FormattedDateAsString & ".xls"<br />
p.StartInfo.WindowStyle = ProcessWindowStyle.Minimized<br />
p.Start()<br />
<br />
'Wait until the process passes back an exit code add if you want but your application <br />
'wont run untill the user closes the excel down <br />
'p.WaitForExit()<br />
<br />
' Free the recources ...may not need this line as will work with out but added to be save<br />
' Remove if you add the line above 'WaitForExit()'<br />
p = Nothing<br />
<br />
'Free resources associated with this process<br />
' add this if you add the line above 'WaitForExit()'<br />
' p.Close()<br />
<br />
<br />
Catch ex As Exception<br />
MsgBox(ex.Message & vbTab & ex.Source & vbTab & ex.HelpLink)<br />
End Try<br />
End Sub<br />
All comments welcome
|
|
|
|
|
I'm using crystal report and vb6. I posted a thread two days ago regarding changing the connection properties of the crystal report in vb6. I found a way by using : crxReport.Databases.SetDataSource rsReport
but I'm having an exception report : "The exception unknown software exception (0xe0434f4d) occurred in the application at location 0x77e55e02"
The report shows but after opening several reports the error message occurs.
This is my scenario:
"I'm using a udl for my connection. I have two databases namely TK and TK_MCC. TK is for other company and TK_MCC is for the subsidiary company. I used TK database when I created the crystal report. I used the setdatasource to pass the recordset to change the datasource location of the crystal report. So even if they change the database TK to TK_MCC they can still access the report. But when I did the setdatasource there was an exception report. (The exception unknown software exception (0xe0434f4d) occurred in the application at location 0x77e55e02)"
Before it was working fine when I don't have to change the database.
By the way, i tried it also in another computer (just installed the program) but the error message was different. The other error was error28 out of stack space.
Can someone help me on this...
Thank you very much.
|
|
|
|
|
I like to replicate keys typed inside a treeview control through to another window (say another textbox) without setting focus to the textbox first and then using vb's sendkeys function.
|
|
|
|
|
Use a delegate to pass values between windows.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
I need away for people to clean the web by having them delete old .pdf's
I am adding a way for the user to sort, but when I did that I would get an error when I would delete a file.
Any thoughs, beside read more books. Thanks in advance
Sub articleList_ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs)
' First, make sure we're NOT dealing with a Header or Footer row
If e.Item.ItemType <> ListItemType.Header And _
e.Item.ItemType <> ListItemType.Footer Then
'Now, reference the Button control that the Delete ButtonColumn
'has been rendered to
Dim deleteButton As Button = e.Item.Cells(0).Controls(0)
'We can now add the onclick event handler
deleteButton.Attributes("onclick") = "javascript:return " & _
"confirm('Are you sure you want to delete the file " & _
DataBinder.Eval(e.Item.DataItem, "Name") & "?')"
End If
End Sub
Sub articleList_DeleteFile(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
'First, get the filename to delete
Dim fileName As String = articleList.DataKeyField(e.Item.ItemIndex)
File.Delete(fileName)
'You would want to rebind the Directory's files to the DataGrid after
'deleting the file...
Dim dirInfo As New DirectoryInfo(Server.MapPath("./"))
articleList.DataSource = dirInfo.GetFiles("*.pdf")
articleList.DataBind()
End Sub
-- modified at 18:50 Wednesday 7th November, 2007
|
|
|
|
|
Please don't post all your code. Just the trouble spot in your code ( or at least where you suspect it is not working ).
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi there,
I would like to change the hideselection color from the treeview. I have set it to false, and i've noticed that the color is equal to the systemcolor control.
Is it possible to change this color to for example Red?
Thanks
|
|
|
|
|
You can't change TreeView.HideSelection Color directly.
But to change HideSelection color here is an another solution
1) TreeView.HideSelection = true
2) Declare:
Public previousSeletedNode As TreeNode 'To hold reference to previously selected TreeNode
3)
Private Sub TreeView1_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TreeView1.Validating
TreeView1.SelectedNode.BackColor = Color.Yellow
TreeView1.SelectedNode.ForeColor = Color.White
previousSeletedNode = TreeView1.SelectedNode
End Sub
4)
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
If Not previousSeletedNode Is Nothing Then
previousSeletedNode.BackColor = TreeView1.BackColor
previousSeletedNode.ForeColor = TreeView1.ForeColor
End If
End Sub
|
|
|
|
|
that works great! Thanks.
|
|
|
|