FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Version 0.3
Goto page Previous  1, 2
 
Post new topic   This topic is locked: you cannot edit posts or make replies.     Forum Index -> Juno
View previous topic :: View next topic  
Author Message
yidabu



Joined: 21 Apr 2007
Posts: 87

PostPosted: Mon Jul 23, 2007 4:38 pm    Post subject: can not have parameter of type void Reply with quote

when I compiling mshtml.d with juno into juno.lib use DSSS, I have this error:
Quote:
mshtml.d(27565) : Error : can not have parameter of type void


Code:
int EscapeA(void* hKL, uint hIMC, uint uEscape, ref void pData, out LONG_PTR plResult);


the c++ version looks like this (from mshtml.h):

Code:
        virtual HRESULT STDMETHODCALLTYPE EscapeA(
            /* [in] */ HKL hKL,
            /* [in] */ HIMC hIMC,
            /* [in] */ UINT uEscape,
            /* [out][in] */ LPVOID pData,
            /* [out] */ LRESULT *plResult) = 0;
Back to top
View user's profile Send private message
John



Joined: 17 Jan 2006
Posts: 75

PostPosted: Mon Jul 23, 2007 4:56 pm    Post subject: Reply with quote

You'll have to manually change "ref void" to "void*".

See the "[out][in]" attribute on the C++ version? Tlbimpd tries to be smart and applies "ref" to in/out parameters rather than putting pointers on everything. For "uint" that would be fine, but not for "void". I'll see if I can make void a special case.
Back to top
View user's profile Send private message
yidabu



Joined: 21 Apr 2007
Posts: 87

PostPosted: Mon Jul 23, 2007 5:52 pm    Post subject: Reply with quote

John wrote:
See the "[out][in]" attribute on the C++ version?

yes!

I have this compile time error:
Quote:

errer: juno.com.client.EventProvider!(XMLDOMDocumentEvents).EventProvider.this(IUnknown) does not match parameter type ()


from:
http://www.dsource.org/projects/juno/wiki/ComProgramming
Code:


import std.stdio : writefln;
import juno.xml.msxml;
import juno.com.client;
import juno.com.core;

pragma(lib,"juno.lib");

int main()
{
   try
   {
      // Create an instance of IXMLDOMDocument3.
      IXMLDOMDocument3 doc = DOMDocument60.coCreate!(IXMLDOMDocument3);
        // Create an event provider instance.
      auto events = new EventProvider!(XMLDOMDocumentEvents);
      events.attach("onReadyStateChange", {writefln("state changed");});
      events.attach("onDataAvailable", {writefln("data available");});
      // Tell the document to load asynchronously.
      doc.set_aync(com_true);
      // Load the XML document.
      com_bool result;
      doc.load("books.xml".toVariant(true), result);
   }
   catch(Exception e)
   {
      printf("catch %.*s\n", e.msg);
   }
   finally
   {
      if (events) events.Release();
      if (doc) doc.Release();
   }
   return 0;
}

Back to top
View user's profile Send private message
John



Joined: 17 Jan 2006
Posts: 75

PostPosted: Tue Jul 24, 2007 2:46 am    Post subject: Reply with quote

Quote:
Code:
auto events = new EventProvider!(XMLDOMDocumentEvents);


That should be:

Code:
auto events = new EventProvider!(XMLDOMDocumentEvents)(doc);


and

Code:
doc.set_async(com_true);


You'll also need to rearrange your code to make it compile - your finally block refers to events and doc, which are out of scope.
Back to top
View user's profile Send private message
yidabu



Joined: 21 Apr 2007
Posts: 87

PostPosted: Tue Jul 24, 2007 5:38 am    Post subject: Reply with quote

John wrote:
You'll also need to rearrange your code to make it compile - your finally block refers to events and doc, which are out of scope.


thanks! I got it.

Code:
tlbimpd cdosys.dll

got cdo.d, I try to get a Early binding version of this:
http://www.dsource.org/projects/juno/wiki/Tutorials/LateBinding

then build cdo.d with juno into juno.lib use DSSS, I have this compile time error:
Quote:
identifier 'Fields' is not defined
...

