Jump to content

DllCall and GUI


SlimShady
 Share

Recommended Posts

I was just wondering.

Can we add Windows controls in a GUI dialog?

Thinking about it... DllCall can run any function.

So we can create a GUI from scratch using Createwindow.

I know where I would bump into a problem: There are functions that need other info than numbers or strings, like "long", "byte", "pointer", "dword", etc.

Link to comment
Share on other sites

I hope thats not your only reason because if it is, thats a complete waste of time. There are technical limitations to the language that (rightly) prevent the sort of trickery necessary to acheive a satisfactory result. About the only solution is to literally write your own DLL and hard code read/write access points along with object factories for every type you wish to support.

For example, given the following structure (Fictional):

struct HoldData
{
    int a;
    // Other members
}

In order to wrap that, you would need to export the following from a DLL:

void Create_HoldData(void **out)
{
    *out = new HoldData;  
    // Must be a pointer, unsafe to pass objects across DLL/EXE line
}

void Destroy_HoldData(void *in)
{
    delete in;
}

int Get_a(void *in)
{
    return (HoldData*)in->a;
}

void Set_a(void *in, int _a)
{
    (HoldData*)in->a = _a;
}

// Other members

My casts may be off, ignore that, its concept code.

Basically, you'd have to create a function to create the object, one to destroy it, then any member you wish to read/write to would need wrapped in a function as well. You would then compile this into a DLL and then use DllCall() to create objects (Assuming Jon adds a place to store a void* in the Variant class).

Link to comment
Share on other sites

No, it's not my only reason. I aslo have a great many projects that just can't be done in VB because of the complexity in comparison to C++. Yes, I know c++ is complex but forcing VB to do something that it doesn't normally support is very taxing to the mind. I am learning C++ to be able to do things that I normally couldn't. If I happen to run up on a problem with autoit like this that nobody else seems interested in, I will also try to contribute.

Who else would I be?
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...