|
-
Oct 30th, 2001, 10:57 AM
#1
Thread Starter
PowerPoster
API Equivalent to CallByName
1. Is there an API equivalent to CallByName in VB6? If so, what is it?
Thanks
David
-
Oct 30th, 2001, 11:13 AM
#2
You can call LoadLibrary then a series of other functions to call a function from a variable name.
Example code:
http://www.allapi.net/apilist/exampl...ll%20Procedure
-
Oct 30th, 2001, 11:36 AM
#3
Thread Starter
PowerPoster
Thanks Jim, have AllAPI so will check.
One other question if I may as trying to do something I've only seen once and not sure how they accomplished the coding.
The program I saw did the following:
1. The end user used an editor to name and create functions independent of the compiled APP.
2. Upon saving, the function was then put into a listbox of functions which were available to the end user for selection.
3. The user could select any function and it would run in the compiled App.
CallByName (or API equivalent) must have been used as function name was not know at time App was compiled. Only way I can think of to call a function listed in a listbox that is unknown at time of compilation?
The issue as I see it is how to get the function compiled so that the APP can use it, unless they used some kind of scripting language.
Any thoughts would be appreciated.
David
-
Oct 30th, 2001, 12:20 PM
#4
The editor must be OLE compatible. Otherwise you could not do what you described (as I understood it), because there would be no way to access the macros the editor created. I'm assuming those macros or apps run in the context of the editor, not as standalone applications.
The process is OLE Automation. Most MS products support it. So do products from other vendors.
From another app, you use SendMessage api to read the listbox, then GetObject("theEditor"), and then call the macros. You'll need to get documentation on the editor App itself or use OLEVIEW to figure out methods and properties.
-
Oct 30th, 2001, 12:39 PM
#5
Thread Starter
PowerPoster
Jim:
That's a good question as to whether they run in the context of the editor or not. Based on what I saw, the answer is NOT.
The editor was only used to create the App. When it was initially saved it was saved in ASCII. Then it was verified (parsed) and
saved with a different extension (.TOK). My guess was this stood for tokens. Whether the editor was called or some form of reader to read the macro when executed I'm not sure.
Not familiar with OLEVIEW so will do my homework.
Any other input or if you know of some books / example code on how to address this issue would be appreciated.
Thanks
David
-
Oct 30th, 2001, 01:19 PM
#6
There's a good chapter about Automation in VB COM from Wrox Press. It's only for VB programmers.
The MSDN disk you got with VB also has automation examples.
If the editor createws tokens, then it definitely is processing the commands internally. Tokenizing data and user input is a standard way to write an interpreter. I know because I've written them. Interpreters require compiled code to make a token file do anything like work - in this case your editor.
What editor is this anyway?
-
Oct 30th, 2001, 02:39 PM
#7
Thread Starter
PowerPoster
Thanks for input, looks like I have some learning ahead. Undertook this as thought I would learn something new.
I saw this editor in a program called "TradeStation" by
Omega Research.
Have written edit parsing programs before but never an interpreter that would compile code. Any books/suggestions/examples in this area to get me started?
-
Oct 30th, 2001, 02:58 PM
#8
Most of them are for C/C++.
I don't think it's easy to that in VB - not impossible, just painful.
No suggestions.
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
|