The code is as follows...
public bool ImportSoftware(SMSLoad mySMSLoad)
{
...
try
{
StreamReader pdfStream = new StreamReader(<PDFFilePath>);
strPDFContent = pdfStream.ReadToEnd();
pdfStream.Close();
}
catch (IOException exp)
{
...
return false;
}
try
{
ObjectGetOptions myOpts = new ObjectGetOptions();
InvokeMethodOptions myInvokeOpts = new InvokeMethodOptions();
myInvokeOpts.Timeout = new TimeSpan(0, 0, 30);
ManagementClass pdfClass = new ManagementClass
(objServ.Path.NamespacePath, "SMS_PDF_Package", myOpts);
ManagementBaseObject inParams = pdfClass.GetMethodParameters
("LoadPDF");
inParams["PDFFileName"] = <PDFFileName>;
inParams["PDFFile"] = strPDFContent;
ManagementBaseObject outParams =
pdfClass.InvokeMethod("LoadPDF", inParams, myInvokeOpts);
inParams = pdfClass.GetMethodParameters("GetPDFData");
inParams["PDFID"] = outParams["PDFID"];
ManagementBaseObject pdfReturn =
pdfClass.InvokeMethod("GetPDFData",inParams, myInvokeOpts);
....
end code.
pdfReturn contains ManagementBaseObjects. I want an SMS_package and
SMS_program(s) what do I do now (casting does not work and creating an
instance of SMS_package copying the properties and using put() does not
create the objects in SMS properly).
PS it's dead simple in VBS !
I am running into the same issue.
How you found a solution for this?
Thanks in advance
Bruno Stampfli
--
Message posted using http://www.talkaboutsoftware.com/group/microsoft.public.sms.tools/
More information at http://www.talkaboutsoftware.com/faq.html