Jump to content
  • entries
    743
  • comments
    1924
  • views
    583678

I HATE THE WIN32 API

Sign in to follow this  
Aardvajk

213 views

Cut, Copy and Paste all working now on the map blocks, in Excel and Notepad compatible format like the Builder version. Using Win32 directly has solved the problem of knowing the size of the data on the clipboard since you just unlock a HGLOBAL handle, but still would behave strangely if you copied random text. Never mind.

Keyboard accelerators seem to be working as well and menu items are enabling and disabling at the right times. It seems you can't just set menu enablement anywhere you want but only inside of handling WM_INITMENUPOPUP. I'm not quite sure what the implications of enabling toolbar buttons would be but I'm not going to bother with a toolbar in Map 2.0 so I'll worry about that in the future.

So basically the actual map block editing part is finished now and as functional as the Builder version of Map. The next thing to add is the Item editing functionality.

This is going to involve learning how to do:

Check boxes - should be okay
Combo boxes - not too worried but suspect lots of ugly code
List views - I remember reading about these before and am very scared

The other thing I have no idea how to solve is the property editing. In the Builder version I just used a TStringGrid, which did all the work for me. I suspect I'm going to just have an text edit control and dump the properties in that like:

X=23
Y=24
Speed=100

and so on and just have the user edit that, then re-parse the text and reassign it to the item properties. The only way I can think to make it like the Builder version would be to custom draw a panel with DrawEdge and place dynamic edit controls without borders on a form, but then I'll have to implement the scrolling as well. We shall see.

I really should learn Windows Forms. I reckon I'm going to have a look at the Managed C++ version rather than C#.
Sign in to follow this  


5 Comments


Recommended Comments

Quote:
Original post by EasilyConfused
I really should learn Windows Forms. I reckon I'm going to have a look at the Managed C++ version rather than C#.


If you're going for Windows Forms, I say go with C#. C++/CLI -- DON'T USE MANAGED C++; the one that comes with VS.NET 2003! -- is more C++Builder-like, but it also ia laden with 'special' managed syntax that you'll likely never use again. C# is the industry-used managed language (I believe), so learning it has plenty of merits. Not to mention it's plain fun to use. :P

Share this comment


Link to comment
Guest Anonymous Poster

Posted

HopeDagger's right - if you're going to jump into Windows Forms and .NET stuff, you may as well use the language designed for it: C#. Otherwise you're not only trying to learn .NET and Windows Forms, but also all the kludgy stuff that they've had to put into Managed C++ to try to make it do the .NET stuff it really isn't designed to do.

C# with Windows Forms is a great way of building game-making tools, etc., in my opinion. C++ with Win32 API is good for solid application development - especially when the end-users don't want to have the .NET framework installed. MFC's not bad too, although it appears big and messy.

C++ will be better when proper OO function pointers are added to the standard.

Share this comment


Link to comment
Advice taken. I actually just got back from the library with a book about C# and it does look like the bees knees, but I'm also quite keen to continue the Win32 experiments.

As the AP points out, it is nice to not have to worry if an end-user has the right .NET on their machine. It's all quite ugly code but I reckon if I put the time in I could wrap it.

Share this comment


Link to comment
Win32 via P/Invoke isn't too much of a hassle, though I haven't tried mixing in controls and so on (I've stuck to using it for invisible tasks, such as MIDI).

This tool makes using your old favourite Win32 functions a doddle under C♯.

Share this comment


Link to comment
Win32 via P/Invoke isn't too much of a hassle, though I haven't tried mixing in controls and so on (I've stuck to using it for invisible tasks, such as MIDI).

This tool makes using your old favourite Win32 functions a doddle under C♯.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!