SavingAs from RawComponent

Peter Volgyesi xvolgy at isis-server.isis.vanderbilt.edu
Wed Sep 24 10:33:00 CDT 2003



----------
From: 	Peter Volgyesi
Sent: 	Wednesday, September 24, 2003 2:33:00 AM
To: 	GME Group
Subject: 	Re: SavingAs from RawComponent 
Auto forwarded by a Rule

// Warning: this is untested code, minor errors might be included, but the
general idea is this:
try {
    CComPtr<IMgaProject> mgaProject = ...;
    CComBSTR    connString;
    COMTHROW(mgaProject->get_ProjectConnStr(&connString));

    CString backupName = connString;
    int p = backupName.ReverseFind('.');
    if (!p || backupName.Find('\\',p) != -1) {
        p = backupName.GetLength();
    }
    backupName.Insert(p, "_bak");

    CComBSTR newconnString(backupName);
#pragma warning(disable: 4310) // cast truncates constant value
    COMTHROW(mgaProject->Save(newconnString, VARIANT_TRUE));
#pragma warning(default: 4310) // cast truncates constant value
}
catch (hresult_exception &e) {
    ....
}


----- Original Message -----
From: GME Group
To: GME List
Sent: Tuesday, September 23, 2003 3:23 PM
Subject: FW: SavingAs from RawComponent





----------
From:   Sandeep Neema
Sent:      Tuesday, September 23, 2003 8:23:57 AM
To:       GME Group
Subject:       SavingAs from RawComponent
Auto forwarded by a Rule


COM/GME experts:
I have a raw-component (UDM-based, thanks to Adi) interpreter that has to
modify the model. I would like to save this model before I start modifying
it. I have noticed that the IMgaProject interface has a Save method, which
also accepts a filename. Is this the right one to use? Has anyone used this
before? Also is there a way to retrieve the opened project file name, I
would ideally like to get the opened project filename, and save it as the
current project name extended with _bak. I would appreciate any help by way
of code snippets :-)

Thanks
Sandeep


--
Sandeep Neema
Research Scientist,
Institute of Software Integrated Systems, Vanderbilt University
Phone: 615-343-9996
Email: sandeep.k.neema at vanderbilt.edu




More information about the gme-users mailing list