Results 1 to 40 of 42

Thread: Create class for instantiation at runtime

Threaded View

  1. #1

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,918

    Create class for instantiation at runtime

    I'm really just spit-balling here, but this is something I'd use if I could do it.

    Is there a way to dynamically (at runtime) create a class that could then be used for instantiating objects?

    Sure, I know it'd be exceedingly difficult to compile code at runtime. However, I'm just thinking of an object that just has some simple properties, no real code.

    Said differently, I'm wondering if we can take a simple UDT and turn it into a class at runtime. It seems like we should be able to stick a standard IUnknown header on it (QueryInterface, AddRef, Release, and a RefCount somewhere) and create a class. Sure, it might take a bit of a thunk, but this doesn't seem huge, if it's nothing but simple properties.

    For this one, I'm not even exactly sure where to start. Or maybe it's a bigger project than I'm thinking.

    Thanks,
    Elroy
    Last edited by Elroy; Nov 21st, 2018 at 10:43 AM.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width