我们有一个大的32位MFC / COM应用程序,使用互操作调用.NET dll。它适用于2k(服务器和客户端),XP和& WIN2K3。我们一直在Server 2008和它上面进行测试。 Win7&它挂了 ntdll.dll中的异常0xc0000005。 尝试从COM应用程序的菜单运行它后,当我们关闭COM应用程序时,它也会挂起。 有谁知道2008年和2008年的任何具体问题。互操作,说与UAC或权限(或其他任何事情!)? .NET应用程序调用COM应用程序,并由它启动,但它到目前为止工作正常,没有可见的错误。我希望我能提供更多错误的详细信息,但唯一的具体信息似乎是事件日志错误。顺便说一句,COM应用程序在Win2008上完美运行。 .NET应用程序无法在32位或64位版本的Win2008上运行。 如果人们告诉我他们想要什么,我会提供更多信息......
它现在在.NET 3.5上编译(&编译为版本2),这两个版本都在2008机器上(刚看过)。我正在使用适当的.NET安装中的gacutils等版本
为x86编译。就UAC而言 - 我不熟悉它的编程方面,我认为它有一个.NET API,但是,Access Denied。我将不得不更多地了解UAC学习曲线(这也让我想知道我正在做什么可能需要提升的私有,也许Win32 prog要求它们。)我见过{{3谈到使用清单时。当我回到我的工作机器时(第二天下午22点关闭)我将发布一个电话堆栈&我能想到的任何其他内容都可能有所帮助。感谢您的关注,人们
MFC / COM应用程序中的调用代码:
void CMainFrame::OnTransportResourcetrackingGanntchart()
{
HRESULT hr = m_spGant.CreateInstance(__uuidof(Fgant::Control_Gant));
ASSERT(SUCCEEDED(hr));
m_spGant->Control_Run();
//m_spGant = NULL;
}
Relevant code in FGant.dll
using GlobvarsLib;//as well as the .NET declarations
// COM dll containing system-wide properties imported using tlbimp
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
[Guid("A4586AC8-BC1D-4cbe-83CA-4F2A56F0E964")]
public interface IGantControl
{
/// <summary>
/// method to run Fgant from external application
/// </summary>
void Control_Run();
}
/// <summary>
/// Control_Gant constructor
/// </summary>
[ClassInterface(ClassInterfaceType.None)]
[Guid("BC4CF302-A973-445d-82BE-1BF0B4873D90")]
public class Control_Gant : IGantControl
{
/// <summary>
/// Default constructor
/// </summary>
public Control_Gant() { }
[STAThread]
void IGantControl.Control_Run()
{
Fgant gantt = new Fgant(true); //Inits Component,Calls PlotGantt with default date values
DateTime startdate, enddate;
int MinsLength = 15;
startdate = gantt.Start;
enddate = gantt.End;
//Add 23:59:59 to enddate
enddate = enddate.Date.AddSeconds(86399);
gantt.BlobDivisor = 24;
gantt.CentreGantt();
gantt.VehicleRadioChecked = true;
try
{
ResPlot res = new ResPlot(gantt.ResType());
//See below for PlotGantt code
gantt.PlotGantt(startdate, enddate, MinsLength, ResPlot.WhereClause, ResPlot.TitleString, ResPlot.ResType);
Application.EnableVisualStyles();
GlobalClass pGlobal = new GlobalClass();
IntPtr pWnd = (IntPtr)pGlobal.get_MainWindow();
NPlot.PointPlot.Active_Handle = pWnd;
SwiftWindow sw = new SwiftWindow(pWnd);//'MainFrame' app window
gantt.Show(sw);
}
PlotGantt snippet:
GantUtils g = new GantUtils(); //Class that contains the DB conn.string from Globvarslib(i.e from the calling app)
string ConnString = g.DBString;
string selectCommand = String.Concat("SELECT StartDateTime, EndDateTime, Stage.Description, ", ResourceName, ", LoadNumber ",
Rigid, " , ROUND(((DATEDIFF(minute,StartDateTime,EndDateTime))/", MinsLength.ToString(), " ),0) AS \"StageDiff\" ",
", '1' AS \"Orig_Row\", Stage.Type AS \"SType\" FROM Stage ", selectString, " AND StartDateTime >= '",
Startdt.ToString(), "' AND EndDateTime <= '", Enddt.ToString(), "' ORDER BY ", ResourceName, Rigid, ",Stage.Type, StartDatetime,EndDateTime");
// MessageBox.Show(selectCommand);
OleDbDataAdapter dataAdapter = new OleDbDataAdapter(selectCommand, ConnString);
dataAdapter.Fill(table);
DBString code calling Glovarslib(In GantUtils()):
public string ConnectionString()
{
GlobalClass pGlobal = new GlobalClass();
string conn_string = "FILE NAME=" + pGlobal.UDLRootPath+pGlobal.SupportDir + SwiftDatabaseUDL;
return conn_string;
}
我怀疑它一旦获得conn_string(它涉及互操作的第一件事)或者它在数据库上执行SELECT时可能会失败
(跟随调用堆栈)