|
-
Aug 26th, 2024, 01:24 AM
#1
Thread Starter
Fanatic Member
Creating a tlb that contains only enums und structs
My VB6 app can not handle my enums and udts anymore, there are hundreds in my app, causing out of memory erros, that is why I need to use a tlb.
My attempts to create only a tlb without the app that uses it being dependend on the activex-exe or / activex-dll failed.
I need to create a tlb myself.
I tried midl, but it gets stuck at "RECT".
For those who are interested, the successfully compiling and the failing idls are attached. One can see that RECT3 works fine, but RECT does not.
Apart from this problem, I am afraid I will not be able to let VB6 create such a pure tlb.
May I ask if TB can do it, and if yes, can somebody share a sample that contains enums and structs?
Thank you very much!
This idl compiles fine:
Code:
// Generated .IDL file (by tws TypeLibMake)
//
// typelib filename: twsLib6.tlb
[
uuid(3F9F252A-FC23-4629-A880-581503938FD1),
version(1.03)
]
library twsLib6
{
[
uuid(777CC57A-8916-455B-A4BD-3947AA221934),
version(1.0)
]
typedef struct tagRECT3
{
long X;
long Y;
long Width;
long Height;
} RECT3;
};
This one fails with midl error 2026:
Code:
// Generated .IDL file (by tws TypeLibMake)
//
// typelib filename: twsLib6.tlb
[
uuid(3F9F252A-FC23-4629-A880-581503938FD1),
version(1.03)
]
library twsLib6
{
[
uuid(777CC57A-8916-455B-A4BD-3947AA221934),
version(1.0)
]
typedef struct tagRECT3
{
long X;
long Y;
long Width;
long Height;
} RECT3;
[
uuid(95116CA9-F776-4FAC-BCAB-36513F0932EC),
version(1.0)
]
typedef struct tagRECT
{
long Left;
long Top;
long Right;
long Bottom;
} RECT;
};
-
Aug 26th, 2024, 02:14 AM
#2
Re: Creating a tlb that contains only enums und structs
Support for making standalone type libraries is planned but not yet implemented. Of course,, twinBASIC imposes none of the artificial limitations of VB6 on number of code elements. If your project isn't working in tB, outside of internals hacks it's easy to replace, it's usually only one or a handful of bugs, and working to isolate and preferably make minimal reproductions would see them fixed fairly soon if blocking something from working entirely.
The best option assuming you're not planning on bringing the full project into tB, as previously mentioned, is mktyplib, a utility included with VB6. Between oleexp, OLEGuids, and The trick's various tlbs, it's not hard to find ready made examples of making typelibs.
Note that as written, your typelib will be subject to full activex registration requirements and will exhibit problems if you don't unregister before overwriting old versions. This is due to use of uuid-associated types. There's some uses, namely being able to avoid the 'only public types in public modules blah blah blah' error, but oleexp forgoes them for the ease of no registration headaches. Just the types and enums, no uuid or version attribute on them.
-
Aug 29th, 2024, 07:16 AM
#3
Re: Creating a tlb that contains only enums und structs
I just had too much coffee today but what about a mktyplib rewrite which understands TB interface/coclass syntax and produces TLBs in both bitnesses?
I’m so back to parsing would be great to try a first cut at this tool on my impending vacation next couple of weeks. Might end up with parser capable of groking VBx procedures declarations
-
Aug 30th, 2024, 07:52 AM
#4
Thread Starter
Fanatic Member
Re: Creating a tlb that contains only enums und structs
I am using mktypelib now, and the compiler errors are gone.
I have spent the last 14 days again and again with writing a tool that would convert my enums and udts to a tlb.
It has become a really nice code which is now able to point out any error that occurs by creating individual idls and seeing if they compile and if not, find out to which point it compiled fine, etc.
Once I finish it entirely with all culprit solved that I am still dealig with, I will post it here as it is really a handy tool.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|