On Mon, 17 May 2010, Mindaugas Kavaliauskas wrote: Hi,
> >Yes. I've wrote inproc OLE server for Harbour and it uses above > >functions to convert function/method/memvar symbols to DISPID in > >GetIDsOfNames() dispatch method and they are later converted back > >to symbols in Invoke() method. > >I've finished the code but I have no idea if it works or not. > >I've wrote everything using only documentation in the internet > >and haven't made any real life test so far so I do not want to > >make it public it yet. > Perhaps one of the most amazing things is how can you write software > without testing!!! :) Usualy I can not write more than 30 lines of > code without trying to run it. Probably each of us likes to tests the code anyhow in the past I had to create some bigger peaces of code without any way to make real tests until I finished nearly whole project and believe me it's possible. In this particular case the code is relatively small ~500 lines. The most amazing is the fact that I've just compiled it and executed using WinXP machine in my office and it works correctly without any modifications. I can compile the .PRG client and server example from xHarbour.com OLE server page. I only have to link at least one of components (server or client) statically because both linked dynamically with the same harbour.dll shares the same HVM so server fails inside hb_vmInit(). I can add protection against multiple HVM initialization anyhow using the same HVM for client and server code introduces interactions between them which do not use OLE API, i.e. they will use the same static variables. I'm interesting if it's possible to link both client and sever dynamically with xhbdll.dll using xHarbour.com. If yes and users need it then I can also emulate it. > >The idea is to create library which can be used by users to > >easy create own OLE servers. My current code should fully > >emulate the xHarbour.com ole server API: > > http://xharbour.com/index.asp?page=add_on_oleserver&show_sub=7&show_i=1 > Very old time ago, after I've seen it. It looked a little strange to > me. Why the whole application is presented as a single object? This > allows to call all public functions from external code. I thought it > is more common to create some Harbour level object and share it via > OLE server, thus making methods and properties of OLE object to be > methods and properties of Harbour object (instead of public > functions and memvars of Harbour application). I also think that opening whole HVM is limited only to some rather small subset of possible applications and probably more restrictive servers which make public only some well defined set of methods using object or hash array will be more popular. But it's not my job to force how user will use it. The xHarbour.com compatible interface is only one of possible choices. best regards, Przemek _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour