Author Topic: Database.ocx  (Read 14684 times)

0 Members and 1 Guest are viewing this topic.

Offline mikeownage

  • Newbie
  • *
  • Posts: 7
  • I'm new here!
    • View Profile
Database.ocx
« on: September 30, 2007, 05:49:04 pm »
it's a battle.net database control. loads the database, saves the database, checks for basic commands and such.

http://www.clangdn.com/mike/dbOCX.rar

i will still add some more things to it! but i guess this is the first version Smiley

any ideas on how to improve what i have done so far?

 tested the code (in a simulated environment).

I am not asking for you to use it or if you think it's a good idea. I am asking for ways to make this "IDEA" better. not if it's valid to your stand points. why do i write a control to do this? because i don't ever want to have to write anything related to it again in the future for any of my projects. I released it here so other people could use it as well if they wished.

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Database.ocx
« Reply #1 on: October 01, 2007, 12:42:13 am »
why do i write a control to do this? because i don't ever want to have to write anything related to it again in the future for any of my projects.

For the record, that's got to be one of the most horrible reasons. I don't mean to insult you personally, but making OCX requirements for that kind of functionality is poor programming. You've got part of the idea right in making your code reusable, but writing a Class to use the code and copy+pasting it to each of your projects is a better idea, thus keeping the code internal, instead of in a dependency. I'm not sure how it would work for efficiency, but I can only assume it'd improve.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
Re: Database.ocx
« Reply #2 on: October 01, 2007, 03:06:46 am »
I already said this on the VL forums, but I might as well bring it up here as well: that argument doesn't hold much ground, Joe. I'm not saying it's a great approach, but depending on an OCX is roughly as boggy-downy as depending on a DLL (because OCX files are special cases of DLL files); it ultimately boils down to assembly calling other assembly, and there's nothing inherently inefficient about that. Sure, it degrades the optimizer's ability to do things like inline short functions, but come on, we're talking about VB here. You're better off spending your time finding and optimizing your O(n-squared) algorithms.

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!

Offline mikeownage

  • Newbie
  • *
  • Posts: 7
  • I'm new here!
    • View Profile
Re: Database.ocx
« Reply #3 on: October 01, 2007, 06:32:27 am »
Wow, do people have a problem with staying on topic? I asked for ideas to improve the code. not if the concept of the code was to your liking. the only one who gave any tips on 3 different forums was camel. and i thank you :)
« Last Edit: October 01, 2007, 06:35:33 am by mikeownage »

Offline mikeownage

  • Newbie
  • *
  • Posts: 7
  • I'm new here!
    • View Profile
Re: Database.ocx
« Reply #4 on: October 01, 2007, 06:36:43 am »
umm, crap stupid double post! well added basic winamp control.
« Last Edit: October 01, 2007, 08:46:04 am by mikeownage »

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: Database.ocx
« Reply #5 on: October 01, 2007, 09:12:58 am »
My point, iago, (and it's already come true) is that he's going to get the same feedback here as he did at vL.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Database.ocx
« Reply #6 on: October 01, 2007, 09:36:59 am »
My point, iago, (and it's already come true) is that he's going to get the same feedback here as he did at vL.
The vL thread turned into a bunch of crap, so I'll try to keep this one cleaner. :P

Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
Re: Database.ocx
« Reply #7 on: October 01, 2007, 11:36:10 am »
why do i write a control to do this? because i don't ever want to have to write anything related to it again in the future for any of my projects.

For the record, that's got to be one of the most horrible reasons. I don't mean to insult you personally, but making OCX requirements for that kind of functionality is poor programming.

Sometimes you just have to wonder where, and how people learned to program. The OCX is for exactly the reason that he stated.
http://www.chyea.org/ - web based markup debugger

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Database.ocx
« Reply #8 on: October 01, 2007, 12:04:36 pm »
Wow, do people have a problem with staying on topic? I asked for ideas to improve the code. not if the concept of the code was to your liking.

I just told you how to improve your code. If you're that ignorant, I'll waste my time elsewhere.

For the record, that's got to be one of the most horrible reasons. I don't mean to insult you personally, but making OCX requirements for that kind of functionality is poor programming.

Sometimes you just have to wonder where, and how people learned to program. The OCX is for exactly the reason that he stated.

Yes, but for example, when I wrote my classes for manipulating RichTextBoxes, I could have exported them into a C# DLL. However, I elected to remove the extra DLL dependency and put them right inside my program, where I could simply import that class itself into a new program. As for an OCX, you have an extra dependency floating around.
« Last Edit: October 01, 2007, 07:16:39 pm by Joe[x86] »
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
Re: Database.ocx
« Reply #9 on: October 01, 2007, 02:42:41 pm »
@Joe: You're not wrong, but consider this: Every time you use a built-in control in VB, you're importing that control out of a windows DLL similarly to the way OCX controls work. Even the winsock control (which I'd go out on a limb and say that 99% of people use in favor over raw api calls) is in an OCX.

If you were writing an application suite, and a lot of your code was re-used throughout, wouldn't you want to have one place that the code was imported from? It cuts down on the number of places you have to update when you find a bug in it, and it cuts down on the disk space used to store the application suite. If you fix a bug, it means you only have to re-distribute one file instead to ten.

There are cases where the strategy is an inappropriate solution, but this is not one of them!

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!

Offline Warrior

  • supreme mac daddy of trolls
  • Hero Member
  • *****
  • Posts: 7503
  • One for a Dime two for a Quarter!
    • View Profile
Re: Database.ocx
« Reply #10 on: October 01, 2007, 09:47:58 pm »
This needs to be looked at in the context to which it's being applied.
There is never a golden rule of when/where to reuse code, it's all about what you're doing in the project overall which is the deciding factor.

I think it's really great you're into code reuse, it's a nice mindset to get in. Perhaps you can invest your time into a more powerful language (you know I mean C#)
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling

Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
Re: Database.ocx
« Reply #11 on: October 02, 2007, 01:47:29 am »
C# is cool, but I like Java because it's so portable. Its greatest benefit is what some consider it's greatest flaw. If you actually benchmark it, you might be surprised how slow it isn't.

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!

Offline Warrior

  • supreme mac daddy of trolls
  • Hero Member
  • *****
  • Posts: 7503
  • One for a Dime two for a Quarter!
    • View Profile
Re: Database.ocx
« Reply #12 on: October 02, 2007, 05:07:46 am »
C# is cool, but I like Java because it's so portable. Its greatest benefit is what some consider it's greatest flaw. If you actually benchmark it, you might be surprised how slow it isn't.

C# and the .NET Framework are just as portable as Java, considering that both of the specifications have been released (and C# is an EMCA Standard)

Mono reimplements C# and the .NET Framework pretty well.
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling

Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
Re: Database.ocx
« Reply #13 on: October 02, 2007, 05:13:19 am »
Warrior: my battle.net bot works flawlessly on my phone. Don't feed me that crap.

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!

Offline Warrior

  • supreme mac daddy of trolls
  • Hero Member
  • *****
  • Posts: 7503
  • One for a Dime two for a Quarter!
    • View Profile
Re: Database.ocx
« Reply #14 on: October 02, 2007, 05:17:07 am »
Warrior: my battle.net bot works flawlessly on my phone. Don't feed me that crap.

And? You're mistaking the fact that something is NOT implemented with it being impossible to implement.
Ever hear of the .NET Compact Framework? Ever hear of XNA and Programming on the XBox 360? Mono? DotGnu?
Silverlight? Moonlight?

Silverlight 1.1 uses a portable .NET CLR and works on Mac, Windows, and with Moonlight it works on Linux.

How much more portability do you want?
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling