Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Deled warning when i try to run my plugin

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Plugins
View previous topic :: View next topic  
Author Message
fik
Member


Joined: 11 Oct 2006
Posts: 303

PostPosted: Sun Jul 15, 2007 9:36 pm    Post subject: Deled warning when i try to run my plugin Reply with quote

I am trying to write a plugin, but I am having this warning come up 'CoInitialize has not ben called'. I have no idea after a lot of looking round what i am doing wrong or what this warning means. Any help most welcome. I am sure it's something silly I am doing. I think it has something to do with me trying to read a XML file into my plugin.
Back to top
View user's profile Send private message
jwatte
DeleD PRO user


Joined: 26 Apr 2006
Posts: 513

PostPosted: Mon Jul 16, 2007 7:20 am    Post subject: Reply with quote

If you're calling the MS XML interface, you need to call CoInitialize() before you call MS.

However, I would recommend using XML-SCAN instead, which is part of my nuxporter plug-in. It's a lot less overhead, and faster. Also, if you start with the nuxporter project as template, you already get access to the DeleD scene, because it does the parsing for you.
Back to top
View user's profile Send private message
fik
Member


Joined: 11 Oct 2006
Posts: 303

PostPosted: Mon Jul 16, 2007 10:22 am    Post subject: Reply with quote

Thanks for reply jwatte. Unfortunatly i am using Turbo Delphi and i am trying to make a importer so i cannot make use of your code as C++ eludes me at the moment. I am using MS XML and i can not find anything about coinitialize in borlands help. I am quiet new to delphi programming so i am no doubt missing it .
Back to top
View user's profile Send private message
Mr.Fletcher
DeleD PRO user


Joined: 07 Aug 2004
Posts: 1772
Location: Germany

PostPosted: Mon Jul 16, 2007 10:38 am    Post subject: Reply with quote

You can have a look at http://destructor.de/xmlparser/index.htm , it's a XML parser which I use for my plugins.
_________________
Behold! The DeleD Wiki! Please help us expanding it Smile
DeleD on IRC
Back to top
View user's profile Send private message
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Mon Jul 16, 2007 5:54 pm    Post subject: Reply with quote

Turbo Delphi most certainly supports coinitialize, it is part of the Windows 32 API. The reason why you cannot find it in the help is that the standard Delphi help does not contain the Win32 help, it's a separate helpfile with the older Delphi's, not sure about Turbo Delphi. Also, older Delphi's did suport Win32 context-help (i.e. type coinitialize in the IDE, put cursor in it, hit F1)... but again, the latest Delphi helpsystem might not support that (it is not as convenient as it used to be back in the good old .hlp days).

Anyway, back ontopic: To use coinitialize, use the unit ActiveX (or Ole2 if you are 'oldschool'). Every thread in your application should coinitialize( nil ) and couninitialize. Inside a .EXE, the Delphi RTL takes care of this, but inside a DLL (or if you use multiple threads), you have to do it yourself.

Hope that helps. Using a non-COM XML parser, like Mr Fletcher suggests, will also solve your problem... but knowing how coinitialize works is useful anyway!
Back to top
View user's profile Send private message Visit poster's website
fik
Member


Joined: 11 Oct 2006
Posts: 303

PostPosted: Mon Jul 16, 2007 6:21 pm    Post subject: Reply with quote

Thanks Mr.Fletcher But I don't seam to be able to get this to work in turbo as it wont allow 3rd party Packages.

Thanks Paul_Jan i think i understand now. will give it a go fingers crossed.
Back to top
View user's profile Send private message
Mr.Fletcher
DeleD PRO user


Joined: 07 Aug 2004
Posts: 1772
Location: Germany

PostPosted: Mon Jul 16, 2007 9:04 pm    Post subject: Reply with quote

You can just use the units, you don't need to install it as packages. Just put them in a directory where the compiler finds them and ad LibXML (or how the unit is called) to the uses section.
_________________
Behold! The DeleD Wiki! Please help us expanding it Smile
DeleD on IRC
Back to top
View user's profile Send private message
fik
Member


Joined: 11 Oct 2006
Posts: 303

PostPosted: Mon Jul 16, 2007 10:27 pm    Post subject: Reply with quote

I'll try that too Thanks
Back to top
View user's profile Send private message
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Tue Jul 17, 2007 8:01 pm    Post subject: Reply with quote

Fik, if you are really stuck with some specific Delphi problem, you can always send me the source (paul [at] delgine [dot] com). I'll fix the problem and return the files to you... Just have to promote our favourite development language! Very Happy
Back to top
View user's profile Send private message Visit poster's website
fik
Member


Joined: 11 Oct 2006
Posts: 303

PostPosted: Tue Jul 17, 2007 9:40 pm    Post subject: Reply with quote

Thanks for that offer Paul-Jan I think i have solved that problem now (did have some problem with couninitialize causing an error Think that Cured to). Will keep plugin away Very Happy but if .....
Back to top
View user's profile Send private message
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Wed Jul 18, 2007 7:20 am    Post subject: Reply with quote

Ah good job. If there is any problems, just ask away.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Plugins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum