-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added .NET (VB & C#) Interfaces, C# Test, .NET reference guides, and … #10
base: master
Are you sure you want to change the base?
Conversation
….NET example projects
Man, your pull request have missing files in C# exemple... Can you help me with that? I need to generate a x64 version from this dll. |
I'm not sure why the example is so poor. That's all they had in the archive. The existing build is in the repo, c4dll.dll, which is used by myself and others in .NET works fantastic. The documentation is all there for C#/VB.NET which I have used with success. |
Can u help me, please? Because when I tried to import your dll in visual, I received a error; |
I can help you a bit if you provide me with an example and the error you're running into. The interface which you use in .NET is located at CodeBase-for-DBF/interfaces/CSharp/Codebase.cs They are NOT written by me. It is an official interface that was kindly provided to me by the folks that wrote CodeBase despite it now being legacy unsupported software. By the way, I'm just a programmer that uses Codebase. |
Image when I tried to add a reference to dll from your pull. When I tried to create Code4 cb = new Code4(): "Não é possível carregar a DLL 'c4dll.dll': Não foi possível encontrar o módulo especificado. (Exceção de HRESULT: 0x8007007E)" I throw the files in same level from my program.cs: Can you send me your dll? |
@phelipepalte you can’t add a direct reference to the dlls for codebase. They don’t have the correct interfaces to allow that and they’re not COM compatible. There is a code file you need to add that is the wrapper interface to codebase. I will look in my files for a c# one soon but an example of this is in VB.NET called codebase.vb which I’m sure can be converted with one of the online C# to VB.NET code converters. I’ll report back soon. |
When I try to open exemple proj, I'ts missing 2 files. Check above. |
Your links don’t appear to work for me. They all 404, possibly a privacy setting? |
Try this.. unfortunately, the project is missing 2 files in VB too |
Go to my fork of the repository in my profile and go to VB.NET folder. I’ve added it there. Still looking for my c# equivalent. |
I fixed the links. |
@trevster344 Thank you for your help. What version of Visual Studio you've using for this? |
I am on the latest version of Visual Studio. I actively develop in VB.NET using .Net Framework 4.8+ and .Net Core |
I see, so, you just copy the dlls to project level and call code4? |
Yes. |
Trying your fork.. |
Imports VB6 = Microsoft.VisualBasic.Compatibility.VB6 I having issue from this import, not found. You have VS 2005 too? I can't find how to install this |
You need to go to projects and add a reference to Microsoft.VisualBasic.Compatibility |
"Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only" |
This will get the project working but it doesn’t take much to convert the .vb not to use Microsoft.Visualbasic.Compatibility. Codebase does not come built for x64 and there are some who argue it isn’t truly x64 when you do compile it as such. I have an x64 build and while everything I have confirms it’s x64, I’ve not been able to get it to run yet. Do you have a working x64 build of codebase? On the topic of Microsoft.Visual Basic.compatibility, I’ve long since believed most of that .NET code file is just a working but poor conversion from the original VB6 codebase module. I’ll see about converting it and putting it on my repo. |
Man, I fixed the issue with import, but unfortunately I'm a C# programer.. =\ You have a exemple how call the Codebase?? (i tried CodeBase.d4open(1, "C:\folder\File.dbf"), but I get exception "An attempt was made to load a program with an incorrect format. (0x8007000B)") |
D4open will open a database file but it doesn’t initialize codebase. In Visual Basic you have to call code4init first. Call the equivalent for c#. I am not at my workstation yet so I can give more support yet. Soon however. |
That error usually means you are mixing bitnesses (32 and 64). There is no such thing as 64-bit VB6. You can have 64-bit VB.NET, but you mentioned VB6 above. For VB6, your application must remain 32-bit, even when the Windows itself is 64-bit. |
Good news, I finally got sucess to use the dll.. (how? I don't know..) I have installed so many things and work.. LOL Now, I need to learn how check if the dbf is ok or have errors.. Thank for all help. |
More than likely you’re not running x64 however. Who compiled codebase x64 prior to you? Or was it you? If you have the guides they tell you all you need to know. Be wary of code4error settings. |
I just use your dll and run in my environment. I don't know why.. LOL Running in x64 project. |
What is the name of the dll you have in your project directory? |
By the way @trevster344 I've got the official C# interface in my pull request and I would assume the same vb.net interface as you as well. |
Thanks! A lot easier to see from a desktop. Couldn't see it earlier but you're absolutely correct. I mostly just wanted to convey the library is best worked with from the wrapper. |
In case it helps others:
|
zlib was added later on in codebase's life and I believe there are some configuration options to utilize compression as storage-saving measure. I have been bitten by not having the zlib.dll dependency as well. |
….NET example projects
The VB.NET / CSharp interface with documentation and example code files. interfaces/CSharp/Codebase.cs or interfaces/CSharp/Codebase.cs are the key interface files needed to use it with .NET. There's is quite a bit of difference between the two.
This is the latest & official .NET stuff and is hugely useful if you're developing with codebase in .NET