|
Wot? No VB6 on the upcoming mSlate?
|
|
|
|
|
I do what I can to kill the Beast.
The vast amjority of my work is done in VB.NET. I still don't understand how people piss and moan about the lack of VB6 support when .NET has been out for 10 years now. In some places, getting rid of VB6 is like trying to kill a vampire with a rusty spork.
|
|
|
|
|
"If it ain't broke, don't fix it."
Bastard Programmer from Hell
|
|
|
|
|
I believe in fixing it before its "known break" date. If you know VB6 is gone and won't be supported on future versions of Windows, why are you continuing to write applications in it?
|
|
|
|
|
Good point, and one shouldn't.
Bastard Programmer from Hell
|
|
|
|
|
Hi everybody,
in my project I'm referencing a dll which I had to compile in C# myself (conversion wasn't possible since the referenced classes contain unsafe code). After facing funny error messages (see right below) I searched the net for hours and feel a bit unsecure if my problem has to do with any missing bits in my dll - e.g. wrong manifest entries etc.?
What I see in VB (Express 2008) is:
- the compiled dll is referenced without any errors (i.e. the framework version etc. seem to be fine)
- double-clicking it in the project explorer leads me to the object browser, where I see all the included classes with their methods etc.
- the referencing vb project seems error free, i.e. the referenced dll seems to be working properly
The funny error stays: When debugging, the code stops with the first line of the main form's designer with a "Module not found" error (unfortunately not saying which...).
My major question for now would be: Are the a.m. facts enough to be sure my c#-dll isn't responsible for that? Or: How can I make sure?
Thank you
Mick
|
|
|
|
|
I suggest you create a little C# EXE project, which also references said DLL, and mimicks the start-up of your VB.NET code.
FWIW: make sure all projects (EXE and DLL) refer to the same .NET version, you can't mix and match in general, some combinations could work (such as 3.5 and 2.0; bowever 4.0 and 2.0 would not). That is true even when using a single language.
|
|
|
|
|
This was a VERY good idea, Luc - I have to admit that sometimes I don't think of the obvious
So here's what I did and the results:
- took a given c# sample (which contained the unsafe code that I had extracted to a dll)
- deleted all these classes
- replaced them with the reference to the dll
RESULT: The C# program runs just like it's supposed to! So I figure the dll is ok, right?
Then I converted this modified project to VB.NET (using latest SharpDevelop 4.1)... No error messages regarding the conversion. But: Starting the VB project --> RESULT: The same error!
Unfortunately the compiler refuses telling me WHICH module it's missing, so I still have no clue about that. Would you know a way how to find that out?
|
|
|
|
|
There are a few subtle differences between C# and VB; I'm not sure if any of these would cause the error you see, but I'll throw them out there for you to look at:
1. VB does not support unsigned integers; if a C# DLL has any public methods/properties which take/return uint's, the DLL will not function properly when referenced from VB code.
2. C# and VB vary in their usage of indexers; I'm not 100% clear on the difference, but I seem to recall VB treating them internally as a property called Item. So I suppose if you have an actual property called Item in a C# class, that could throw VB off, into thinking it's an indexer or something...
3. VB supports some sort of XML-literal syntax; I've never used it so I'm not all that familiar with it, and since you're trying to reference C# code from VB, not the other way around, this probably isn't an issue, but I'll mention it nonetheless just in case...
edit: also, one more thing... there are some special namespaces Microsoft.VisualBasic and Microsoft.CSharp with language-specific utilities; I'm not sure if it's legal to reference one of those from the "opposite" language, but it might be worth looking into...
|
|
|
|
|
Thank's for your thoughts, ekolis! I think I took care of the differences you mentioned, as well as deleting the root namespace in VB (obviously VB adds the dll's namespace) which the conversion didn't care of. The UInteger issue btw seems older information or at least not completly true - I checked that and can surely define a 'UInteger' type variable in VB.
The funny thing is: My code starts with calling the 'MainForm' - but doesn't even reach the "Sub New" in this MainForm when I step through it. I wish I could find out what throws the 'FileNotFoundException' (just saying 'module not found' without it's name or path)...
|
|
|
|
|
Here is another suggestion: turn your VB.NET WinForms app into a Console app so you can control its start-up; more specifically:
1. in solution pane, right-click the project, then "Add a Module", default filename would be Module1.vb
2. in that file, stuff this (assuming your main form is called Form1):
Module Module1
Sub Main()
Try
Application.run(New Form1)
Catch ex As Exception
Console.WriteLine(ex.ToString)
End Try
Console.WriteLine("hit any key to finish...")
Console.ReadKey()
End Sub
End Module
3. in solution pane, click project/Properties, set app type to "Console Application" and startup object to "Module1"
4. Now build, run, and watch what shows in the Console window. Hopefully the full diagnosis will be there.
|
|
|
|
|
Wow - Luc, this approach seems to give me the key! After follwoing your advice, my error code is much more specific in the console window (translation): "System.Resources.MissingManifestResourceException: ... no resources for the culture found ..." etc.
Following that hint, I see that the form's .resx file is missing in the VB-converted project (actually that's the case with every form...). I don't yet know how to add the missing resources, but I'm highly motivated to get over this thing soon - and hopefully find that at least I wasn't to blame for messing up the dll
Thank you very much for your support
|
|
|
|
|
you're welcome.
I can't help much with resource files, as I avoid them as much as I can... Good luck with them!
|
|
|
|
|
How about write a C# app to test if the C# DLL works first?
|
|
|
|
|
Hi everybody,
I've been running into something where I have no idea how to debug: A FileNotFoundException right at the beginning of the main form creation. :
"Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E)"
Translation: "The module could not be found (Exception of HRESULT: 0x8007007E)" The stack trace message starts with:
"bei Tesseract.OCR.AppEntry.MainForm..ctor()"
Following the 'ctor' hint I see my very simple constructor:
Public Sub New()
InitializeComponent()
Initialize()
End Sub Stepping through, it doesn't even reach the "InitializeComponent" command. It have the feeling there's something wrong in the Form Designer module (which I had to edit). Starting with the form itself (not the 'program' class) I find the error marker in the very first line of "Mainform.Designer.vb" ('Partial Class MainForm').
Could someone please give me an idea where to look or how to start debugging at that stage?
Thank you
Mick
modified 11-Oct-11 6:12am.
|
|
|
|
|
Maybe translating your messages into English would help.
|
|
|
|
|
We shall see if that really was the hard part And btw I hope your signature wasn't part of you answer, was it? To be honest I wouldn't want my computer build my character
|
|
|
|
|
I am not sure about the specifics of your problem but a quick Google search of the error code results in this[^].
|
|
|
|
|
Thank you, Richard. I did that, but as you see there are millions of possibilities with thousands of different backgrounds. I have a clue which is connected with a dll reference - but I guess this will have to be a different thread.
|
|
|
|
|
I know that I have seen many hits on folders in the new .net FTP classes.
I need to rename/move a file to a different folder after downloading.
When I log into the customer's FTP site via the url, user, password it put in into a particular folder.
I can download these files using the URI but I cannot Rename (Move) into a different folder (i.e. DONE). I get a
The remote server returned an error: (550) File unavailable (e.g., file not found, no access
using the FTP Class and FTPClient.
Please tell me how this can be done without using 3rd party software.
The issue seems to be sending the URI out with
ftp://nnn.nnn.nnn.nnn/x.txt
when in fact we are in a folder based on the user ID home folder.
i.e. ftp://nnn.nnn.nnn.nnn/user/x.txt
Just don't know how to get around this.
Please help.
|
|
|
|
|
I'm using VB2008 with MS Access Database.
I make connection with DB by using the automatically way (by add a new data source ....)
I create the Sql in "SELECT id, na, num FROM Table1" by add query to Table1TableAdapter, and add this code in form to call the sql :
Me.Table1TableAdapter.Fill(Me.AcddDataSet.Table1)
And it succeed with me
I tried same way with insert data to DB like this
INSERT INTO Table1(num) VALUES (?)
And in form
Me.Table1TableAdapter.InsertQueryX(900)
It show the new data after run the program , but didn't save it to the DB Access
How to fix this problem
|
|
|
|
|
Did you set the attribute
GenerateDBDirectMethods = true
in your case:
Table1TableAdapter.GenerateDBDirectMethods = true
I think the attribute explains itself, but is normally set to true by default.
|
|
|
|
|
Hello !
i have a vb.net app , and i need to import data from excel sheet to sql server ( i'm using entity framework 4)
I need to specify column and row range from which i want to read.For example from columns E to G and from rows 5 to 20.
Is possible to do that ?
thank you.
|
|
|
|
|
|
This may help too[^]
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|