AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

COM Standard Library
Goto page Previous  1, 2, 3 ... 9, 10, 11 ... 13, 14, 15  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
tank



Joined: 21 Dec 2007
Posts: 797

PostPosted: Tue Jul 08, 2008 12:57 pm    Post subject: Reply with quote

actually its the debugging thats to thank given im a raving idiot i would have never figured this out without it
theanks for the COM_Error()
_________________
Read this
Com
Automate IE7 with Tabs
Back to top
View user's profile Send private message
ahklerner



Joined: 26 Jun 2006
Posts: 1219
Location: USA

PostPosted: Fri Jul 11, 2008 6:32 am    Post subject: Reply with quote

api file for com.ahk. you can add it to the download if you want.

Code:
/* api for com.ahk
COM_Unicode2Ansi( wString, sString [ , nSize ] )
COM_Ansi2Unicode( sString, wString [ , nSize ] )
COM_Unicode4Ansi( wString, sString [ , nSize ] )
COM_Ansi4Unicode( pString [ , nSize )
COM_AtlAxGetContainer( pdsp )
COM_AtlAxCreateContainer( hWnd, l, t, w, h [ , Name , Version ] )
COM_AtlAxCreateControl( hWnd, Name [ , Version ] )
COM_AtlAxAttachControl( pdsp, hWnd [ , Version ] )
COM_AtlAxGetControl( hWnd [ , Version ] )
COM_AtlAxWinTerm(  [ Version ] )
COM_AtlAxWinInit(  [ Version ] )
COM_VariantClear( pvarg )
COM_SafeArrayDestroy( psa )
COM_SysStringLen( bstr )
COM_SysFreeString( bstr )
COM_SysAllocString( sString )
COM_OleUninitialize(  )
COM_OleInitialize(  )
COM_CoUninitialize(  )
COM_CoInitialize(  )
COM_CoTaskMemFree( pv )
COM_CoTaskMemAlloc( cb )
COM_CoCreateGuid(  )
COM_IsEqualGUID( pGUID1, pGUID2 )
COM_String4GUID( pGUID )
COM_ProgID4CLSID( pCLSID )
COM_GUID4String( CLSID, String )
COM_CLSID4ProgID( CLSID, ProgID )
COM_GetActiveObject( ProgID )
COM_GetObject( Moniker )
COM_ActiveXObject( ProgID )
COM_CreateObject( CLSID [ , IID , CLSCTX ] )
COM_ConnectObject( psource [ , prefix , DIID ] )
COM_GetTypeInfoOfGuid( pdisp, GUID [ , LCID ] )
COM_GetGuidOfName( pdisp, Name [ , LCID ] )
COM_GetDefaultEvents( pdisp [ , LCID ] )
COM_GetDefaultInterface( pdisp [ , LCID ] )
COM_CreateIDispatch(  )
COM_DispGetParam( pDispParams [ , Position = 0, vtType = 8 )
COM_DispInterface( this [ , prm1 , prm2 , prm3 , prm4 , prm5 , prm6 , prm7 , prm8 )
COM_Invoke_( pdisp, sName [ , type1 ,arg1 ,type2 ,arg2 ,type3 ,arg3 ,type4 ,arg4 ,type5 ,arg5 ,type6 ,arg6 ,type7 ,arg7 ,type8 ,arg8 ,type9 ,arg9 )
COM_Invoke( pdisp, sName [ , arg1 ,arg2 ,arg3 ,arg4 ,arg5 ,arg6 ,arg7 ,arg8 ,arg9 )
COM_Enumerate( penum, Result )
COM_Unadvise( pcp, nCookie )
COM_Advise( pcp, psink )
COM_GetConnectionInterface( pcp )
COM_FindConnectionPoint( pdp, DIID )
COM_QueryService( ppv, SID [ , IID ] )
COM_Release( ppv )
COM_AddRef( ppv )
COM_QueryInterface( ppv, IID )
COM_VTable( ppv, idx )
COM_Term(  [ bOLE ] )
COM_Init(  [ bOLE ] )
*/

_________________
Back to top
View user's profile Send private message
Krogdor



Joined: 18 Apr 2008
Posts: 1016
Location: The Interwebs

PostPosted: Thu Jul 17, 2008 10:24 am    Post subject: Reply with quote

Hi Sean,
I have a COM question. id3lib says it has a COM wrapper included. In the download it has a folder called "id3com" which... has a lot of files in it. Even if you take out the ones that don't have COM in the name, I end up with 8 files (various extensions). So, I was wondering... how this "COM wrapper" can be converted to AHK x_x
Back to top
View user's profile Send private message AIM Address
Sean



Joined: 12 Feb 2007
Posts: 1359

PostPosted: Thu Jul 17, 2008 3:27 pm    Post subject: Reply with quote

Krogdor wrote:
id3lib says it has a COM wrapper included. In the download it has a folder called "id3com" which... has a lot of files in it.
They are source files, you have to compile them to id3com.dll.
Back to top
View user's profile Send private message
Krogdor



Joined: 18 Apr 2008
Posts: 1016
Location: The Interwebs

PostPosted: Sat Jul 19, 2008 7:00 am    Post subject: Reply with quote

Ah, I see.

Sorry for my complete ignorance, but I've never done any type of programming besides AHK—so, how exactly do I compile them? =x

Also, how do I use them with AHK COM once they have been compiled?
Back to top
View user's profile Send private message AIM Address
Sean



Joined: 12 Feb 2007
Posts: 1359

PostPosted: Sat Jul 19, 2008 11:29 am    Post subject: Reply with quote

Krogdor wrote:
Also, how do I use them with AHK COM once they have been compiled?
Well, register and use it. That's all I can say at this level.
Back to top
View user's profile Send private message
Joy2DWorld



Joined: 04 Dec 2006
Posts: 423
Location: Galil, Israel

PostPosted: Sat Jul 19, 2008 9:07 pm    Post subject: Reply with quote

the download site has pre-compiled windows binaries.

if you don't know how to use them.... why did you want them ?


ps: look at their documentation for API, and use com_invoke() on the com objects.
_________________
Joyce Jamce
Back to top
View user's profile Send private message
Krogdor



Joined: 18 Apr 2008
Posts: 1016
Location: The Interwebs

PostPosted: Sun Jul 20, 2008 5:47 am    Post subject: Reply with quote

Joy2DWorld wrote:
the download site has pre-compiled windows binaries.

if you don't know how to use them.... why did you want them ?


ps: look at their documentation for API, and use com_invoke() on the com objects.

going in order of what you said:

Ah. I saw one for the normal .dll, but I didn't see one for com... is it the same thing? =x Sorry, I really have no knowledge in this area.
Edit: Nvm on the above. Just did a bit of googling and found an id3com.dll

Because I want to learn how to use them Razz

Yes, I know that. I meant more along the lines of, will I just be able to invoke it if the .dll is in the same file as the script, or is it necessary to somehow make COM recognize the .dll

And, @ Sean- Register? I know (sort of) how to use it. This "registering" is really what I'm trying to figure out how to do.
Back to top
View user's profile Send private message AIM Address
Sean



Joined: 12 Feb 2007
Posts: 1359

PostPosted: Sun Jul 20, 2008 10:35 am    Post subject: Reply with quote

Krogdor wrote:
I know (sort of) how to use it. This "registering" is really what I'm trying to figure out how to do.
The simplest way is
Code:
regsvr32.exe id3com.dll
Back to top
View user's profile Send private message
Krogdor



Joined: 18 Apr 2008
Posts: 1016
Location: The Interwebs

PostPosted: Thu Jul 24, 2008 3:23 am    Post subject: Reply with quote

Great! Thanks!

Now... I need a little help with syntax >< The help file for id3lib says:

Quote:
Almost all functionality occurs via an ID3_Tag object. An ID3_Tag object basically encapsulates two things: a collection of ID3_Frame objects and file information. The goal is to populate an ID3_Tag object with ID3_Frame objects, and the easiest way to do this is to associate the tag with a file. This is done primarily via the ID3_Tag constructor, like so:
Code:
   ID3_Tag myTag("song.mp3");

This constructor links, or associates, the object myTag with the file "song.mp3". In doing so, the tagging information from "song.mp3" is parsed and added to myTag. This association can also be accomplished by creating an empty tag and making an explicit call to Link().
Code:
   ID3_Tag myTag;
   myTag.Link("song.mp3");


From guessing and looking at another COM library (the Word functions) I have come up with this, but I know I'm doing something wrong:

Code:
Run, regsvr32.exe "%A_ScriptDir%\myTunesResource\id3com.dll"
WinWaitActive, RegSvr32
Send, {Enter}
COM_CreateObject("ID3_Tag", "myTag")
COM_Invoke("myTag", "Link=", A_ScriptDir "\Song.mp3")


Could you give me a little direction?
Back to top
View user's profile Send private message AIM Address
Sean



Joined: 12 Feb 2007
Posts: 1359

PostPosted: Thu Jul 24, 2008 1:04 pm    Post subject: Reply with quote

Krogdor wrote:
Could you give me a little direction?
You must learn first how to use COM, e.g. in VBScript or JScript.
Back to top
View user's profile Send private message
Krogdor



Joined: 18 Apr 2008
Posts: 1016
Location: The Interwebs

PostPosted: Thu Jul 24, 2008 9:03 pm    Post subject: Reply with quote

Well, I'm trying to learn how to use COM, as you can see... Is there a reason why I have to learn it in VBS or JS first, rather than AHK?
Back to top
View user's profile Send private message AIM Address
tank



Joined: 21 Dec 2007
Posts: 797

PostPosted: Thu Jul 24, 2008 10:18 pm    Post subject: Reply with quote

Krogdor wrote:
Well, I'm trying to learn how to use COM, as you can see... Is there a reason why I have to learn it in VBS or JS first, rather than AHK?
I got this ... in short yes
because you need that basic object oriented programing knowledge to underastand these com functions in ahk
and i seriously doubt that sean or any one really has time to teach you OOP in adition to the use of these functions.

here is a short example
Code:
 oIE=CreateObject("InternetExplorer.Application")
oIE.Visible=True
vb for start an instance of internet explorer and return the application automation pointer then take the object oIE and set the Visible Property to true
as ahk com function
Code:
   oIE := COM_CreateObject("InternetExplorer.Application")
   COM_Invoke(oIE, "Visible=", "True")

these both do the same thing
i hope you can see how the 2 are related
now here is the clincher
most of the documentation for using win32 com interface is written for the c++ vb and js coder so its imperitive that you learn from the documentation in the languages the documentation supports
from there you can make the short leap to Sean's most excelent library

What do ya think sean is that a good break down Wink
_________________
Read this
Com
Automate IE7 with Tabs
Back to top
View user's profile Send private message
Krogdor



Joined: 18 Apr 2008
Posts: 1016
Location: The Interwebs

PostPosted: Thu Jul 24, 2008 10:37 pm    Post subject: Reply with quote

Okay, so it should be something more like
Code:
myTag := COM_CreateObject("ID3_Tag")
COM_Invoke(myTag, "Link=", A_ScriptDir "\Song.mp3")


Well anyway. I guess I'll just experiment, since I would rather not learn a new language and so far I haven't even been able to get someone to tell me which part of my two COM lines are incorrect ._. And I think I found some VB COM documentation which should be much easier to use than the C++ docs.
Back to top
View user's profile Send private message AIM Address
tank



Joined: 21 Dec 2007
Posts: 797

PostPosted: Thu Jul 24, 2008 11:05 pm    Post subject: Reply with quote

knowing absolutely nothing about the dll i do see a basic syntax isue
Code:
Run, regsvr32.exe "%A_ScriptDir%\myTunesResource\id3com.dll"
WinWaitActive, RegSvr32
Send, {Enter}
COM_CreateObject("ID3_Tag", "myTag")
COM_Invoke("myTag", "Link=", A_ScriptDir "\Song.mp3")

should be
Code:
Run, regsvr32.exe "%A_ScriptDir%\myTunesResource\id3com.dll"
WinWaitActive, RegSvr32
Send, {Enter}
myTag:=COM_CreateObject("ID3_Tag.myTag")
COM_Invoke(myTag, "Link=", A_ScriptDir  . "\Song.mp3")

altho i have a hard time beleiving that mytag is a automation object pointer its usually soemthing like system or application etc
_________________
Read this
Com
Automate IE7 with Tabs
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3 ... 9, 10, 11 ... 13, 14, 15  Next
Page 10 of 15

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group