Jump to content
Sign in to follow this  
step887

AutoItObject UDF help?

Recommended Posts

step887

so I am trying to do this 

http://msdn.microsoft.com/en-us/library/windows/hardware/ff547694(v=vs.85).aspx

in Autoit

With the autoitobject UDF, there is a _AutoItObject_CoCreateInstance, but the issue is that I can not find CLSID of CLSID_CNetCfg,

The closet I found was http://svn.dsource.org/projects/bindings/trunk/uuid_obj.d

const IID CLSID_CNetCfg = {0x6152035B, 0xF940, 0xD111, [0xAA, 0xEC, 0x00, 0x80, 0x5F, 0xC1, 0x27, 0x0E]};
 

but I am not sure how to translate that into CLSID that can be read by _AutoItObject_CLSIDFromString

Any help is appreciated.

Thanks,

Stephen

 

Share this post


Link to post
Share on other sites
trancexx

Don't use AutoItObject for that. Use built-in function ObjCreateInterface.

And to get that GUID in string form just write it without "0x" formatted like this:

 

"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
step887

Thanks for replying, still having troubles..

so based the below data I created this

$CLSID_CNetCfg = '{6152035B-F940-D111-AAEC-00805FC1270E}'
$IID_INetCfg = '{93AEE8C0-6E30-D111-AACF-00805FC1270E}'
$sTagINetCfg = "Initialize hresult(ptr); Uninitialize hresult(); Apply hresult(); Cancel hresult(); EnumComponents hresults(clsid*;ptr); FindComponent hresults(wstr*;ptr); QueryNetCfgClass hresults(clsid*;ptr;ptr);"
$o = ObjCreateInterface($CLSID_CNetCfg , $IID_INetCfg, $sTagINetCfg); [,"interface_description", ["flag"]] )
If @error Then MsgBox(0,@error,isobj($o))

ObjCreateInterface returns @error of 1

So any help will be appreciated..

 

 

http://msdn.microsoft.com/en-us/library/windows/hardware/ff547694(v=vs.85).aspx

 

HRESULT Initialize(
  [in]  PVOID pvReserved

};

HRESULT Uninitialize(
  void
);HRESULT Apply(
  void
);

HRESULT Cancel(
  void
);
HRESULT EnumComponents(
  [in]             const GUID *pguidClass,
  [out, optional]  IEnumNetCfgComponent **ppenumComponent
);
HRESULT FindComponent(
  [in]             LPCWSTR pszwComponentId,
  [out, optional]  INetCfgComponent **ppComponent
);

HRESULT QueryNetCfgClass(
  [in]             const GUID *pguidClass,
  [in]             REFIID riid,
  [out, optional]  void **ppvObject
);



 

Share this post


Link to post
Share on other sites
trancexx

I'm not sure where did you get those GUIDs from. Try these:

$CLSID_CNetCfg = "{5B035261-40F9-11D1-AAEC-00805FC1270E}"
$IID_INetCfg = "{C0E8AE93-306E-11D1-AACF-00805FC1270E}"

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
trancexx

That's the same thing only I used Microsoft's endian. Your GUIDs are written in binary format which is RFC 4122 compliant (big endian for all).


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×