|
Thank you so much! Calling the EndEdit fixed it for me
|
|
|
|
|
i have an vc++ project i want to embed in vb.net how we can do this
any tutorials or examples
thank u
sree
|
|
|
|
|
I assume you are talking about managed vc++, if so, you'll need to take the code you want to embed, make a class library (.dll) out of it and reference the class library in the vb project...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi
For example :
Class Parent<br />
Private Class Child<br />
Inherits System.Windows.Forms.UserControl<br />
End Class<br />
End Class
VS designer doesn't work with class Child
Is there anyway to load designer for Child ?
|
|
|
|
|
No, I don't think so. Why would you want to embedd a user control class ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I need it is Private , Child is used by Parent only
|
|
|
|
|
The designer will not look for classes embedded in other classes.
You also cannot do what you want, because the designer can't get at the private class to create an instance of it. Your UserControl class must be made Pblic for it to work in the designer. You can try breaking it out into a seperate class (both of your classes in the same file) and tagging it a Friend, but I have my doubts on it working. This is because a Friend class is visible only to other code in the same assembly, not outside the assembly. I'm guessing this would preclude the designer from seeing the class.
|
|
|
|
|
Thank you very much , i have never known that "the designer can't get at the private class to create an instance of it"
Actually , i want child class can use private fields and methods of parent class
|
|
|
|
|
hi all
how can i convert c# code into vb.net 2005 code using vb.net 2005
is someone have any link ?
|
|
|
|
|
There are free converters on the web, a couple of articles on this site about doing it, and commercial converters also available.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: free converters on the web
What is the general quality of the converters that are free on the web?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
They're getting better, but they are just not practical for some uses:
- project conversions (these require reflecting on referenced assemblies for accurate conversion - this is never done by online converters).
- ASP.NET inline code (this requires an extra parsing step that is not performed by online converters).
- Allowing different conversion options, such as array specifier placement (online converter offer no such options).
- Some snippet conversion referencing certain .NET system types (these sometimes require reflection on common .NET system assemblies for a proper conversion).
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
C++ to VB Converter: converts C++ to VB
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
Cool, thanks for the info
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
|
|
The online converters can be useful, but they are not very accurate (there's no commercial incentive for them to keep them up to date, for instance). The commercial converters will have free demo or trial editions that will convert limited length snippets, but much more accurately than online converters.
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
C++ to VB Converter: converts C++ to VB
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
Hi I get the exception "Object not set to an instance of an object when the code below is run.
Private Sub Bt_OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bt_OK.Click
Me.ListBox1.Items.Clear()
Dim DBConn As OdbcConnection
Dim i As Integer
Dim AD As OdbcDataAdapter
For i = 0 To CarsNamesLBox.Items.Count - 1
If CarsNamesLBX.Items(i).Selected Then
DBConn = New OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=myServer;Database=CarCompaniesDB;User=myUser;Password=mypass;Option=3;")
AD = New OdbcDataAdapter("SELECT CarID, Model From CarsTB where Make = 'CarsNamesLBox.Items(i).Text'", DBConn)
End If
Next
If Not IsNothing(DBConn) Then
DBConn.Open()
Dim DT As New DataTable
AD.Fill(DT)
AD.Dispose()
Me.ListBox1.DataSource = DT
Me.ListBox1.DataTextField = "Model"
Me.ListBox1.DataValueField = "CarID"
End If
End Sub
The same exception was thrown when DBConn is empty, thus I used the If not IsNothing clause in the 2nd If statement to determine if that is the case. I thought I had solved that problem so now I don't know what could be causing this . The following is the source error that visual studio outputs .
Source Error:
Line 52: Dim AD As OdbcDataAdapter
Line 53: For i = 0 To CarsNamesLBox.Items.Count - 1
Line 54: If CarsNamesLBX.Items(i).Selected Then
Line 55: DBConn = New OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=myServer;Database=CarCompaniesDB;User=myUser;Password=mypass;Option=3;")
Line 56: AD = New OdbcDataAdapter("SELECT CarID, Model From CarsTB where Make = 'CarsNamesLBox.Items(i).Text'", DBConn)
Please help me resolve this, thank you in advance for your help.
-- modified at 1:48 Saturday 28th July, 2007
|
|
|
|
|
One would have to assume that CarsNameLBox, or CarsNamesLBox.Items is Nothing. There is a SelectedItem property, you can just use that ( be sure to check if it's Nothing first )
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Why are you instantiating inside the For loop? You shouldn't be instantiating DBConn everytime you cycle through the loop.
ASPnoob wrote: AD = New OdbcDataAdapter("SELECT CarID, Model From CarsTB where Make = 'CarsNamesLBox.Items(i).Text'", DBConn)
You have an error in your select statement, Make is not going to be whatever CarsNamesBox.Items[i].Text , but the actual string CarsNamesBox.Items[i].Text
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi Paul, I've removed AD = New OdbcDataAdapter("SELECT CarID, Model From CarsTB where Make = 'CarsNamesLB to the outside of the loop and placed it before the loop. I have also removed the apostrophe from the where clause, but the exception is still thrown. I think that it has to do with CarsNamesBox.Items being Nothing, but I don't know how to correct it. Please help me resolve this I have tried Christian's suggestion and it still does the same thing. I've run out of ideas, thanks for your help.
|
|
|
|
|
I am confused. You have CarsNamesLBX and CarsNamesLBox, and now CarsNamesBox. Which is it? Are you sure they are instantiated at some point and not disposed before getting to this code?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
LOL, sorry 'bout that, I had changed the name of the list box to conform to my naming convention. I should have made comments on the post about the changes. Have you figured out yet what is causing the exception to be thrown? I have used step-into, step-over, etc in debug mode but I can't figure out what the cause of the problem is. Thank you in advance for your time.
|
|
|
|
|
Honestly, if you're stepping through the code, and you can't work out what object does not have a value, then you should seriously re-evaluate this whole programming thing.
Something is set to Nothing, which means you've not given it a value. Work out what it is by checking the values of all the variables in use in the line that blows up. Stop saying things like 'I tried what Christian said and it didn't work'. What I said is correct, so if you can't make it work then post the code, so we can help you. You're iterating over the items collection, when there is a property that gives you what you want, the selected value. If the SelectedValue throws the same exception, then the control itself is probably null, but again, you have to step through the debugger and work that out.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ASPnoob wrote: For i = 0 To CarsNamesLBox.Items.Count - 1
ASPnoob wrote: SELECT CarID, Model From CarsTB where Make = 'CarsNamesLBox.Items(i).Text'",
Oh, I didn't even spot that ( I think the other poster did ).
SELECT CarID, Model From CarsTB where Make = '" & CarsNamesLBox.Items(i).Text & "'",
I am pretty sure this is what the code looked like when I first saw it, actually. If you further mangle your code, post it in a reply, not by editing the post. Change it to
SELECT CarID, Model From CarsTB where Make = '" & CarsNamesLBox.SelectedItem.Text & "'"
add a check to see if CarsNamesLBox.SelectedItem = Nothing, and get rid of the loop. That's what I told you to do in the first place. Beyond that, if you're getting this exception, you need to go into the debugger, set a breakpoint on the line, and type things like CarsNamesLBox and CarsNamesLBox.SelectedItem and CarsNamesLBox.SelectedItem.Text, until you find the property that has a value of Nothing, which is what is causing your error.
And, in future, be aware that things can be uninitialised, and write code that checks, so it can fail gracefully.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
This is related to the formatting, not the topic, of your message.
I am preparing an article on copying code snippets from a CodeProject message board to
Visual Studio; seems there are no problems when the browser used is FireFox, Safari, ...
but often problems arise when using Internet Explorer.
One of the factors is the tags that are present inside the < PRE> </PRE> block.
In your message the lines are separated by <br> tags; most other messages have
just regular newlines.
Could you please tell me how you get that, i.e. what tools you use, and how you go
about it. Thanks in advance.
|
|
|
|