[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

Mike, I do not have Howard's book.  My searching late yesterday  
revealed that he did have an example of how to make a DLL using free  
Bloodshed C++.  I actually installed Bloodshed first, but found that  
it was nothing like the ADK example instructions.  So I switched to  
free Visual C++ 2008 which matched more closely (but not exactly).  I  
had contemplated buying Howard's book before, and if it was available  
as a download and updatable PDF I might have bought it because of the  
other information in it, but as it was, Howard just went traveling and  
no books will be shipped for a while.  However, the challenge was to  
be willing to learn, not to buy the answer.  If I wanted to buy the  
answer, I am sure someone would be happy to write 10 lines of code for  
$50.  I could also buy the full Visual C++, but that seems even more  
ridiculous for a one-off 10 lines of code.

BR,
Dennis

On Apr 26, 2008, at 1:02 AM, Mike wrote:
> If you have Howard's book on hand, Appendix A takes you through the
> process step by step...
>
> Mike
>
> --- In amibroker@xxxxxxxxxxxxxxx, Dennis Brown <see3d@xxx> wrote:
>>
>> 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

<*> 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/