![]() |
Telelogic TAU (steve huntington) | ![]() |
profile :
search :
help :
dashboard :
calendar :
home
|
||
|
Topic Title: GUID Converting Topic Summary: How make a converting between GUID and tstring Created On: 12-Dec-2006 18:17 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I just started to use the C++ API for Tau and I'm blocked on this problem :
- To find a ITtdEntity we can use the method FindByGuid of a ITtdModel, which uses a tstring guid
- To read the guid of an ITtdEntity, I just found the attribute guid, which has for type GUID.
In this way, how can I convert GUID to tstring, and the inverse, tstring to GUID?
Thanks
|
|
![]() |
|
![]() |
|
Michael
I don't know if this helps, but in the installation examples directory (e.g. C:\Program Files\Telelogic\TAU_2.7\examples\comIDLGen\Src) in the file IDLGen.cpp is an example of using FindByGuid. Here's a fragment showing the bit you are interested in: void CIDLGen::Generate(const CComBSTR& projectPath, const CComBSTR& profilePath, const CComBSTR& artifactGuid) { ITtdModelAccessPtr pITtdModelAccess; HRESULT hr = pITtdModelAccess.CreateInstance( __uuidof(TTD_ModelAccess)); if (FAILED(hr)) { // Cannot create COM object exit(-1); } try { // Load project ITtdModelPtr pModel = pITtdModelAccess->LoadProject(BSTR(projectPath)); // Get artifact and IDL output file path ITtdEntityPtr pArtifact = pModel->FindByGuid(BSTR(artifactGuid)); ITtdEntityPtr pTagValue = pArtifact->GetTaggedValue("'@IDLGen@idlGenerator' (. .)", true); .... HTH Ian ------------------------- ============= Ian Barnard Principal Consultant Telelogic UK, an IBM company |
|
![]() |
Telelogic TAU
» TAU/Developer
»
GUID Converting
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.