Quantcast
Channel: Mentor Graphics Communities: Message List
Viewing all articles
Browse latest Browse all 4541

Re: More 7.9.x to VX translations

$
0
0

Well I translated your code to C# and I got this

 

string SDD_HOME_env_var = Environment.GetEnvironmentVariable("SDD_HOME");

            if (String.IsNullOrEmpty(SDD_HOME_env_var))

            {

               //MGCPCBReleaseEnvServer vxEnv = new MGCPCBReleaseEnvServer();

                var vxEnv = new MGCPCBReleaseEnvironmentLib.MGCPCBReleaseEnvServer();

                vxEnv.SetEnvironment();

 

 

                SDD_HOME_env_var = vxEnv.sddHome;

                int idx = SDD_HOME_env_var.IndexOf("SDD_HOME");

                SDD_HOME_env_var = SDD_HOME_env_var.Substring(0, idx).Replace(@"\", @"\\") + "SDD_HOME";

                vxEnv.SetEnvironment(SDD_HOME_env_var);

            }

 

Trying to set the vxEnv variable I always get the error "A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll"

 

I have two lines there for setting the vxEnv variable, first one is currently commented out but should work as well.  I also get the same COMException error here.

 

I have the MGCPCBReleaseEnvironmentLib referenced for this project as well.  Am I missing a reference maybe?


Viewing all articles
Browse latest Browse all 4541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>