March 28, 2024, 08:34:35 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


IWGrid New Wish Item (Not actually a list yet)

Started by DennisL, October 21, 2014, 07:35:34 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DennisL

October 21, 2014, 07:35:34 AM Last Edit: October 21, 2014, 07:37:09 AM by DennisL
Hi Larry,  I have been following the development of this control with great interest and expectations.
Looking through the associated help file has given me more hope as it all looks like it's coming along wonderfully with lots of options and possibilities.
The 1 major wish I have is if this project could be expanded upon to include a stand-alone DLL that may be used by other programming languages that can call std c functions?  I know this was originally planned to be specifically for IWB+, but this would be a good addition to the generally available controls/libraries out there.
Anyway, that's my wish item for this.  Hope you'll at least think this possibility over.
Cheers, Dennis.

LarryMc

So, since I don't know 'C', what does the subroutines need to look like to do what you want?
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

DennisL

October 21, 2014, 06:51:04 PM #2 Last Edit: October 21, 2014, 07:14:09 PM by DennisL
Hi Larry,
Since your control is based on the win32api (as you mentioned that it requires the windowssdk.inc file to compile), I don't believe that you need to change your functions at all, but to just build them into a DLL (dynamic linked library) file that exports those functions to be able to be linked and called externally instead of just LIB (statically linked library) file that is built into the executable.  e.g. for one of your examples:

   IWG_Create(win, "", 20,30,500,400, ID_GRID1)

This will remain the same and would be able to be called from another language most likely as:

   call dll("IWGrid.dll", "IWG_Create", win, "",20,30,500,400, ID_GRID1)

With all your constants defined in the header (which I can't see) and inc file available.

Not sure if it applies to how you built your control, but please have a look at the following (first Googled result of "lib to dll"):
http://stackoverflow.com/questions/2384932/converting-static-link-library-to-dynamic-dll

Edit: After reading a little more on the subject from Google searches, some articles suggest that .lib files are sort of stubs for.dll files and  that they should come in pairs already - not sure if this is true for you.  Other articles suggest that you just have to change the build type and provide the extra declarations as indicated in my linked article above.  Not sure what is correct, but an confident that you'll be able to sort this out as you have much more experience building controls and libraries than I do. :)

Cheers.

LarryMc

OK, gotcha.  I'll gitter-done in the next day or two.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

Might have spoken to soon.
I just thought about the fact that all my functions pass the parent WINDOW  as a parameter and WINDOW is a udt.

I'll have to search both the old and new forums to see if anyone else has specifically addressed this before.

And I already had things setup in different folders to create a plain dll and a dll that uses the CDECL calling convention.

If I cn get that part figure out then creating the dlls is easy.

But even then I'll need help.  I can supply how all the external constants and exported functions in IWB syntax but someone else will have to convert that to the syntax normally found in a header '.h' file.

So, give me some time.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

BTW Dennis,
If I get it built are you going to be able to test it for me?
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

DennisL

Sure, I would be happy to test it out for you (it would help me out as well). :)

Note: in my example the win variable was assumed to be a normal windows handle (long), not sure how/why you've used a udt  ???

LarryMc

Quote from: DennisL on October 21, 2014, 11:05:25 PM

Note: in my example the win variable was assumed to be a normal windows handle (long), not sure how/why you've used a udt  ???
Because he windows in IWBASIC are based upon the IWB WINDOW udt just as IWB;s dialogs are based upon the IWB DIALOG udt.

For windows the WINDOW udt has elements that facilitate doublebuffering of graphics, handling the client frame in a MDI frame and such.

In the WINDOW udt the first element is the handle hwnd that the operating returns when it creates the window.

There are some IWBasic command that allow you to enter the WINDOW udt or the hwnd for the window.  I'll probably have to code all my exported subroutines the same way so that with the c dll could use hwnd for the parent window.

We'll see. At noon I'm having a gall bladder test to see if I need surgery and the next day I'm having a ct scan of my brain to see if they can determine if I had a stroke or if it is diabetes messing up the nerves in my brain because my eyes and balance are haywire.  I've yet to get he appointment with a neurologists to see if I'm getting Parkinson's disease and with an eye doctor to also see about what is going on with my eyes.

So, I work on this when I can since I have benefitted from your postings in he past.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

DennisL

WOW! hope everything comes back with negative (good) results. Good Luck!

No problem -take your time; and I appreciate your (unexpected) last comment.  Just post again when you have anything - I've set it to send me an email when new posts arrive, so that's fine.

billhsln

I hope all your medical tests come back negative.

Bill
When all else fails, get a bigger hammer.