[mapguide-users] RE: [mapguide-dev] How to call the load procedure from program???
Tom Fukushima
tom.fukushima at autodesk.com
Tue Jul 11 13:40:57 EDT 2006
Hi Rasel,
As well as the suggestions from Bill below, you will also need to add
the location of the FDO files to your path so that the API can find
them.
In C# ...
string fdoPath = Path.Combine(Application.StartupPath, @"FDO\");
string val = Environment.GetEnvironmentVariable("PATH");
val = fdoPath + ";" + val;
SetEnvironmentVariable("PATH", val);
In managed C++, the changes would be...
Add the following line at the top of the source file:
#undef GetEnvironmentVariable
Add the following lines in your code, it only needs to be executed once,
so somewhere during initialization is fine:
// Put our installed FDO in the process PATH
String * dirApp =
System::IO::Path::GetDirectoryName(System::Reflection::Assembly::GetExec
utingAssembly()->Location);
String * fdoPath = System::IO::Path::Combine(dirApp, "FDO\\");
String * val = Environment::GetEnvironmentVariable("PATH");
val = String::Concat(fdoPath, ";", val);
Environment::SetEnvironmentVariable("PATH", val);
The above is no longer required for current builds of the Studio API,
but unfortunately is required for the preview version (168.02).
Tom
_____
From: Bill Dhimitri
Sent: Tuesday, July 11, 2006 7:41 AM
To: Rasel Md. Anawer TMN Technical; users at mapguide.osgeo.org
Subject: [mapguide-users] RE: [mapguide-dev] How to call the load
procedure from program???
Hi Rasel,
It could be that you do not have the DLLs that are needed by
SDFConverter.dll in the EXE folder.
There are 2 ways to fix this. You can do number 1 or number 2 (but
don't do both):
1. Make sure that when you build your code, the Visual Studio
project Output Folder is the MG Studio bin folder.
2. Copy all the files in your MG Studio bin folder into your Visual
Studio project Output Folder.
By the way, you should post these questions to users at mapguide.osgeo.org
instead of dev at mapguide.osgeo.org.
Bill
_____
From: Rasel Md. Anawer TMN Technical
[mailto:rasel.anawer at grameenphone.com]
Sent: Monday, July 10, 2006 11:39 PM
To: dev at mapguide.osgeo.org; Bill Dhimitri
Subject: [mapguide-dev] How to call the load procedure from program???
Hi Bill,
Thanks for your reply.
I have tried that and found error.
My Code
------------------------------------------
LoadProcedureInfo lpi =
sc.NewLoadProcedureInfo("Library://hiT/Loaders/hiTDataLoader");
SdfLoadProcedure sdfldpr = (SdfLoadProcedure)SdfSerializer.Open(lpi);
sdfldpr.SdfKeyTreatment = SdfKeyTreatment.AutogenerateAll;
sdfldpr.Generalization = 100;
sdfldpr.Execute(sc);
Exception
-------------------------------------------
The specified module could not be found. (Exception from HRESULT:
0x8007007E)
at
Autodesk.MapGuide.Studio.Load.SdfLoadProcedure.ProcessSourceFile(Package
Writer package, String filePath, SiteConnection connection)
at Autodesk.MapGuide.Studio.Load.LoadProcedure.Execute(String
packageFilePath, SiteConnection connection)
at Autodesk.MapGuide.Studio.Load.LoadProcedure.Execute(SiteConnection
connection)
at SDFLoader.Program.Main(String[] args) in C:\Documents and
Settings\Administrator\My Documents\Visual Studio
2005\Projects\SDFLoader\SDFLoader\Program.cs:line 40
Desc
--------------------------
I have a load procedure at - "Library://hiT/Loaders/hiTDataLoader". No
problem about that.
My variables - lpi, sdfldpr is initiated successfully. No problem about
that.
Please help. ...
MD. RASEL ANAWER
System Engineer, TMN, TD,
GrameenPhone Ltd.
Mobile : +8801711506316
E-mail: rasel.anawer at grameenphone.com
Date: Mon, 10 Jul 2006 13:04:02 -0400
From: Bill Dhimitri <bill.dhimitri at autodesk.com>
Subject: [mapguide-dev] How to call the load procedure from program???
Hi Rasel,
MapGuide Studio provides an API that allows you to programmatically load
an SDF file. Go to the Studio API Help, and look up (in the index) the
SdfLoadProcedure class.
Bill
_____
From: Rasel Md. Anawer TMN Technical
[mailto:rasel.anawer at grameenphone.com]
Sent: Monday, July 10, 2006 7:49 AM
To: dev at mapguide.osgeo.org
Subject: [mapguide-dev] How to call the load procedure from program???
Hi,
I have a load procedure which loads a SDF file and generate Data and
Layer only.
How to call the load procedure from program???
Please help and thanks in advance...
MD. RASEL ANAWER
System Engineer, TMN, TD,
GrameenPhone Ltd.
Mobile : +8801711506316
E-mail: rasel.anawer at grameenphone.com
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to which they
are addressed. It may also be legally privileged. If you are not the
named addressee, you should not copy, forward, disclose or use any part
of it. If you have received this message in error, please delete it and
all copies from your system and notify the sender immediately by return
e-mail. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for
any errors or omissions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide_users/attachments/20060711/2be7bd53/attachment.html
More information about the Mapguide_users
mailing list