[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: Visual C++ 2008 Express simple DLL sample file?



PureBytes Links

Trading Reference Links

Tomasz,

It might be easier for someone to study the DLL source as an example  
if I attached the zip of the complete set of files ready to open  
project in Visual C++ 2008 Express.  However, on close examination I  
see that some of those files which came from the "Sample" in the ADK  
have your copyright on them, so I think I would need your permission  
to post it to the UKB.  What do you think about this?

Best regards,
Dennis


On Apr 30, 2008, at 5:51 PM, Tomasz Janeczko wrote:

> Dennis,
>
> Great to hear that. I guess that there will be lots of people  
> waiting for
> your UKB article and the DLL. Please include the source (as  
> attachment) to UKB article,
> so others can learn "by example".
> Your contributions are appreciated very much.
>
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message -----
> From: "Dennis Brown" <see3d@xxxxxxxxxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Wednesday, April 30, 2008 11:22 PM
> Subject: Re: [amibroker] Re: Visual C++ 2008 Express simple DLL  
> sample file?
>
>
>> Tomasz,
>>
>> This final note (famous last words) is to let you know that I have
>> succeeded in making a DLL that gets rid of AutoIt in my Example
>> Flexible Parameters program.  In addition, I added the state of the
>> modifier keys (shift, alt, control) to my general mouse button  
>> states.
>>
>> Everything turned out to be "reasonably" easy except one thing --the
>> original problem.  It took me two days of research and  
>> experimentation
>> to finally make that work.  I turns out that even though it was easy
>> to save and restore to position of the scroll bar, the data items in
>> the window are not affected (they are not internally coupled to the
>> scroll bar position so do not scroll with it).  I did a lot of
>> searching on this problem and found that it was a problem that
>> exasperated many others, and the solution details varied by  
>> person.  I
>> tried the various solutions suggested without success.  Finally
>> through "trial and error" I found a solution different from the  
>> others
>> that did work.
>>
>> After becoming more familiar with how MS does windows internal
>> operations, I have a new appreciation for what you must have gone
>> through to bring us the AmiBroker program... I will say no more about
>> MS... I leave that to you...
>>
>> I generated 5 Functions so far:
>>
>> 1. Find and bring a Window to the foreground based on its title bar
>> name (Parameters Window).
>> 2. Get the scroll  position of the Parameters Window.
>> 3. Click "Reset all" button of the Parameters Window.
>> 4. Set the scroll position of the Parameters Window.
>> 5. Get the state of the modifier keys.
>>
>> Based on this, I do not see any burning need to include support for
>> modifier keys in AFL since a tiny DLL will provide it, and those that
>> need it are likely building more sophisticated AFL applications.
>> However, I would not discourage you from adding it either.
>>
>> If anyone wants to see the actual Function C++ source, I will be  
>> happy
>> to post it here or email it to them.  The DLL itself will be  
>> available
>> later as part of my Flexible Params example AFL to be released on the
>> UKB.  As an aside, I also added some nice modular and simple Gfx  
>> drawn
>> button functions to my Flexible Params Example that I will also share
>> soon.  They are very handy to me for showing/hiding information on  
>> the
>> chart.  They take advantage of my parameter system to integrate
>> directly into the parameters for saving their state between AB  
>> launches.
>>
>> Things are moving forward very nicely for me thanks to your very
>> helpful support.
>>
>> Best regards,
>> Dennis
>>
>> On Apr 28, 2008, at 8:33 PM, Dennis Brown wrote:
>>
>>> Tomasz,
>>>
>>> Wow! Thank you... Not only the answer on a silver plater, but the  
>>> keys
>>> to the silver chest too!
>>> I feel like I am being rewarded doubly for my efforts.
>>>
>>> Yes, I am reasonably smart, but not a genius, just an inventor/
>>> engineer.  I don't want others to think I am doing something that is
>>> beyond the capabilities of ordinary smart persons.  If someone is
>>> trying to make money using a computer and AmiBroker, they must be
>>> reasonably smart person to begin with.
>>>
>>> By learning AFL first, I recognized parallels in syntax, and  
>>> concepts
>>> to C++ and this made it much faster to learn what was going on.  AFL
>>> is much simpler to learn though --plus it has array operations to  
>>> make
>>> many tasks simple without having to use loops.  I highly recommend
>>> that people who do not program now, expand their knowledge by  
>>> learning
>>> AFL programming.  It will be useful in many ways.
>>>
>>> I have spent a lot of time programming in AFL to create my trading
>>> platform ideas during the last almost two years.  I have come to
>>> appreciate all the thought and effort you have put into  
>>> AmiBroker.  It
>>> is you who should be complimented.  It is a tough job to try to be  
>>> all
>>> things to all people.
>>>
>>> Now with this generous information from you, I am going to kick  
>>> AutoIt
>>> out of my Flexible Parameters AFL code ASAP.
>>>
>>> Best regards,
>>> Dennis
>>>
>>> On Apr 28, 2008, at 6:19 PM, Tomasz Janeczko wrote:
>>>
>>>> Dennis,
>>>>
>>>> You are welcome. I must compliment you that you are really smart if
>>>> you figured it out so quickly.
>>>>
>>>> As to pressing 'reset all' from C level, you can use the same
>>>> technique.
>>>> Actually you can send the BN_CLICKED notification to parent instead
>>>> of sending mouse down/up
>>>> messages.
>>>>
>>>>
>>>> UINT nControlID = 403; // 403 is the ID of reset all button
>>>> HWND hResetAllButton = GetDlgItem( hParamWindow, nControlID );
>>>>
>>>> ::SendMessage( hParamWindow, WM_COMMAND, MAKEWPARAM( nControlID ,
>>>> BN_CLICKED ), (LPARAM) hResetAllButton );
>>>>
>>>>
>>>> As to modifier keys
>>>>
>>>> if( ::GetAsyncKeyState( VK_ALT ) < 0 ) { ... alt key pressed down }
>>>> if( ::GetAsyncKeyState( VK_SHIFT ) < 0 ) { ... shift key pressed
>>>> down }
>>>>
>>>> http://msdn2.microsoft.com/en-us/library/ms646293.aspx
>>>>
>>>> I can add GetAsyncKeystate to native AFL if there is demand.
>>>>
>>>> Best regards,
>>>> Tomasz Janeczko
>>>> amibroker.com
>>>> ----- Original Message -----
>>>> From: "Dennis Brown" <see3d@xxxxxxxxxxx>
>>>> To: <amibroker@xxxxxxxxxxxxxxx>
>>>> Sent: Monday, April 28, 2008 11:12 PM
>>>> Subject: Re: [amibroker] Re: Visual C++ 2008 Express simple DLL
>>>> sample file?
>>>>
>>>>
>>>>> Tomasz,
>>>>>
>>>>> Thank you.
>>>>>
>>>>> Yes, I understood that the window with the scroll bar was a  
>>>>> child of
>>>>> the tabs control which was a child of the Parameters Window.  I am
>>>>> not
>>>>> sure why my method did not work, but THANK YOU for the last "hint"
>>>>> which does work -- "hint" was more like handing me the answer on a
>>>>> silver platter ;-)
>>>>>
>>>>> My DLL now works fine using your method to directly get the handle
>>>>> of
>>>>> the child control with the scroll bar in it.  Addressing it via  
>>>>> the
>>>>> ID
>>>>> is a much easier method.  I saw the ID using the AutoIt Window  
>>>>> Info
>>>>> program, but I did not know how to utilize it.  I looked through  
>>>>> the
>>>>> MS doc on windows functions but did not see a way to use it.  If  
>>>>> you
>>>>> had not provided the "hint" I might never have found that  
>>>>> solution,
>>>>> because it was in the Dialog Box section and even named "Get  
>>>>> Dialog
>>>>> Item."  Sometimes there is no substitute for experience -- 
>>>>> especially
>>>>> when the documentation is not intuitively obvious.
>>>>>
>>>>> Now I am off and running again, and can clean up the DLL with
>>>>> "safety
>>>>> features" and finish adding this needed feature to my Flexible
>>>>> Parameters AFL.
>>>>>
>>>>> I thank you for playing along with me on this challenge.  I
>>>>> learned a
>>>>> lot of useful information in a few short days (about 10 hours of
>>>>> actual work).  I even see how I should be using some different
>>>>> naming
>>>>> conventions based on your last example.
>>>>>
>>>>> I hope that others following this thread (which actually started  
>>>>> as
>>>>> an
>>>>> offshoot of the thread "Big symbol text in the background")  
>>>>> found it
>>>>> entertaining, informative, and inspiring.
>>>>>
>>>>> Now I am starting to wonder if I can add some more functions to my
>>>>> DLL
>>>>> that will let me to get rid of AutoIt completely.  I much prefer
>>>>> simple straight forward solutions that do not rely on interactions
>>>>> between too many different vendors products.  I will give this  
>>>>> some
>>>>> thought later.  I suppose the only thing I would really need to
>>>>> learn
>>>>> how to do is sending a mouseUp message to the "Reset all" button  
>>>>> in
>>>>> the Parameters Window.  Not sure how that can be done, but it must
>>>>> be
>>>>> possible because AutoIt can do it.  Perhaps I can even determine  
>>>>> the
>>>>> state of the keyboard modifier keys --but I think you may be
>>>>> providing
>>>>> that in the future for AFL.
>>>>>
>>>>> The point is, I do not feel as limited in what I can do with AFL
>>>>> now --
>>>>> given some hints, learnings, and work.  Some things will require  
>>>>> you
>>>>> to add features to AFL to make them easy to use for everyone, but
>>>>> some
>>>>> simple things, I can figure out how to do with a DLL now with  
>>>>> just a
>>>>> little help now and then from experienced users.
>>>>>
>>>>> Best regards,
>>>>> Dennis
>>>>>
>>>>>
>>>>> On Apr 28, 2008, at 2:29 AM, Tomasz Janeczko wrote:
>>>>>
>>>>>> Dennis,
>>>>>>
>>>>>> The parameter window does not contain a scrollbar because it  
>>>>>> is  a
>>>>>> parent
>>>>>> of actual parameter list window. Therefore to get a handle of
>>>>>> actual
>>>>>> window that contains the scrollbar you need to traverse children
>>>>>> list
>>>>>> of parameter window, or better (easier), get the child control  
>>>>>> with
>>>>>> appropriate ID.
>>>>>> The ID of actual list is 88.
>>>>>> So you would need to call
>>>>>> HWND hActualList = GetDlgItem( h_ParamWindow, 88 );
>>>>>>
>>>>>> if( hActualList )
>>>>>> {
>>>>>> nScrollPos = GetScrollPos( hActualList, SB_VERT );
>>>>>>
>>>>>> ....
>>>>>>
>>>>>> SetScrollPos( hActualList, SB_VERT, nPos, TRUE );
>>>>>> }
>>>>>>
>>>>>>
>>>>>> Best regards,
>>>>>> Tomasz Janeczko
>>>>>> amibroker.com
>>>>>> ----- Original Message -----
>>>>>> From: "Dennis Brown" <see3d@xxxxxxxxxxx>
>>>>>> To: <amibroker@xxxxxxxxxxxxxxx>
>>>>>> Sent: Monday, April 28, 2008 12:08 AM
>>>>>> Subject: Re: [amibroker] Re: Visual C++ 2008 Express simple DLL
>>>>>> sample file?
>>>>>>
>>>>>>
>>>>>>> Tomasz,
>>>>>>>
>>>>>>> I am reporting back on my success as far as it goes on this
>>>>>>> challenge,
>>>>>>> and request another hint.  I have succeeded in learning how to
>>>>>>> write a
>>>>>>> C++ DLL function with freely available programs and  
>>>>>>> documentation.
>>>>>>> The DLL can get the scroll position of the top child window of  
>>>>>>> the
>>>>>>> foreground window and return the result to AFL.  I have also
>>>>>>> written a
>>>>>>> function that will set the scroll position to a value specified
>>>>>>> from
>>>>>>> AFL and return the old position as I originally set out to do.
>>>>>>> This
>>>>>>> should give me the ability to get or set the scroll position on
>>>>>>> any
>>>>>>> AmiBroker program window that is active and has a vertical  
>>>>>>> scroll
>>>>>>> bar.  For instance, with this DLL, I can now get and set the
>>>>>>> scroll
>>>>>>> position on the Formula Editor Window just as expected.   
>>>>>>> However,
>>>>>>> the
>>>>>>> Parameters Window returns an error that it contains no scroll  
>>>>>>> bar
>>>>>>> even
>>>>>>> though it is visible on the screen, so I have not succeeded  
>>>>>>> yet in
>>>>>>> the
>>>>>>> original challenge.
>>>>>>>
>>>>>>> Since you wrote the code that created the (I am assuming) child
>>>>>>> window
>>>>>>> with the scrollbar in the Parameters Window, I have to ask you  
>>>>>>> the
>>>>>>> next question.  Is there a key concept that I am missing  
>>>>>>> regarding
>>>>>>> how
>>>>>>> to get the handle to the Parameters Window child control/window
>>>>>>> with
>>>>>>> the scroll bar?
>>>>>>>
>>>>>>> I have looked everywhere I know to look for the answer, but have
>>>>>>> come
>>>>>>> up blank.  The only possibility I can think of is you wrote this
>>>>>>> child
>>>>>>> window in a custom way that does not support the functions I  
>>>>>>> used
>>>>>>> to
>>>>>>> get or set the scroll.  The class string does have a strange
>>>>>>> looking
>>>>>>> name for this window.
>>>>>>>
>>>>>>> Here is the Function.cpp code segment I wrote that gets the  
>>>>>>> scroll
>>>>>>> position (or the error code):
>>>>>>>
>>>>>>> // GetWindowScroll( )
>>>>>>> // This function returns the vertical scroll position
>>>>>>> // of the top window of the foreground (active) window
>>>>>>> // Returns zero if not successful
>>>>>>> // Temp Debug: Returns the error code if not successful
>>>>>>>
>>>>>>> AmiVar VGetWindowScroll( int NumArgs, AmiVar *ArgsTable )
>>>>>>> {
>>>>>>> AmiVar OldScroll;
>>>>>>> OldScroll.type = VAR_FLOAT;
>>>>>>>
>>>>>>> HWND foreWindow = GetForegroundWindow();
>>>>>>> HWND topWindow = GetTopWindow(foreWindow);
>>>>>>>
>>>>>>> int OVWScroll = GetScrollPos( topWindow, SB_VERT );
>>>>>>> OldScroll.val = OVWScroll;
>>>>>>> if(OVWScroll==0){DWORD dw = GetLastError(); OldScroll.val =
>>>>>>> dw;} ;//
>>>>>>> Debug code
>>>>>>>
>>>>>>> return OldScroll;
>>>>>>> }
>>>>>>>
>>>>>>> If there is something that you do not want to reveal publicly on
>>>>>>> the
>>>>>>> forum, please PM me.  Otherwise, please another hint.
>>>>>>>
>>>>>>> Best regards,
>>>>>>> Dennis
>>>>>>>
>>>>>>> On Apr 27, 2008, at 1:24 PM, Dennis Brown wrote:
>>>>>>>> Dan,
>>>>>>>>
>>>>>>>> LOL --the blind leading the blind.  I wanted to relate my
>>>>>>>> experiences
>>>>>>>> in attempting this "Impossible for my level of experience and
>>>>>>>> tools"
>>>>>>>> solution to my problem to encourage others that it can be
>>>>>>>> done.  I
>>>>>>>> also knew I would need a little help from a knowledgeable  
>>>>>>>> person
>>>>>>>> like
>>>>>>>> TJ to point me in the right direction.   After all, it would be
>>>>>>>> foolish to attempt to do something if there was no reasonable
>>>>>>>> solution
>>>>>>>> at all, and he would know.  I searched on the internet to  
>>>>>>>> fill in
>>>>>>>> more
>>>>>>>> details.  We don't always have to have the solutions handed  
>>>>>>>> to us
>>>>>>>> on a
>>>>>>>> silver platter --as nice as that is.  I also did not believe
>>>>>>>> that I
>>>>>>>> should have to spend a long time with books, manuals, or buy
>>>>>>>> tools
>>>>>>>> just to make a 10 line program that I needed now.  Besides I
>>>>>>>> learn
>>>>>>>> better by discovering things than reading about them in books.
>>>>>>>> The
>>>>>>>> little light bulbs go on quite often when I have to work for  
>>>>>>>> the
>>>>>>>> understanding.
>>>>>>>>
>>>>>>>> Since I don't know C++ , every line I write has errors.  I just
>>>>>>>> try
>>>>>>>> different possibilities and recompile until I hit on a syntax
>>>>>>>> that
>>>>>>>> works.  It usually takes 3-5 attempts to get each line to work,
>>>>>>>> then I
>>>>>>>> go to the next line.  If I don't get the result I expect, I try
>>>>>>>> different experiments, and by the process of elimination I  
>>>>>>>> learn
>>>>>>>> what
>>>>>>>> is going on.  If I get really stuck, I will ask for help again.
>>>>>>>> Trial and error engineering!
>>>>>>>>
>>>>>>>> I still don't have the solution I want working.  I wrote the  
>>>>>>>> DLL
>>>>>>>> as I
>>>>>>>> had envisioned it, and it does work as far as I can tell.
>>>>>>>> However, I
>>>>>>>> believe I am missing a key concept about which window in the
>>>>>>>> "Parameters Window" contains the scroll bar since I get an  
>>>>>>>> error
>>>>>>>> message that the foreground window has no scroll bars.  I am  
>>>>>>>> now
>>>>>>>> guessing that the tabbed window structure is such that there  
>>>>>>>> is a
>>>>>>>> child window overlaid on the main Parameters window that has  
>>>>>>>> the
>>>>>>>> scroll bar.  Now I have to figure out how to get its handle.
>>>>>>>> Notice
>>>>>>>> all those Windows type concepts I am throwing around after  
>>>>>>>> only a
>>>>>>>> day
>>>>>>>> of poking at the problem --LOL.
>>>>>>>>
>>>>>>>> During some of my internet searches, I did come across some
>>>>>>>> references
>>>>>>>> to VB that would lead me to think that I might be able to solve
>>>>>>>> this
>>>>>>>> problem with it also.  However, I know no more about VB than  
>>>>>>>> I do
>>>>>>>> about C++, so I might as well do it at the lowest level for the
>>>>>>>> simple
>>>>>>>> problem that it is.  At least C++ and AFL look enough alike
>>>>>>>> that I
>>>>>>>> can
>>>>>>>> guess at the syntax of C++.
>>>>>>>>
>>>>>>>> Getting frustrated and giving up is something I got over many
>>>>>>>> decades
>>>>>>>> ago after realizing that the only way to fail is to give up,  
>>>>>>>> and
>>>>>>>> the
>>>>>>>> way to succeed is to never give up.  Once you determine that  
>>>>>>>> you
>>>>>>>> will
>>>>>>>> succeed no matter what it takes, the setbacks are just part of
>>>>>>>> learning about the solution.  It does irk me though when I am
>>>>>>>> given
>>>>>>>> wrong information that takes me far in the wrong direction and
>>>>>>>> wastes
>>>>>>>> a lot of time.
>>>>>>>>
>>>>>>>> As far as the typo in the example goes, I don't think TJ  
>>>>>>>> needs to
>>>>>>>> say
>>>>>>>> anything about it on the board.  If nobody noticed it for 7
>>>>>>>> years,
>>>>>>>> it
>>>>>>>> is not critical to get fixed on a moments notice.  I would not
>>>>>>>> have
>>>>>>>> mentioned it publicly except that it made a good story.
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>> Dennis
>>>>>>>>
>>>>>>>> On Apr 27, 2008, at 9:30 AM, ab319320 wrote:
>>>>>>>>> Dennis good work.  There are two possibilities for the error  
>>>>>>>>> in
>>>>>>>>> the
>>>>>>>>> example.  I have to wonder if Tomasz even picked up on the  
>>>>>>>>> error
>>>>>>>>> you
>>>>>>>>> mentioned as he was caught up in compiler talk and did not  
>>>>>>>>> thank
>>>>>>>>> you
>>>>>>>>> and say that the error would be fixed.  That aside Tomasz has
>>>>>>>>> done a
>>>>>>>>> terrific job on MY AMI.
>>>>>>>>>
>>>>>>>>> But, errors in examples as in a 21 day vc++ book frustrated me
>>>>>>>>> to
>>>>>>>>> the
>>>>>>>>> point that my vc++6.0 pro ed just sets on the shelf.  We all
>>>>>>>>> have
>>>>>>>>> different levels of tolerance and Dennis yours excels.
>>>>>>>>>
>>>>>>>>> I discovered MS's Express series just a month ago and typed my
>>>>>>>>> 1981
>>>>>>>>> basic program into vbasic 2008 express.  I had over a hundred
>>>>>>>>> error
>>>>>>>>> msgs but it was easy to work through.  I think the vb is  
>>>>>>>>> easier
>>>>>>>>> than
>>>>>>>>> the vc express because of the error window (which is more like
>>>>>>>>> vc6.0).  MS has provided a powerful on-line help enter- 
>>>>>>>>> face.  Vb
>>>>>>>>> express, I think, allows creation of a dll.
>>>>>>>>>
>>>>>>>>> Dennis I hope that you will post a "How To dll"  in the Files
>>>>>>>>> section
>>>>>>>>> which is user friendly.  It appears you may have that ability.
>>>>>>>>> Sometimes experienced people write over the heads of less
>>>>>>>>> experienced.
>>>>>>>>> Dan
>>>>>>>>> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko"  
>>>>>>>>> <groups@xxx>
>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> Dennis,
>>>>>>>>>>
>>>>>>>>>> OK, OK, my bad. You see my previous comment was not intended
>>>>>>>>>> to be
>>>>>>>>> taken so seriously.
>>>>>>>>>> I have very different perspective than you and others on the
>>>>>>>>>> list
>>>>>>>>>> since C++ compiler is my everyday bread and butter so I have
>>>>>>>>>> very
>>>>>>>>> different expectations and very different opinion than  
>>>>>>>>> majority.
>>>>>>>>>> If I wrote so on some "hard core C geek" forum, I would be
>>>>>>>>> understood better.
>>>>>>>>>>
>>>>>>>>>> Apparently 2008 "express" version is less restrictive
>>>>>>>>>> compared to previous 2005. I am not using 2008. Three years
>>>>>>>>>> ago I
>>>>>>>>> bought Professional Edition 2005 to find that I use
>>>>>>>>>> it only for 64 bit compilations because it is slow for  
>>>>>>>>>> everyday
>>>>>>>>> work, crashes a lot and code produced is not compatible with  
>>>>>>>>> 9x
>>>>>>>>> windows.
>>>>>>>>>> I use good old version 6 (from 1997 afair) because it is fast
>>>>>>>>>> and
>>>>>>>>> compatible with all Windows versions. That old version 6.0 is
>>>>>>>>>> something that Microsoft has done very well (but there was no
>>>>>>>>>> free
>>>>>>>>> editions at that time).
>>>>>>>>>>
>>>>>>>>>> Best regards,
>>>>>>>>>> Tomasz Janeczko
>>>>>>>>>> amibroker.com
>>>>>>>>>> ----- Original Message -----
>>>>>>>>>> From: Dennis Brown
>>>>>>>>>> To: amibroker@xxxxxxxxxxxxxxx
>>>>>>>>>> Sent: Saturday, April 26, 2008 7:20 PM
>>>>>>>>>> Subject: Re: [amibroker] Visual C++ 2008 Express simple DLL
>>>>>>>>> sample file?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Tomasz,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> While, being a Mac guy, I am quick to vilify Microsoft.
>>>>>>>>>> However,
>>>>>>>>> in this case you are being too harsh on them.  They seem to  
>>>>>>>>> have
>>>>>>>>> improved their free version for 2008 and with some more
>>>>>>>>> experimentation, I was able to get the free version to compile
>>>>>>>>> the
>>>>>>>>> ADK Sample project and produce the sample.dll.  Then I  
>>>>>>>>> modified
>>>>>>>>> the
>>>>>>>>> functions.cpp slightly and made another sample.dll that
>>>>>>>>> functioned
>>>>>>>>> properly with AFL calls.
>>>>>>>>>> Here is what I did to make it work:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> 1.   I reinstalled the ADK from scratch to get rid of my
>>>>>>>>>> previous
>>>>>>>>> experiments.
>>>>>>>>>> 2.   I double clicked the Sample.dsp file which launched  
>>>>>>>>>> Visual
>>>>>>>>> C++ 2008 Express Edition
>>>>>>>>>> 3.   A dialog box came up requesting to convert the project
>>>>>>>>> format to an updated version --I clicked Yes.  This was the  
>>>>>>>>> key
>>>>>>>>> step.
>>>>>>>>>> 4.   I did a "Build Solution" from the Build menu.
>>>>>>>>>> 5.   The Sample.dll was generated error free and placed in
>>>>>>>>> the "Debug" folder.
>>>>>>>>>> 6.   I moved the Sample.dll into the Plugins folder and  
>>>>>>>>>> started
>>>>>>>>> up AmiBroker.  I added a plot calling ExampleEMA.  Success.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> There is a humorous side to this story also...
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I modified the ExampleEMA just to make sure that it was my
>>>>>>>>> changes that I was seeing and not something else, since the
>>>>>>>>> ExampleEMA was a prebuilt function.  I called it myExampleEMA,
>>>>>>>>> and I
>>>>>>>>> changed the function to return a constant.  It worked half
>>>>>>>>> way????
>>>>>>>>> The name changed, but it returned the exact same moving  
>>>>>>>>> average
>>>>>>>>> result as before.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I tried all kinds of changes to that function which seemed to
>>>>>>>>> have no effect.  I finally commented practically everything  
>>>>>>>>> out
>>>>>>>>> in
>>>>>>>>> the function and it still returned a beautiful moving average.
>>>>>>>>> My
>>>>>>>>> mind was going in circles tying to figure out how my changes
>>>>>>>>> could be
>>>>>>>>> ignored.  It truly seemed impossible.  It is funny that when  
>>>>>>>>> you
>>>>>>>>> don't know what you are doing and in a new situation, the mind
>>>>>>>>> is
>>>>>>>>> open to the wildest speculations to explain what is happening.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Eventually, I commented out the other two functions:
>>>>>>>>>> exampleMACD
>>>>>>>>> and ExampleMA.  Finally I got a compile error message.  It  
>>>>>>>>> turns
>>>>>>>>> out
>>>>>>>>> that there is a typo in the function table.  Both ExampleEMA  
>>>>>>>>> and
>>>>>>>>> ExampleMA point to VExampleMA code.  Since the file was last
>>>>>>>>> modified
>>>>>>>>> in 2001, it must have been there for 7 years and nobody  
>>>>>>>>> noticed
>>>>>>>>> until
>>>>>>>>> now --or at least did not bother tell AmiBroker about it.   It
>>>>>>>>> was
>>>>>>>>> lurking for all those years just waiting for a novice like  
>>>>>>>>> me to
>>>>>>>>> get
>>>>>>>>> tricked into thinking the laws of programming physics were
>>>>>>>>> suddenly
>>>>>>>>> altered.  LOL
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Now I will proceed to try and make my real dll work.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Best regards,
>>>>>>>>>> Dennis
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Apr 26, 2008, at 10:22 AM, Tomasz Janeczko wrote:
>>>>>>>>>>
>>>>>>>>>> See also the video:
>>>>>>>>>> http://www.amibroker.com/video/devcpp.html
>>>>>>>>>>
>>>>>>>>>> Best regards,
>>>>>>>>>> Tomasz Janeczko
>>>>>>>>>> amibroker.com
>>>>>>>>>> ----- Original Message -----
>>>>>>>>>> From: Tomasz Janeczko
>>>>>>>>>> To: amibroker@xxxxxxxxxxxxxxx
>>>>>>>>>> Sent: Saturday, April 26, 2008 4:19 PM
>>>>>>>>>> Subject: Re: [amibroker] Visual C++ 2008 Express simple DLL
>>>>>>>>> sample file?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Hello,
>>>>>>>>>>
>>>>>>>>>> Visual C++ 2008 EXPRESS edition (FREE) is severely limited
>>>>>>>>> and does NOT support creating of DLLs at all.
>>>>>>>>>> That's why you get error when compiling it with Express
>>>>>>>>> edition.
>>>>>>>>>> Microsoft never gives useful things for free. Express
>>>>>>>>> editions are toys only.
>>>>>>>>>>
>>>>>>>>>> To create DLLs you need either Standard or Professional
>>>>>>>>> edition, or free Borland compiler or free GCC( GNU CC)/MinGW
>>>>>>>>>> http://www.bloodshed.net/devcpp.html
>>>>>>>>>> Sample project files for free Dec-C++ are included in the  
>>>>>>>>>> ADK.
>>>>>>>>>>
>>>>>>>>>> Best regards,
>>>>>>>>>> Tomasz Janeczko
>>>>>>>>>> amibroker.com
>>>>>>>>>>   ----- Original Message -----
>>>>>>>>>>   From: Dennis Brown
>>>>>>>>>>   To: amibroker@xxxxxxxxxxxxxxx
>>>>>>>>>>   Sent: Saturday, April 26, 2008 2:18 PM
>>>>>>>>>>   Subject: Re: [amibroker] Visual C++ 2008 Express simple DLL
>>>>>>>>> sample file?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   Paul, That is exactly what my plan was and what I was
>>>>>>>>> attempting to do.  However, the example in the ADK would not
>>>>>>>>> compile
>>>>>>>>> error free with Visual C++ 2008 Express as I explained.
>>>>>>>>> Perhaps it
>>>>>>>>> would with the full version, but I explained that issue in my
>>>>>>>>> last
>>>>>>>>> post to Mike.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   BR,
>>>>>>>>>>   Dennis
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   On Apr 26, 2008, at 2:13 AM, Paul Ho wrote:
>>>>>>>>>>
>>>>>>>>>>     You should start off by compiling the examples contained
>>>>>>>>> in the ADK. and increment things slowly so you know what could
>>>>>>>>> possibly cause the problem
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --------------------------------------------------------------------
>>>>>>>>>>       From: amibroker@xxxxxxxxxxxxxxx
>>>>>>>>> [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Dennis Brown
>>>>>>>>>>       Sent: Saturday, 26 April 2008 1:44 PM
>>>>>>>>>>       To: amibroker@xxxxxxxxxxxxxxx
>>>>>>>>>>       Subject: [amibroker] Visual C++ 2008 Express simple DLL
>>>>>>>>> sample file?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>       Hello,
>>>>>>>>>>
>>>>>>>>>>       I took the challenge from Tomasz that anyone who is
>>>>>>>>> willing to learn,
>>>>>>>>>>       can extend AFL to do anything. My chosen task is to
>>>>>>>>> restore the
>>>>>>>>>>       scroll position of the Parameters Window after a "Reset
>>>>>>>>> all" button
>>>>>>>>>>       click --and yes, it has an important use.
>>>>>>>>>>
>>>>>>>>>>       Tomasz informed me that I would need to write a DLL to
>>>>>>>>> make this
>>>>>>>>>>       possible. There may be other ways, but I will try it
>>>>>>>>> this way.
>>>>>>>>>>
>>>>>>>>>>       First I have to say that I do not know C++ (other than
>>>>>>>>> AFL has a
>>>>>>>>>>       similar syntax). Next I am not very familiar with
>>>>>>>>> anything Windows (I
>>>>>>>>>>       am a Mac guy). So if I can do this (with a little help
>>>>>>>>> from my AB
>>>>>>>>>>       friends) Tomasz will be vindicated in his statements.
>>>>>>>>>>
>>>>>>>>>>       I determined that all I need is to make an extremely
>>>>>>>>> simple DLL. It
>>>>>>>>>>       will create the following new AFL function:
>>>>>>>>>>
>>>>>>>>>>       oldScrollPosition = GetSetWindowScroll
>>>>>>>>> (newScrollPosition);
>>>>>>>>>>
>>>>>>>>>>       It will simply return the current scroll position of
>>>>>>>>> the active
>>>>>>>>>>       foreground window and then set the scroll position to
>>>>>>>>> the supplied
>>>>>>>>>>       parameter. It should only be about 10 lines of C++  
>>>>>>>>>> code.
>>>>>>>>>>
>>>>>>>>>>       I have found the Windows calls that will get the handle
>>>>>>>>> of the
>>>>>>>>>>       foreground window, and (with a pointer from Tomasz)
>>>>>>>>> calls to get and
>>>>>>>>>>       set the scroll thumb position on a standard window.
>>>>>>>>>>
>>>>>>>>>>       Everything else I need to do I can handle with AutoIt
>>>>>>>>> or AFL.
>>>>>>>>>>
>>>>>>>>>>       I have installed the free ADK and installed the free
>>>>>>>>> Visual C++ 2008
>>>>>>>>>>       Express program, and started to try to write this.
>>>>>>>>>>
>>>>>>>>>>       Initially I tried just Building the Sample DLL in the
>>>>>>>>> ADK. That
>>>>>>>>>>       mostly works, but gives me errors on the Plugin.cpp:
>>>>>>>>>>
>>>>>>>>>>       error C2491: on 5 critical lines for : Definition of
>>>>>>>>> dllimport
>>>>>>>>>>       function not allowed
>>>>>>>>>>       these are the PLUGINAPI statements for Release, Init,
>>>>>>>>>>       GetFunnctionTable, SetSiteInterface, and GetPluginInfo.
>>>>>>>>>>
>>>>>>>>>>       Somehow, I think I really need these lines to compile
>>>>>>>>> for any AB DLL
>>>>>>>>>>       to work...
>>>>>>>>>>
>>>>>>>>>>       I have tried a bunch of things, and I can make it give
>>>>>>>>> me more errors,
>>>>>>>>>>       but unfortunately no less errors. So I think I need
>>>>>>>>> some hints or
>>>>>>>>>>       more help to get started.
>>>>>>>>>>
>>>>>>>>>>       I was wondering if anyone has an answer, or a simple
>>>>>>>>> DLL sample
>>>>>>>>>>       project file that builds error free on Visual C++ 2008
>>>>>>>>> Express that
>>>>>>>>>>       you could email me to get me started on the right track
>>>>>>>>> with this?
>>>>>>>>>>
>>>>>>>>>>       Thanks,
>>>>>>>>>>       Dennis
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------
>>>>>>>>>
>>>>>>>>> Please note that this group is for discussion between users
>>>>>>>>> only.
>>>>>>>>>
>>>>>>>>> To get support from AmiBroker please send an e-mail directly  
>>>>>>>>> to
>>>>>>>>> SUPPORT {at} amibroker.com
>>>>>>>>>
>>>>>>>>> For NEW RELEASE ANNOUNCEMENTS and other news always check
>>>>>>>>> DEVLOG:
>>>>>>>>> http://www.amibroker.com/devlog/
>>>>>>>>>
>>>>>>>>> For other support material please check also:
>>>>>>>>> http://www.amibroker.com/support.html
>>>>>>>>> Yahoo! Groups Links
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------
>>>>>>>>
>>>>>>>> Please note that this group is for discussion between users  
>>>>>>>> only.
>>>>>>>>
>>>>>>>> To get support from AmiBroker please send an e-mail directly to
>>>>>>>> SUPPORT {at} amibroker.com
>>>>>>>>
>>>>>>>> For NEW RELEASE ANNOUNCEMENTS and other news always check  
>>>>>>>> DEVLOG:
>>>>>>>> http://www.amibroker.com/devlog/
>>>>>>>>
>>>>>>>> For other support material please check also:
>>>>>>>> http://www.amibroker.com/support.html
>>>>>>>> Yahoo! Groups Links
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------
>>>>>>>
>>>>>>> Please note that this group is for discussion between users  
>>>>>>> only.
>>>>>>>
>>>>>>> To get support from AmiBroker please send an e-mail directly to
>>>>>>> SUPPORT {at} amibroker.com
>>>>>>>
>>>>>>> For NEW RELEASE ANNOUNCEMENTS and other news always check  
>>>>>>> DEVLOG:
>>>>>>> http://www.amibroker.com/devlog/
>>>>>>>
>>>>>>> For other support material please check also:
>>>>>>> http://www.amibroker.com/support.html
>>>>>>> Yahoo! Groups Links
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ------------------------------------
>>>>>>
>>>>>> Please note that this group is for discussion between users only.
>>>>>>
>>>>>> To get support from AmiBroker please send an e-mail directly to
>>>>>> SUPPORT {at} amibroker.com
>>>>>>
>>>>>> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>>>>>> http://www.amibroker.com/devlog/
>>>>>>
>>>>>> For other support material please check also:
>>>>>> http://www.amibroker.com/support.html
>>>>>> Yahoo! Groups Links
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------
>>>>>
>>>>> Please note that this group is for discussion between users only.
>>>>>
>>>>> To get support from AmiBroker please send an e-mail directly to
>>>>> SUPPORT {at} amibroker.com
>>>>>
>>>>> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>>>>> http://www.amibroker.com/devlog/
>>>>>
>>>>> For other support material please check also:
>>>>> http://www.amibroker.com/support.html
>>>>> Yahoo! Groups Links
>>>>>
>>>>>
>>>>>
>>>>
>>>> ------------------------------------
>>>>
>>>> Please note that this group is for discussion between users only.
>>>>
>>>> To get support from AmiBroker please send an e-mail directly to
>>>> SUPPORT {at} amibroker.com
>>>>
>>>> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>>>> http://www.amibroker.com/devlog/
>>>>
>>>> For other support material please check also:
>>>> http://www.amibroker.com/support.html
>>>> Yahoo! Groups Links
>>>>
>>>>
>>>>
>>>
>>>
>>> ------------------------------------
>>>
>>> Please note that this group is for discussion between users only.
>>>
>>> To get support from AmiBroker please send an e-mail directly to
>>> SUPPORT {at} amibroker.com
>>>
>>> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>>> http://www.amibroker.com/devlog/
>>>
>>> For other support material please check also:
>>> http://www.amibroker.com/support.html
>>> Yahoo! Groups Links
>>>
>>>
>>>
>>
>>
>> ------------------------------------
>>
>> Please note that this group is for discussion between users only.
>>
>> To get support from AmiBroker please send an e-mail directly to
>> SUPPORT {at} amibroker.com
>>
>> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>> http://www.amibroker.com/devlog/
>>
>> For other support material please check also:
>> http://www.amibroker.com/support.html
>> Yahoo! Groups Links
>>
>>
>>
>
> ------------------------------------
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> For other support material please check also:
> http://www.amibroker.com/support.html
> Yahoo! Groups Links
>
>
>


------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/