Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic TAU (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 12-Dec-2006 18:17
User is offline View Users Profile Print this message


Mickael Albert

Posts: 1
Joined: 5-Sep-2006

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
Report this to a Moderator Report this to a Moderator
 14-Dec-2006 02:18
User is offline View Users Profile Print this message


Ian Barnard

Posts: 91
Joined: 4-Jul-2002

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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic TAU forum.
There are currently 1 users logged in.
The most users ever online was 15 on 31-Mar-2008 at 16:22.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.