|
thanks for ur reply...And really sorry for the word urgent...sorry for that, actually my deadline was approaching so....anyway thax a lot. I will try the same...
Regards
Himangshu
|
|
|
|
|
Hi all out there!
I got a function (in a C++ dll) that i want to call from VB.NET 2005 (Express). But every time i try this i receive an error "R6034". What can i do against this?
It would be very great, if someone gets me a hint!
Thanky you in advance!
|
|
|
|
|
The answer to this, and all of life's problems are here.[^]
|
|
|
|
|
from http://msdn.microsoft.com/en-us/library/ms235560(VS.80).aspx[^] :-
"Visual C++ Concepts: Building a C/C++ Program
C Run-Time Error R6034
Error Message
An application has made an attempt to load the C runtime library without using a manifest. This is an unsupported way to load Visual C++ DLLs. You need to modify your application to build with a manifest. For more information, see the "Visual C++ Libraries as Shared Side-by-Side Assemblies" topic in the product documentation.
Applications must use a manifest to load the C runtime library. For more information, see Visual C++ Libraries as Shared Side-by-Side Assemblies and Manifest Generation in Visual Studio.
In release builds, the diagnostic message reads: "An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information."
To correct this error
*
Rebuild your application with a manifest. Building an application with Visual Studio automatically puts the manifest into the resulting EXE or DLL file. If you are building at the command line, use the mt.exe tool to add the manifest as a resource. Use resource ID 1 if building an EXE, 2 if building a DLL. For more information, see How to: Embed a Manifest Inside a C/C++ Application."
|
|
|
|
|
I need to get the account number located in cell f10, g10, and h10 of a number of excel files.
I also need to get the total $ amount located in cell H42 of a number of excel files.
I have set up the program to browse for the excel files I want the information from.
But I'm not sure how to get the data I need from them and put into another excel file.
Here is the code I have so far:
Imports System.IO
Public Class Form1
Dim TheFile As Microsoft.Office.Interop.Excel.Workbook
Dim SaveFile As StreamWriter
Dim Files() As String
' Dim filebrowser As New FolderBrowserDialog
Dim intAccountNumber As Integer
Dim decTotal As Decimal
Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click
'Closes the application
Me.Close()
End Sub
Private Sub btnshowthefile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnshowthefile.Click
'Shows the spreadsheet
TheFile = GetObject("G:\data\dr.xls")
TheFile.Application.Visible = True
TheFile.Windows(1).Visible = True
TheFile.Application.WindowState = Microsoft.Office.Interop.Excel.XlWindowState.xlMaximized
End Sub
Private Sub btnbrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbrowse.Click
FolderBrowserDialog1.Description = "Select location of file"
FolderBrowserDialog1.ShowNewFolderButton = False
FolderBrowserDialog1.RootFolder = Environment.SpecialFolder.MyComputer
'FolderBrowserDialog1.Filter = "Excel files (*.xls)|*.xls"
FolderBrowserDialog1.ShowDialog()
Dim fpath As String = FolderBrowserDialog1.SelectedPath()
Dim tfiles() As String
Dim files() As String
Dim count As Integer
tfiles = Directory.GetFiles(fpath)
files = tfiles
For count = 0 To files.Length() - 1
ListBox1.Items.Add(files(count))
Next
SaveFile = File.CreateText("G:\data\dr.xls")
End Sub
Function findAccountNumber()
'To find the account number
Try
If TheFile.Worksheets("sheet1").cells("9", "f").value = ("State") Then
intAccountNumber = TheFile.Worksheets("sheet1").cells("10", "f").value
Else
intAccountNumber = TheFile.Worksheets("sheet1").cells("10", "g").value
End If
Catch ex As Exception
intAccountNumber = 0
End Try
Return intAccountNumber
End Function
Function findthetotal()
Dim intTotalSearch As Integer = 0
'find the total
Try
For intTotalSearch = 0 To 90
If TheFile.Worksheets("sheet1").cells(intTotalSearch, "g").value = ("Total") Then
decTotal = TheFile.Worksheets("sheet1").cells(intTotalSearch, "h").value
Else
MessageBox.Show("Wrong")
End If
Next intTotalSearch
Catch ex As Exception
decTotal = 0
End Try
Return decTotal
End Function
Private Sub btnaccountinformation_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnaccountinformation.Click
Try
For Each item As String In Files
findAccountNumber()
findthetotal()
'ListBox2.Items.Add("Account # " & intAccountNumber & " Total " & decTotal)
ListBox2.Items.Add("Account # " & findAccountNumber() & " Total " & findthetotal())
'To append
TheFile.AppendFile(intAccountNumber & vbTab & decTotal & vbCrLf)
Next
Catch ex As Exception
End Try
End Sub
Thanks for any help...
|
|
|
|
|
What happens when you run the code?
|
|
|
|
|
Well the browse feature works great...
There isn't any errors but it doesn't give me the values I want for the function findaccountnumber and function findthetotal...
But also don't know if I'm searching the files I browsed for to find the information...
|
|
|
|
|
Is is possible to create an exe which doesn't need to be installed to run from a windows.form?
I have a history viewer that I want to just run on the fly when the exe is clicked rather than ask the user if they want to install the application
Cheers
|
|
|
|
|
What do you mean, like a console application? If you are referring to the requirement of .net being installed, for any application you create using vb.net their target machine must have the .net framework installed.
|
|
|
|
|
You already have that. So long as the machine you run the .EXE on already has the appropriate .NET Framework installed and your app doesn't use any COM-based components, you can double-click the .EXE you already have in the bin folder and launch it as normal, no installed required.
|
|
|
|
|
Hi Frineds,
Can checkbox be placed inside dropdownlist of toolbar?
(i.e toolbar contains dropdownlist, i need to add checkbox along with text as a dropdownlist item)
please guide me...
Note : Using Windows Application..
Thanks....
|
|
|
|
|
There is a CheckOnClick property for each item. Use it.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
|
|
|
|
|
|
Hi
In vb.net I am using some form as MDI Child in my appliction i set the windowstae=maximaized. for the child. but when i load it in MDI parent it displays as maximized but for child i set the windowstate maximized then also it displays with actual size . So how can i solve it?
Please give me some solution for this.
modified on Thursday, January 8, 2009 11:35 PM
|
|
|
|
|
Hi Neha,
try setting window property "FormBorderStyle"
|
|
|
|
|
neha.lad wrote: but when i load it in MDI parent it displays as maximized but with actual size
Do you mean child form is maximized, but the parent is not?
If yes, then set the window state for the MDIParent as well.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
|
|
|
|
|
neha.lad wrote: i set the windowstae=maximaized. for the child. but when i load it in MDI parent it displays as maximized but with actual size
Of course, this is the expected behavior. You set the child forms to maximized, so they completely fill the MDI Client area of the MDI Parent form. This setting has no effect on the WindowsState of the MDI Parent.
So, if you want the MDI Parent to be maximized, you have to set IT'S WindowsState property to maximized.
|
|
|
|
|
Hi,
How to read from USB (Pendrive) content and information using vb.net???
|
|
|
|
|
You don't read from "USB". It's not a port, but is in fact, an expansion bus. You treat it just like the expansion slots on the motherboard.
You talk directly to the device attached to it, using whatever methods the device driver for the device expects. In the case of a "Pendrive", I'm assuming you mean a storage device, so, it'll show up as a disk volume. In that case, you use file system methods...
|
|
|
|
|
hi.
is there a way to query the print copy so that i can label one print to say for example. ORIGINAL and the second copy to print DUPLICATE on the header somewhere.
I've googled and can't seem to find anything like that. i can't see a routine where vb can query for COPIES . i can only see PAGEQUERY.
any help or advice would be much appreciated.
Thanks
Robbo
|
|
|
|
|
If you are printing copies, I don't think that your code will be called for each page. If you want the pages to have different headers, they are not really copies and you probably have to print them separately.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
thanks for that guffa. is there a way i can just recall the print events twice instead of setting printersetting.copies =2 ?
|
|
|
|
|
|
I have a windows a service that periodically checks the tcp/ip connection of device by pinging it and returning the status.
So for this i have used a timer.At first i tried to to dynamically create a timer using System.Timers.Timer and using the 'Elapsed'event.But the when i tried to start the service it wouldn't start.
Then I used a timer from the toolbox and seemed to start fine,the code in onstop and onstart subs is executing.However the code in timer_tick event isn't.I don't know why.I start the timer in the onstart and stop it onstop.
Below is code for the timer event.
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim api As New RfidApiLib.RfidApi
Dim status1 As Integer
Dim StrCon As String
Dim conn As SqlConnection
Dim host As String
'Dim status1 As Integer
test.WriteByDate("e:\temp", "log", "service", "reader timer this connected") ' Writes to log file
'mylog.WriteEntry("Connected", EventLogEntryType.Information)
StrCon = "data source=XXX;initial catalog=XXX; uid=XXX; pwd=XXX;"
conn = New SqlConnection(StrCon)
conn.Open()
Dim outadapter1 As New SqlDataAdapter("select * from dbo.ReaderInfo where dbo.ReaderInfo.Reader_location in (Select Reader_location from dbo.Reader_Status )", conn)
Dim ds1 As New DataSet()
outadapter1.Fill(ds1, "dbo.ReaderInfo")
Dim outadapter2 As New SqlDataAdapter("Select * from dbo.Reader_Status where Remarks = 'C'", conn)
Dim ds2 As New DataSet()
outadapter1.Fill(ds2, "dbo.ReaderInfo")
For i As Integer = 0 To ds2.Tables(0).Rows.Count - 1
host = ds1.Tables(0).Rows(i)("ReaderIP").ToString
Try
'My.Computer.Network.Ping(host)
Dim ping As New System.Net.NetworkInformation.Ping()
Dim pingReply As System.Net.NetworkInformation.PingReply = ping.Send(host) 'ping ipaddress
'test.WriteByDate("e:\temp", "log", "service", "reader" & ds1.Tables(0).Rows(i)("Reader_location").ToString & "disconnected" & e1.Message)
Catch e1 As System.Net.NetworkInformation.PingException 'if not connected try reconnecting
status1 = api.TcpConnectReader(ds1.Tables(0).Rows(i)("ReaderIP").ToString, ds1.Tables(0).Rows(i)("ReaderPort")) 'API call to connect to device
If status1 = 0 Then ' successfully connected
Exit For
Else
test.WriteByDate("e:\temp", "log", "service", "reader" & ds1.Tables(0).Rows(i)("Reader_location").ToString & "disconnected" & e1.Message) 'otherwise write to log
GoTo nxt
End If
End Try
nxt: Next
End Sub
conn.Close()
|
|
|
|
|
Your post isn't readable because it's too wide. Break the code sample lines into multiple lines to reduce the width of the post.
From the limited information I got from your post (what I could read anyway), you used the Timer control in the ToolBox and dropped it on a Form?? This isn't going to work in a service because there is no message pump. In a service, you would normally use the System.Threading.Timer, which makes direct calls back to your code instead of using events.
modified on Wednesday, January 7, 2009 2:20 PM
|
|
|
|