Windows ole word automatism / use JUNO (this posts are getting longer and longer ;)

Gregor Kopp gk at cutcopy.com
Wed Nov 15 05:52:28 PST 2006


I went to another computer with Windows XP, and there it generated the d 
files! It seems, that its really a Windows2000 or Windows XP issue! And 
i thought im a jerky jerk *hrhr*
I keep you informed about my future experience about it.


Gregor Kopp schrieb:
> Hi JohnC,
> 
> thank you very very much for your time and helping.
> I downloaded your new version of Tlbimpd, found the 3 named files and 
> now im stucking again with Tlbimpd (step 1).
> 
> But i don not know what I can do. I tried tlbimpd with the options, 
> without the options, with full path in \ and / notation, a always get 
> the Access Violation on all 3 files. I too tried, just to find out how, 
> to generate it with the sqlite3.dll to see if it is tlbimpd, or me but 
> here tlbimpd says, that he cannot open the dll file. Could it be, that 
> tlbimpd don't do the job on a Windows 2000?
> 
> tlbimpd.exe is stored in my c:/dmd/bin directory wich is in my PATH 
> Variable, if that helps.
> 
> Whatever i try to do with it, here is an example output:
> 
> C:\Documents and Settings\gk>f:
> 
> F:\>cd \dfiles\mswordolb
> 
> F:\dfiles\mswordolb>dir
>  Volume in drive F is Daten
>  Volume Serial Number is 6833-CBCE
> 
>  Directory of F:\dfiles\mswordolb
> 
> 11/15/2006  02:13p      <DIR>          .
> 11/15/2006  02:13p      <DIR>          ..
> 09/01/2006  03:02p           9,816,840 MSO.DLL
> 02/19/2001  08:12p             626,688 MSWORD.OLB
> 01/22/2001  06:39p              45,056 VBE6EXT.OLB
>                3 File(s)     10,488,584 bytes
>                2 Dir(s)     928,391,168 bytes free
> 
> F:\dfiles\mswordolb>tlbimpd /?
> Type Library to D Module Converter 1.0
> 
> Syntax: tlbimpd TypeLibName [Options]
> Options:
>     /comments             Adds documentation as comments
>     /noblanks             Omits blank lines between members
>     /noenums              Prevents generating named enums
>     /nologo               Omits display of logo
>     /silent               Suppresses all output except errors
>     /tabs                 Indents new lines with tabs instead of spaces
>     /indent:indentCount   Indents new lines with the specified number of 
> spaces
>     /braces:newLine       Places braces on a new line
>     /module:moduleName    Name of module to be produced
>     /out:fileName         File name of module to be produced
>     /propget:prefix       Prefix to use for property getters
>     /propput:prefix       Prefix to use for property setters
>     /unnamed:value        Value for unnamed parameters
>     /order:verbatim       Generate types in original order
>     /? or /help           Displays this usage message
> 
> 
> F:\dfiles\mswordolb>tlbimpd MSWORD.OLB /module:msword /out:msword.d
> Type Library to D Module Converter 1.0
> 
> Access Violation
> 
> 
> F:\dfiles\mswordolb>
> 
> 
> JohnC schrieb:
> 
>> "Gregor Kopp" <gk at cutcopy.com> wrote in message 
>> news:ejepvc$1h3m$1 at digitaldaemon.com...
>>
>>> Hm. I played around with it now for several hours. With Tlbimpd I 
>>> always get an access violation, i dont know why. But I must say, that 
>>> I don't know if I did it the right way. I seems that ive always the 
>>> poor stupid guy who does always wants to learn something about new 
>>> technologies and always gets undocumented pieces of software :(
>>> Its really annoying.
>>
>>
>>
>> Sorry it's not documented. I'm readying a new release of my Juno 
>> library and related tools, and will provide documentation this time 
>> around. It should be done by late December.
>>
>> For now, get the latest test version of tlbimpd from 
>> http://wwwpaperocean.org/d/tlbimpd.zip.  The /? switch on the command 
>> line explains the various options.
>>
>> Tlbimpd attempts to generate a D source module from a COM type 
>> library. It doesn't work on every type library yet. And when it does 
>> work you might need to tweak the generated files to get them to compile.
>>
>> I just ran this version of tlbimpd on msword.olb, and it generated 
>> word.d without any errors. Here's what you need to do to get Word 
>> automation working:
>>
>> 1) Run tlbimpd (the latest version from the above link) on msword.olb, 
>> mso.dll and vbe6ext.olb.
>> I had to search my system for vbe6ext.olb. It was buried in a CAB file 
>> - if that's the same for you, copy it to another location before using 
>> tlbimpd on it.
>>
>> 2) Download http://www.paperocean.org/d/comtest.zip and use the com 
>> module from there instead of the one from Juno.
>>
>> 3) Import the resulting "office" and "vbide" modules into word.d, like 
>> this:
>>
>>     private import com, office, vbide;
>>
>> Import the "office" module into vbide.d.
>>
>> 4) office.d requires IPictureDisp, which isn't defined in the included 
>> com module (I'll add it in the next release) so add the following 
>> lines to the bottom of the "com" module:
>>
>>     interface IPictureDisp : IDispatch {
>>         static GUID IID = { 0x7BF80981, 0xBF32, 0x101A, 0x8B, 0xBB, 
>> 0x00, 0xAA, 0x00, 0x30, 0x0C, 0xAB };
>>     }
>>
>> 5) Try to compile everything, using DMD. You'll get a few errors 
>> saying something like "Range is used as a type". This means that Range 
>> is defined as a type but is also the name of a function, and they 
>> clash. So just go through them in turn and prefix the function names 
>> where the errors occur with "get_". For example change the function 
>> named Range to get_Range.
>>
>> After following these steps, it should all compile.
>>
>> I know I said it was easier to use early binding rather than late 
>> binding, and while this may make you think otherwise, it'll save you a 
>> lot of work in the long run.
>>
>>
>>> I thought about using OleView and do it by hand about 2 seconds ;)
>>> Im a Noob about such things, I think I need 3-4 years of experience 
>>> before I know what I'm doing with that *g*
>>>
>>> Anyway, enough mimimimi...
>>>
>>> Can anyone tell me what I could do to reach my goal? I would be 
>>> really be sad if i have to drop my interest on D because the lack of 
>>> my knowledge about windows programming.
>>>
>>> But maybe Im just to dump to use Tlbimpd :/
>>> I don't know...
>>
>>
>>
>> If you follow the guidance above, you shouldn't need to drop either.
>>



More information about the Digitalmars-d mailing list