|
Sorry!!!!
I forget this is
VB.Net Code
|
|
|
|
|
|
Michael Sync
Sorry !!!Please forgive me.
This is my mistake of your annoyance.
Because ,I did not see your answer at .NetFrameWork Boards.
So i make my second time of my question at VB/VB.Net Boards.
Now ,i see your answer at .NetFramework board.
So,Please forgive me again.
THANKS FOR YOUR ANSWER!!!
Now i can resolve my problem.
Sorry!!!
|
|
|
|
|
Meenge,
What Michael has been saying is:
Dim udtCustom() As CUSTOM_EXPORT '<< executing this lines does not actually create any instances of the array. You must specify a size by putting a number between the (). When you do that, now you can use that instance.
Dim udtCustom(1) As CUSTOM_EXPORT '<< now 0 and 1 (because the array is zero based) instances are available for accessing.
---------
Your other problem is the arrays within you structure. Creating instances of your structure does not create any instances of the arrays within. If you notice, in your original post, the () are empty. So once again the variable is created but equal to nothing or has a length of zero (depending on the type of object). So you have to create the instances for those arrays as well by specifying a size. You can do that either at the point of DIMming your variables or using Redim to allocate after DIMming. Michael has chosen to call a routine within the structure to set those sizes. You can either hardcode the size within the () or call a routine or set them outside the structure ex: ReDim udtCustom(1).List(5)
Hope this helps...
Nathan
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
|
|
|
|
|
nlarson11
THANKS A LOT FOR YOUR ANSWER AND KINDNESS!!!!!!!!
Your answer can resolve my problem.My problem is everything OK because of you.Now ,you see my happiness.
|
|
|
|
|
Don't cross post. It's just plain rude.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
How to retrieve a record set from XML file, I want to use data from XML file to add to a drop down combo box for user selection.
Saseendran Kombath
|
|
|
|
|
You can use some XML reader or DataSet.ReadXml().
|
|
|
|
|
Can help with some sample code in vb.net?
Saseendran Kombath
|
|
|
|
|
You can google "VB.NET how to read XML file" or "DataSet.ReadXml()" ..
|
|
|
|
|
I'm using the AppActivate function to bring an application to focus. This function works if the application has not been minimised. If it is minimised, AppActivate function won't bring the specified application to focus.
Thanks
Graeme G
I am always greteful for any help!
|
|
|
|
|
Hello
I want to make a chat program used to talk between 2 computers connected by LAN.
But I couldn't, I made a good one in VB6 using WinSock.
But in VB.NET, it isn't the same.
So can anybody give me a sample, or at least tell how to do it?
Thanks
modified on Sunday, December 16, 2007 6:44:02 PM
|
|
|
|
|
There are plenty of those around (.net remoting chat etc.) - just search for "chat" here
|
|
|
|
|
I searched and looked around, but I got nothing what I need.
Can you help me more please?
|
|
|
|
|
look here[^]">
for example
|
|
|
|
|
The sample you gave me is a VC.NET project.
I don't have VC.NET, but only VB.NET, so I couldn't open it.
What should I do?
Thanks
|
|
|
|
|
I want to manipulate a simple program from my VB - I need to insert s short text in a field and activate a button in the program. Is anyone know how to do that? Thanks, Ronny
|
|
|
|
|
Depends on what the other program is. No matter what, you'd be better off in C++, but with p/invoke you may be able to do it
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 have been able to do some successful outlook automation using VB.Net and create a new mail message with the address, subject, and body filled out as below:
Dim app As Outlook.Application = New Outlook.Application
Dim appNameSpace As Outlook._NameSpace
Dim memo As Outlook.MailItem
appNameSpace = app.GetNamespace("MAPI")
appNameSpace.Logon(Nothing, Nothing, False, False)
memo = app.CreateItem(Outlook.OlItemType.olMailItem)
memo.To = "sample@gmail.com"
memo.Subject = "Reminder"
memo.Body = sampletext
memo.Display()
What I would like to next is highlight all the body text and do a find and replace on some words in the text. I haven't been able to make enough sense of the macro recorder on outlook to successfully do this, though. It looks like the way to do this in VBA is:
Selection.WholeStory
memo.Selection.Find.Text = "original_text"
memo.Selection.Find.Replacement.Text = "replacement_text"
memo.Selection.Find.Execute(Replace:=wdReplaceAll)
However, I am having a hard time doing this in VB.Net. I feel like I'm must be missing something really easy. I have done this before using MS Word automation with no troubles. Can anyone steer me in the right direction? Thanks!
Craig
"That rug really tied the room together."
modified on Tuesday, December 11, 2007 12:09:48 PM
|
|
|
|
|
|
Here is my problem...I have the following class:
Public Class Login 'in Database_Class library
Public m_User As String
Public m_Password As String
Public Sub New()
End Sub
Public Property UserName() As String
Get
Return m_User
End Get
Set(ByVal value As String)
m_User = value
End Set
End Property
Public Property Password() As String
Get
Return m_Password
End Get
Set(ByVal value As String)
m_Password = value
End Set
End Property
End Class
This class is going to hold login information...I have a form that a user will enter in the user name and password.
My question is this. I am trying to connect to a database using a connection string (which works). I dont want to provide my username and password directly into the connection string so I decided to set up a class for my login info so i can use a login form. I want to append the user name and password into the connection string and it doesnt work. I have the following in my connection class...
Imports Database_Class 'The class library that contains the Login Class
Imports System.Data.oracleClient
Public Class Connection
Public Shared Function GetConnection() As OracleConnection
Dim connectionString As String = "Data Source = PIDBDEV; User ID= " & UserName & ";Password = " & Password & " ;Unicode = True;"
Return New OracleConnection(connectionString) Return New OracleConnection(connectionString)
End Function
so what am I doing wrong? How do you access the values contained in a property contained in a class library in another class??
Erica
|
|
|
|
|
You pass the instance of your Login class to this method so it can use the information inside it to create the connection string.
Also, change the m_User and m_Password fields to Private, not Public. You're aslready exposing the fields as public Properties so you don't need to expose them twice.
Imports Database_Class
Imports System.Data.oracleClient
Public Class Connection
Public Shared Function GetConnection(ByVal credentials As Login) As OracleConnection
Dim connectionString As String = _
String.Format("Data Source = PIDBDEV; User ID={0};Password = {1};Unicode = True;", _
credentials.UserName, credentials.Password)
Return New OracleConnection(connectionString) Return New OracleConnection(connectionString)
End Function
|
|
|
|
|
wow thanks dave...the only thing is now when I am creating a new instance of the connection how do I pass the credentials to the function?
This is how i was doing it when I had the userID and password hardcoded into the connection string...
Dim newConnection As OracleConnection = Connection.GetConnection
this doesnt work:
Dim newConnection As OracleConnection = Connection.GetConnection(credentials as login)
i am trying to understand how to use properties...you have been a great help with the last issue.
Erica
|
|
|
|
|
OK, I would seriously suggest picking up a book on VB.NET and working through it. What your asking is a basic concept you find covered in any beginners book.
You have to create an instance of the Login class, fill in the properties, then pass it to the GetConnection method:
Dim myLoginData As New Login
myLoginData.User = "username"
myLoginData.Password = "password"
Dim conn As OracleConnection = Connection.GetConnection(myLoginData)
|
|
|
|
|
Hi guys,
I added icons to an imagelist which i then associated with a treeview control. The original icons have a transparent background and are of relatively good quality pictures, however when i run my system, they look very grainy at the edges and have a blue border around them when they appear in the treeview at runtime. i used the original icon size (16X16) and a color depth of 32bits. Is there something else about this control and icons or maybe is it haunted?
Thanks a lot for your assistance.
Regards
|
|
|
|