a lot of identifiers are not defined, how to fix this?




a little suggestion about juno.io.path.getFolderPath
how about to add all CSIDL to SpecialFolder enum

Code:
//a little tedious
import win32.shlobj;    //for CSIDL
import juno.io.path;   
string profile = juno.io.path.getFolderPath( cast(SpecialFolder)CSIDL_PROFILE );


CSIDL from win32.shlobj:
http://www.prowiki.org/wiki4d/wiki.cgi?WindowsAPI
Code:

enum {
   CSIDL_DESKTOP = 0,
   CSIDL_INTERNET,
   CSIDL_PROGRAMS,
   CSIDL_CONTROLS,
   CSIDL_PRINTERS,
   CSIDL_PERSONAL,
   CSIDL_FAVORITES,
   CSIDL_STARTUP,
   CSIDL_RECENT,
   CSIDL_SENDTO,
   CSIDL_BITBUCKET,
   CSIDL_STARTMENU, // = 11
   CSIDL_DESKTOPDIRECTORY = 16,
   CSIDL_DRIVES,
   CSIDL_NETWORK,
   CSIDL_NETHOOD,
   CSIDL_FONTS,
   CSIDL_TEMPLATES,
   CSIDL_COMMON_STARTMENU,
   CSIDL_COMMON_PROGRAMS,
   CSIDL_COMMON_STARTUP,
   CSIDL_COMMON_DESKTOPDIRECTORY,
   CSIDL_APPDATA,
   CSIDL_PRINTHOOD,
   CSIDL_LOCAL_APPDATA,
   CSIDL_ALTSTARTUP,
   CSIDL_COMMON_ALTSTARTUP,
   CSIDL_COMMON_FAVORITES,
   CSIDL_INTERNET_CACHE,
   CSIDL_COOKIES,
   CSIDL_HISTORY,
   CSIDL_COMMON_APPDATA,
   CSIDL_WINDOWS,
   CSIDL_SYSTEM,
   CSIDL_PROGRAM_FILES,
   CSIDL_MYPICTURES,
   CSIDL_PROFILE,
   CSIDL_SYSTEMX86,
   CSIDL_PROGRAM_FILESX86,
   CSIDL_PROGRAM_FILES_COMMON,
   CSIDL_PROGRAM_FILES_COMMONX86,
   CSIDL_COMMON_TEMPLATES,
   CSIDL_COMMON_DOCUMENTS,
   CSIDL_COMMON_ADMINTOOLS,
   CSIDL_ADMINTOOLS,
   CSIDL_CONNECTIONS, // =49
   CSIDL_COMMON_MUSIC = 53,
   CSIDL_COMMON_PICTURES,
   CSIDL_COMMON_VIDEO,
   CSIDL_RESOURCES,
   CSIDL_RESOURCES_LOCALIZED,
   CSIDL_COMMON_OEM_LINKS,
   CSIDL_CDBURN_AREA, // = 59
   CSIDL_COMPUTERSNEARME = 61,
   CSIDL_FLAG_DONT_VERIFY = 0x4000,
   CSIDL_FLAG_CREATE = 0x8000,
   CSIDL_FLAG_MASK = 0xFF00
}
Back to top
View user's profile Send private message
John



Joined: 17 Jan 2006
Posts: 75

PostPosted: Tue Jul 24, 2007 6:42 am    Post subject: Reply with quote

Quote:
then build cdo.d with juno into juno.lib use DSSS, I have this compile time error:
Quote:
identifier 'Fields' is not defined
...

a lot of identifiers are not defined, how to fix this?


Run Tlbimpd with the /comments option. Then open cdo.d and look at the "importlib" statement. These indicate other type libraries on which there are dependencies. You can ignore stdole2.tlb (most of it is included in juno.com.core), but you'll need to run Tlbimpd on the others. Then add the newly generated modules to the list of imports in cdo.d.

Tlbimpd doesn't do this automatically (yet).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.     Forum Index -> Juno All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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


Powered by phpBB © 2001, 2005 phpBB Group