|
Hello all!
sorry but I cannot find any specific section for vb6.so writing here.
When I run VB6 and try to start a new data project I get an error to refer to refer to datarpt.log for details - this is what the log says:
Line 2: Class {78E93846-85FD-11D0-8487-00A0C90DC8A9} of control DataReport1 was not a loaded control class.
Line 0: The file C:\bern\visbas60\Template\Projects\DataRpt.Dsr could not be loaded.
It's VB6 (brand new fresh install) - Windows XP
Any ideas?
Thanks!
|
|
|
|
|
In the listview i want to change column Header of each item.for example i want that my column header's font be "Titr" while items and subitems font be "Tahoma"
please help me
thanks
|
|
|
|
|
I want to read the contents of a ms-Word (Doc) File?
Actually i want to know how can i read the contents of a doc file.
Suppose email-id is written in a doc File and i don't know where it is
written in that doc file. What i want to do is to Retrieve this email id from
the doc file.
How can i do that? Kindly help me.
I will bw very thankful to you.
Alok Singh
|
|
|
|
|
You need to either read up on the Word file format, and write your own code to read it ( good luck ), or use Word itself, which can be controlled via COM and ( in recent versions ) .NET.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
will you tell me the step by step way how can i do read the
contents of a DOC File?
Alok Singh
|
|
|
|
|
See my last post. If you want to control Word, you need to google for it. To be honest, I've not done it, I just know it can be done.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Can anyone tell me how to program to disable Outlook Security settings and avoid security warnings like "a program is trying to access e-mail addresses"?
Many thanks!
Zeng Fu
|
|
|
|
|
With great difficulty! As far as I'm aware it cannot be done in .NET. It can't be done in VBA. It can be done using MAPI, which in turn can only be programmed directly from C/C++ or Delphi.
I had to work around this issue a few years ago and I did it in C++. Given the total problem context it wasn't at all straightforward - took a couple of months to figure out!
Kevin
|
|
|
|
|
|
I am writing a vb.net code, and I seek an advice as to how to programmatically simulate a click on a certain item in a certain listbox (where my cursor is not located on that item).
Danny
|
|
|
|
|
You can directly call your Click EventHandler.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Let me more specific. In my click evenhandler I raise a mouse even (right click), but for that the mouse should be located on the right place in the listboc, that is in a certain index, while I call upon it from another location in the code (things are executed programmatically).
|
|
|
|
|
Hi
can someone tell me what wrong with my code i get the nullreference exception I know its something obvious but still new to .net
here is the code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
MsgBox(Spot(0).ToString)
End Sub
Function Spot() As Array
Dim ObjArray As Array
ObjArray = Nothing
Dim Obj1 As New Object
Dim Obj2 As New Object
Dim Obj3 As New Object
Obj1 = "Hello World"
Obj2 = 69
Obj3 = False
ObjArray(0) = Obj1 <-this is where the null reference is getting thrown
ObjArray(1) = Obj2
ObjArray(2) = Obj3
Return ObjArray
End Function
thanks everyone =)
|
|
|
|
|
Well, first of all, why do you want to create an array of all different types ? That kind of sucks.
Second, never use MsgBox, or any other things that exist only to make VB6 coders feel warm and fuzzy. Use the .NET stuff, such as MessageBox.Show. In this case, it doesn't matter much, but it's a good habit to get into.
Have you stepped through the code, to see what's happening ?
thedom2 wrote: ObjArray = Nothing
If your array object is 'nothing', then it's not an array, is it ? You would do better to use a dynamic container such as ArrayList. Either way, if you want to have an array with 3 objects in it, you need to call new to create it. You've done the opposite, you've told the compiler that there's no memory to assign yet, and no object exists.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
well ultimately i wanted a function that output 3 items(hence the array)
when i try the below line
dim objArray as NEW array
intellisense tells me "cannot be used on a class that is declared 'mustinherit'"
the objArray=nothing was me "trying" to debug/test the fucntion(that didnt work)
any suggestions oh wise one
|
|
|
|
|
worked it out this is the code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'this calls function and select 2nd array element
MessageBox.Show(Spot(1).ToString)
End Sub
Function Spot() As Array
Dim ObjArray As Array = Array.CreateInstance(GetType(Object), 3)
Dim Obj1, obj2, obj3 As Object
Obj1 = "Hello World"
obj2 = 69
obj3 = False
ObjArray(0) = Obj1
ObjArray(1) = obj2
ObjArray(2) = obj3
Return ObjArray
End Function
Christian you cant actually use new keyword on array member well thats what i read on msdn. you need to use createinstance to get the thing in memory and work with object. thanks for your help anyway
|
|
|
|
|
thedom2 wrote:
Christian you cant actually use new keyword on array member well thats what i read on msdn.
You typically wouldn't do this. In C# you'd do it like this
object [] ObjArray = new object[3];
I have no idea how it's done in VB, but I'm sure there's a way.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Christian Graus wrote: I have no idea how it's done in VB, but I'm sure there's a way
Indeed there is
Dim myArray() as Object = new Object(3){}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
i think it would be much more easier if you wrote a class that holds the data and put cllas-instances into an ArrayList:
' The class that holds the data
class mydata
public StringValue as string
public IntValue as integer
public BoolValue as Boolean
end class
' Your Function Spot
Function Spot() As ArrayList
Dim ObjArray As New ArrayList()
Dim clsInstance1 As New mydata
Dim clsInstance2 As New mydata
With clsInstance1
.StringValue = "Hello World"
.IntValue = 69
.BoolValue = False
End With
With clsInstance2
.StringValue = "Hello Again"
.IntValue = 96
.BoolValue = True
End With
ObjArray.Add(clsInstance1)
ObjArray.Add(clsInstance2)
Return ObjArray
End Function
' in your Button-Click:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
Dim arrList as ArrayList = Spot()
MsgBox(arrList(1).IntValue.ToString())
End Sub
- walter
|
|
|
|
|
thanks Walter thats a great suggestions
cheers Dom
|
|
|
|
|
Hi
I am using getresponestream function to get a stream and read from it
but I need to seek.
what can I do?
Please help me.
thanks.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
You could try creating a FileStream based on the Stream returned.
However I don't think that will work because NetworkStreams are seekable.
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
I created an application and require the application to be launched from the “Windows Explorer” context menu. I created the context menu with the following code below “Sub AddToContextMenu”
I added the following code into “Sub Main” and “Sub New” (below). I set the start up object to sub main. The good news is that the application does launch from the context menu but it does not pass in the name of the file I want to open with my application.
Please Help.
Private Sub AddToContextMenu(ByVal V_Name As String, ByVal V_Path As String)
Dim regmenu As RegistryKey = Nothing
Dim regcmd As RegistryKey = Nothing
Try
regmenu = Registry.ClassesRoot.CreateSubKey(MenuName)
If Not regmenu Is Nothing Then
regmenu.SetValue("", V_Name)
regcmd = Registry.ClassesRoot.CreateSubKey(Command)
End If
If Not regcmd Is Nothing Then
regcmd.SetValue("", V_Path)
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
#Region "Startup Application"
'The main entry point for the application.
<stathread()> Public Shared Sub Main(ByVal Args() As String)
Dim str_In As String = vbNullString
Try
str_In = Args(0).ToString
Catch ex As Exception
str_In = vbNullString
str_In = "C:\Temp\Error.xls"
End Try
Application.Run(New frm_Main(str_In))
End Sub
Public Sub New(ByVal vals As String)
MyBase.New()
'This call is required by the Windows Forms Designer.
InitializeComponent()
If Not vals = vbNullString Then
Dim frmFileAdd As New frm_FileAdd(vals)
Try
frmFileAdd.ShowDialog()
Catch ex As Exception
End Try
End If
End Sub
#End Region
Veghead
|
|
|
|
|
hai
iam working with vb.net2005 and sql2005
iam getting data from my database with support of dataset
but when i tried to enter new data through programe the data is updating the dataset but not the dataset
here iam my working logic here please follow and guide me what is worng in it
dim cn as new sqlconnection=("connection string")
cn.open()
dim da as new sqldataadaper("select * from table1",cn)
dim comda as new sqlcommandbuilder(da)
dim ds as newdataset
da.fill(ds,"table1")
dim drow as datarow
drow = ds.tables("table1").newrow
drow.item(0) = textbox1.text
ds.("table1").rows.add(drow)
da.update(ds,"table1")
Somebody please help me in this matter
ramu
|
|
|
|
|
If you are using the designers then a component called a TableAdaptor should have been added to the form. (Or you can reference it in code) you need to use this class to update the data to the database.
I have no idea what I just said. But my intentions were sincere.
|
|
|
|