|
For an application running on two separate machines I use DCOM to communicate. On system 1 a CoClass exists, hosted in a COM server which acts as a singleton (using DECLARE_CLASSFACTORY_SINGLETON ATL). This CoClass is created from system 2 through DCOM, but also local by system 1.
Despite using the singleton classfactory still two instances of the CoClass exist in running server (one for all local system 1 clients, and one for all dcom clients). I've tried changing a number of security settings through DCOMCnfg but this didn't help (sometimes even ended up with two servers next to each other ).
Strange thing is that when the CoClass is first created through DCOM and later by the local user it all seems to work. The other way around however always creates two instances. Unfortunately both systems can be switched on or off seperately so the starting order isn't defined.
Current settings are:
Authentication Level - Connect
Impersonation Level - Identify
Identity - This user (same user as the local on system 1 also CoCreating the CoClass)
Both systems are using Windows XP SP2.
Anyone got any idea on why this doesn't work ( and hopefully knows how to solve ) ??
modified on Thursday, October 30, 2008 6:25 PM
|
|
|
|
|
Hello:
I'm not sure if this is the right posting area for this? I'm new to this sight and really green when it comes to command line. I'm a student and need help with a few questions. I have answered them but have questions on the last three. Forgive me if this is not the area to ask this.
I'm being asked to write five lines that would perform the following in a batch file.
1.Document the batch file explain that it is a demonstration file.
Rem Demonstration File
2. List the files in the A:\temp directory
dir A:\temp
3. Display the contents of a file in the a:\temp directory that is specfied when the batch file is called.
( This is were i have some questions)
Type %1 (is this correct?)
4. Rename the above file to name.new
without the ren is there another way of doing this?
5. Display the contents of the Name.New file.
Type Name.New (is this correct?)
Any help would be greatly appreciated !
|
|
|
|
|
Hi, all!
Help me please with ISpoolerHook. How to use it? Needs some examples... Thnks
|
|
|
|
|
Hi,
I have created a fully editable data using template columns for using it for data entry and editing.Can some one help to validate the data entered into the grid and also check for duplicates. I am reading all the data from the datagrid into a typed dataset for saving into database so essentially I need to check for duplicates in the dataset. My datagrid contains 2 columns and each column is a textbox to enter data.
Uday.
-UdayKiran
|
|
|
|
|
when i move a ocx control form my PC to a new computer, use "regsvr32 file.ocx", it show a error message of "loadlibrary("file.OCX")failure", but in my PC, it was working good not any failures.
can anyone help me to resolve this problem?
Thanks for you help.
|
|
|
|
|
Use Depends on the .ocx file to make sure that all of the dependencies are present on the target computer.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
It seems all dependencies is right, look as follows:
ADVAPI32.DLL
COMCTL32.DLL
GDI32.DLL
GISQCONTROL.DLL
GISQSTYLEDIALOG.DLL
KERNEL32.DLL
MFC42D.DLL
MFCO42D.DLL
MSIMG32.DLL
MSVCRT.DLL
MSVCRTD.DLL
NTDLL.DLL
OLE32.DLL
OLEAUT32.DLL
RPCRT4.DLL
SECUR32.DLL
USER32.DLL
GISQCONTROL.DLL and GISQSTYLEDIALOG.DLL, it my compiled com dll. is there any another issues in this case.
|
|
|
|
|
Try profiling it through "dependency walker". Open "regsvr32.exe" in depends and select "Start Profiling..." from the "Profile" menu. Pass the path to the OCX in the "Program arguments" box and click "OK". See what DW reports in the messages box. You should get a clue or two.
--
gleat
http://blogorama.nerdworks.in[ ^]
-- Number Two's eyes narrowed and became what are known in the Shouting and Killing People trade as cold slits, the idea presumably being to give your opponent the impression that you have lost your glasses or are having difficulty keeping awake. Why this is frightening is an, as yet, unresolved problem. -- HHGTG
|
|
|
|
|
Hi,
Can anybody please give me some free links to learn the topics VB6, ASP and COM. I dont have much idea of it as I am .Net programmer but I want to learn them.
Thanks,
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
I am getting this error while accessing the lotus notes. It is working fine when executes in my system but giving this error while executing in IIS virtual directory.
The error is
Retrieving the COM class factory for component with CLSID {29131539-2EED-1069-BF5D-00DD011186B7} failed due to the following error: 8007000e.
Source Error:
Line 22: protected void btnAddress_Click(object sender, EventArgs e)
Line 23: {
Line 24: Domino.NotesSessionClass sessclass = new Domino.NotesSessionClass();
Line 25: sessclass.Initialize("lotuspwd");//PWD is required
Line 26: Domino.NotesDatabase notesDB = sessclass.GetDatabase("serveraddress", "names.nsf", false);
Thanks for any help.......
Lakshmi
|
|
|
|
|
HRESULT 8007000e corresponds to E_OUTOFMEMORY.
For Notes/Domino specific queries Lotus Notes forum[^] might be a good place to ask.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
hi,
I am trying to autoformat an Excel (.xls) file and then import it into Sql server 2000 table using C# in Asp.net. But when i try to autoformat the excel file i get the exception "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Someone please help me to solve this problem
Here is the code.
sing System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Data.OleDb;
using System.Data.Odbc;
using System.Text;
using Microsoft.Office.Interop.Excel;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection Cn = new SqlConnection("server=143.14.45.137; database= NitDB; User ID=uy; Password= g");
SqlCommand Cm = new SqlCommand("Select * from ExcelFile", Cn);
Cn.Open();
SqlDataReader St = Cm.ExecuteReader();
gdExcelFile.DataSource = St;
gdExcelFile.DataBind();
St.Close();
Cn.Close();
}
public static void PrintProgressBar()
{
StringBuilder sb = new StringBuilder();
sb.Append("<div id='updiv' style='Font-weight:bold;font-size:11pt;Left:320px;COLOR:black;font-family:verdana;Position:absolute;Top:140px;Text-Align:center;'>");
sb.Append(" <script> var up_div=document.getElementById('updiv');up_div.innerText='';</script>");
sb.Append("<script language=javascript>");
sb.Append("var dts=0; var dtmax=10;");
sb.Append("function ShowWait(){var output;output='Reading data from excel...PLEASE WAIT!';dts++;if(dts>=dtmax)dts=1;");
sb.Append("for(var x=0;x < dts; x++){output+='';}up_div.innerText=output;up_div.style.color='red';}");
sb.Append("function StartShowWait(){up_div.style.visibility='visible';ShowWait();window.setInterval('ShowWait()',100);}");
sb.Append("StartShowWait();</script>");
HttpContext.Current.Response.Write(sb.ToString());
HttpContext.Current.Response.Flush();
}
public static void ClearProgressBar()
{
StringBuilder sbc = new StringBuilder();
sbc.Append("<script language='javascript'>");
sbc.Append("alert('Data exported successfully');");
sbc.Append("up_div.style.visibility='hidden';");
sbc.Append("history.go(-1)");
sbc.Append("</script>");
HttpContext.Current.Response.Write(sbc);
}
protected void btnExport_Click(object sender, EventArgs e)
{
PrintProgressBar();
{
OdbcConnection connection;
SqlBulkCopy bulkCopy;
string ConnectionString = @"server=178.17.44.137;database= NitDB; User ID= er; Password=d";
string connstr = @"Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=" + fyle.Value;
using (connection = new OdbcConnection(connstr))
{
string[] temp;
string fn1;
fn1 = System.IO.Path.GetFileName(fyle.PostedFile.FileName); \\ fyle is the Html File upload control
temp = fn1.Split('.');
object missing = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Excel.Application excel = default(Microsoft.Office.Interop.Excel.Application);
Microsoft.Office.Interop.Excel.Workbook wb = default(Microsoft.Office.Interop.Excel.Workbook);
excel = new Microsoft.Office.Interop.Excel.Application();
// I get the exception at the below statement.
wb = excel.Workbooks.Open(fn1, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing);
excel.Visible = true;
//wb.Activate();
excel.Cells.Select();
excel.Columns.AutoFit();
excel.Rows.AutoFit();
OdbcCommand command = new OdbcCommand("Select * FROM [" + temp[0].ToString() + "$]", connection);
connection.Open();
using (OdbcDataReader dr = command.ExecuteReader())
{
using (bulkCopy = new SqlBulkCopy(ConnectionString))
{
bulkCopy.DestinationTableName = "ImportedExcel";
bulkCopy.WriteToServer(dr);
}
dr.Close();
}
}
bulkCopy.Close();
connection.Close();
}
ClearProgressBar();
}
}
Nitin Raj Bidkikar
|
|
|
|
|
Hi, All!
I need to develop hook for income/outgoing email messages using MAPI hooks. How can doing that? Some links or samples will be very good
|
|
|
|
|
Hello,
perhaps somebody can help me to find the reason for the crashes I have.
I have a MFC Application with MFC extension DLLs.
One of the dialogs is a window with a CPropertySheet.
One CPropertyPage is a host for ActiveX Controls providing extending UI.
This CPropertyPage has a CWnd member to host the ActiveX Controls dynamically created runtime using the CWnd::CreateControl method.
I have a VB ActiveX Control providing needed extending UI.
It can be loaded and used without problems.
The only problem occurs, when the application exits:
1. The CPropertySheet is destroyed ... the CPropertyPage is destroyed, ...
... which releases its previously queried interfaces,
... sends a WM_DESTROY to the CWnd hosting the ActiveX Control and
... deletes/frees the CWnd
2. Somewhere at the end just before invoking "exit" open "OLE" connections/loaded "OLE" libraries are terminated by Microsoft internal code. I saw that the ActiveX OCX module was active until this moment.
3. In the "exit" invocation the MFC application crashes from within the VB ActiveX Control. The VB ActiveX Control does not execute its UserControl_Terminate handler, so it seems, that there happens an irregular deletion of the VB ActiveX Control.
This crash happens currently only in the debug version of our application. But adding CommonControls to the VB ActiveX Control UI causes a crash even in the release version of this MFC application.
Using a MFC ActiveX Control providing some UI, too, no problems occur.
The only difference seen while releasing the last reference to the previously queried interface are that ...
... the release on the interface of VB ActiveX Control returns 4 still valid references,
... while the release on the interface of the MFC ActiveX Control returns only 3 still valid references.
Thus I suspect, that at application end there is still a last reference valid, not released, which causes a crash after the OCX is unloaded from Microsoft internal code cleaning up before the real application exit.
Something in the VB ActiveX Control wants still to work (like executing UserControl_Terminate), but the OCX is already unloaded.
But ... where and how can I find this last reference?
Debugging through the MFC code hosting the ActiveX Control didn't help really?
Has somebody here experienced a similar problem? Or can somebody help?
Thanks in advance,
Martin
|
|
|
|
|
Hi Martin,
I think you are on right track. Just make sure you are not holding any reference in your own code. Use smart pointer (CComPtr, CComQIPtr). If you queried for an interface, make sure you release it in your OnDestroy. I don't think it matters that you are using an MFC extension DLL, as long you release your interface, it should work fine.
Did you try creating a separate project (simple dialogbox) using the activeX in question?
In the end, we will remember not the words of our enemies, but the silence of our friends. - Martin Luther King Jr.
Ernest Laurentin
|
|
|
|
|
Hi Ernest,
thanks for your reply.
Until today morning I used no smart pointers, but using them does not change a thing.
I didn't expect a change in behaviour, because in my MFC C++ ActiveX control I could see, while debugging, that my reference handling was ok.
Ok - now I've introduced CComIQPtr and CComPtr, but it changes nothing.
The question is, why in comparison to the MFC ActiveX control one additional reference to the VB ActiveX control is hold!? And how/what is holding this reference to which interface?
The question raises, because releasing "my" interface I got a count of hold references of 3 with the MFC ActiveX control, but 4 with the VB ActiveX control.
And debugging through the deletion of my hosting CWnd I see only 3 releases on the interfaces of the MFC and the VB Active control.
So - where is the last reference on a interface to be found?
And ... do I have the possibility to change this behaviour?
Best regards,
Martin
|
|
|
|
|
Hello again,
first - I'm sorry, because I didn't provide any information about the development environment:
Microsoft Visual Studio 6.0 SP6
Microsoft Visual Basic 6.0 SP6
And ... no ... I can not upgrade - currently!
Second - I created a new most simple MFC application only loading the VB ActiveX control and raising an exception on exiting.
It has a CWnd* member on which CreateControl is called and which is deleted while deleting the dialog object.
So it shows the same behavior than the big MFC application I normally work on.
Has someone a hit or suggestion?
Best regards,
Martin
|
|
|
|
|
Hello,
after trying a bit I changed my VB ActiveX Control to execute the "UserControl_Terminate" things in the "UserControl_Hide" event handler.
Only the call "App.LogEvent ..." stayed in the "UserControl_Terminate" event handler.
And now everything seems to work fine.
Even a VB ActiveX Control with CommonControls (not even touched in the "UserControl_Terminate" event handler) works now.
So - I don't know why, but now everything works.
I found a solution, but no understanding for the problem.
Best regards,
Martin
|
|
|
|
|
Hi,
I am using a third party COM library, I am initializing one interface(I1) and all interfaces are initialize with I1. Am I need to call realese on every inreaface when I used any function of these intefaces?
|
|
|
|
|
It depends on what you mean by "all interfaces are initialize with I1".
Presumably this means that the interface I1 is queried for the other interfaces and the rules of COM says that when an interface is queried for, the reference count is set to 1 is the query was successful.
This means that you most likely have to release the interface when you're done with it.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Is the same true for smart interface pointer?
modified on Tuesday, October 21, 2008 4:51 AM
|
|
|
|
|
Smart pointers such as CComPtr will call Release() when they go out of scope. If you try to call AddRef() or Release() on a CComPtr, you'll get an error.
The CComPtr has the COM rules for reference counting built in, so you don't have to worry about that if you're using CComPtr . Even CComQIPtr works the same way.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi
I have a server which wil be fetching live Prices and i have to convert this server into a com+ service which wil be running on the server.. i to use the com + service in my aspx (i.e) webapplication . when ever the com + component raises a event i should be able to capture the event raised by the com+ service.. can we achieve this... Pls help me out
|
|
|
|
|
hi friend
Can any body tell me what is the advantages of .pfx file. and why we use it.
wasim khan
|
|
|
|
|
hI,
I am using the MSComm port for recieving data in c#.net while recieving data in parts from the OnComm event of mscomm i am not able to get the correct frame i.e. instead of 60bytes i am getting 80 bytes.
Can anybody tell the solution
|
|
|
|