|
Where is the question/problem with COM.
|
|
|
|
|
How to Deploy Presentation Layer and COM + in two servers?
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
Hi
Can anyone please tell how the Indexing server can be provided the credentials for the authentication and authorization of user, and to access a Indexing server on remote machine that is out of domain?
Thanks in advance
Manoj Kaushik
|
|
|
|
|
I did a test, tried to test TLS in COM. The code is as following,
__declspec(thread) static int num = 321;
void test()
{
int i = num; // got an error " Access violation reading location 0x00000000."
num = 332211;
Sleep(5000);
i = num;
}
Do I need to adjust some other setting of the COM, or COM really doesn't support TLS. This code works well in normal dll.
Any reply will be welcomed.
|
|
|
|
|
jsjwql wrote: Do I need to adjust some other setting of the COM, or COM really doesn't support TLS. This code works well in normal dll.
Are you by any chance linking your DLL statically?
An in-process COM server is a DLL that will be loaded at runtime and this is probably why your TLS doesn't work.
Here's what MSDN has to say about it:
If a DLL declares any nonlocal data or object as __declspec( thread ), it can cause a protection fault if dynamically loaded. After the DLL is loaded with LoadLibrary, it causes system failure whenever the code references the nonlocal __declspec( thread ) data. Because the global variable space for a thread is allocated at run time, the size of this space is based on a calculation of the requirements of the application plus the requirements of all of the DLLs that are statically linked. When you use LoadLibrary, there is no way to extend this space to allow for the thread local variables declared with __declspec( thread ). Use the TLS APIs, such asTlsAlloc, in your DLL to allocate TLS if the DLL might be loaded with LoadLibrary.
My guess is that you would get the same error with your DLL if you load it in runtime with ::LoadLibrary() .
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I have following error in window service same code is working in window Application
"QueryInterface for interface SQLXMLBULKLOADLib.ISQLXMLBulkLoad failed."
Dim objbl As SQLXMLBulkLoad3
objbl = New SQLXMLBulkLoad3
objbl.ConnectionString = "Provider=SQLOLEDB.1;Data Source=pcDB;Initial Catalog=webdb;User ID=sa;pwd=sa"
objbl.ErrorLogFile = "c:\error.log"
objbl.BulkLoad = True
objbl.KeepIdentity = False
objbl.CheckConstraints = False
objbl.Transaction = False
objbl.Execute("c:\Items.XSD", "C:\Items.xml")
Thanks
Hardik Panchal
|
|
|
|
|
Don't cross post in multiple forums. It's considered very rude to "spam" the forums and makes it quite difficult for multiple people to collaborate on an answer.
|
|
|
|
|
Hello!
I have an application written i VC++ (Visual C++ 6.0). This application already connects to several COM-objects and listens to events from them. This works very well.
My latest COM-object is written in C# (Visual Studio 2005). I connect to this object the same way, and listens to events (delegates) from the object.
But the events only works on my computer. I works in boty release and debug. I have tried to copy the software to serveral other computers, but then I receive no events. It connects to the object, and I can call functions in the C# COM-object, and display the return value, but OnXmlEvent(LPCTSTR text) is never called in my C++ application.
Any Idea about what's missing? For testing porposes I have created a console application in C# that connects to the C# COM-object, and this works fine on any computer, so I think my problem is the C++ application.
Am I missing a DLL or library?
Frode
|
|
|
|
|
Hi,
I have written a program in C# such that it creates a dll file at runtime using the CodeDOM techology and after creation the program calls a function from the dll file. This has been created with the winforms. It has two button and two text box. txt_box1 is to get a string from the user and btn1 is to create a dll file that retuns the string in txt_box1 when called. btn2 is used to call the dll file and the result is shown in txt_box2. The problem i encounter with this is, when i run this program for the first two time it creates the dll file and returns the string correctly, but when i try for the next time it exits. what i have to do to rectify this problem. Please help me.
If you can DREAM it
you can DO it
Natarajasivan D
|
|
|
|
|
Hi,
we have an SingleInstance-COM Object which works as Data-Buffer between a SAP-GUI and a graphical configurator (OpenGL). This works about 5 years. Original developed with VC 6, compiled with VC2002, VC2003, VC2005 and now with VC2005 SP1 over the years. Since we installed this object compiled with VC2005 SP1 there is an error "Server busy" while using the COM-object.
How can i get the position of the problem ?
Any tipps or hints or tools that can help me to solve the problem ?
Can i get detailed information which server is busy ?
In another context we had an identicaly error message. We tried to open a PDF file via IE on a new installed PC. The Acrobat Reader needs to confirm a dialog the first starting time. Nobody can see this dialog in the IE-Job. Starting an autark PDF file once, solves the problem.
Thanks in advance,
Howie
ps. Switch back to the old COM-object has not this problem. Virus checked, etc.
We know nothing between the technical communication of SAP and the COM object.
-- modified at 2:56 Friday 22nd June, 2007
|
|
|
|
|
hai everyone
i want to add activexobject("WScript.Shell") in my aspx page
plz tel me step by step
thanks
Dhatchinamoorthy.R
9894824838
|
|
|
|
|
I've been writing an addin for Outlook which requires it's own print dialog (in c# using P/Invoke). All good and well, but when I load the printer properties using the winspool.drv function of the same name I get a different properties dialog compared to the one accessed through the existing Outlook print dialog.
Does anyone know why this happens and if there is a way around it?
Thanks in advance
Dave
|
|
|
|
|
Figured it out - apparently Outlook calls DocumentProperties rather than PrinterProperties.
Dave
|
|
|
|
|
Hi,
We want to use COM+ to hold our business objects and turn on Object Pooling to persist Business Objects for each Web Session. What is the best way to do that and how? Should we create a COM+ that holds business objects for all sessions ( a collection of sessions that hold a collection of Business objects for each session ), or create COM+ object for each Session to hold all business objects?
Regards,
Babak
Babak Ansari Jaberi
Software Developer/Designer
|
|
|
|
|
Hi Experts,
I am using third party com Dll interafces.But sometimes the interfaces return E_OUTOFMEMORY EXCEPTION.So tell me how to release com interface.
Thanks
|
|
|
|
|
The exact mechanism depends on how you're using it. If you're using #import or CComPtr<> smart pointers, then you release the interface by setting the pointer to NULL. If you aren't using smart pointers in this way, you have to call the Release() method.
Note that if you copy a pointer without using AddRef() or QueryInterface(), the object may go away unexpectedly. Similarly, if you use AddRef() or QueryInterface() with no corresponding Release(), the object implementing the interface will not necessarily disappear when you expect it to..
Steve S
Developer for hire
|
|
|
|
|
What language are you coding in?
In VB, just make sure you set all of the objects you create to Nothing as soon as you're done with them:
Set MyLibraryInterface = Nothing<br />
Set MyBusinessObject = Nothing
In many situations, you don't really need to do this unless you're creating a lot of objects that don't fall out of scope right away
In C++, you just call ->Release() on your interface pointer.
MyComObject* pMyComObject = NULL;<br />
(send the pointer into your class factory CreateInstance call here)<br />
(do your business logic here)<br />
<br />
pMyComObject->Release();
Hope this helps.
|
|
|
|
|
I have implemented both applications using COM & DLL. But i don't find out any significance difference.So if anybody knows about it,then please reply me as soon as possible.
Regards,
Pankaj Sachdeva
|
|
|
|
|
[Why the laugh?]
A DLL is a set of code packaged into a library which can be used by your application, but is limited to working "in-process". That means it's loaded into your EXE, and has the same access to the memory allocated to the process as any of your other code. Similarly, it runs with the same privileges and user identify that your process does.
A COM component (or object, if you will) on the other hand, is a package of code which can be used by your (or any COM-aware) application, possibly even script hosts (VBScript, JScript) if the component implements the necessary supporting functionality. It provides mechanisms for working across process and machine boundaries, and allows (well, insists, sometimes) the configuration of security such that the component may execute under a different identity to the clients of the component. A COM object can implement or provide multiple interfaces, support aggregation, callbacks, and will implement lifetime management.
If your only exposure to COM is writing an ATL-based DLL, then it is not surprising that you haven't really appreciated the differences. Where I am (and where I was before) make heavy use of COM, COM+ and DCOM to implement a range of application servers (some of which are also services). None of them are 'network-aware', in the sense that there is no client code which deals directly with locating a component on a remote machine on the LAN and talking to it. COM/DCOM deals with all the plumbing issues, so you can concentrate on making the applications do what they are supposed to.
Many of these run 24/7, stopping only for software changes, and sometimes not always then!
Steve S
Developer for hire
|
|
|
|
|
pan_angel wrote: I have implemented both applications using COM & DLL
The above line doesn't match well with the below one.
pan_angel wrote: But i don't find out any significance difference
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi,
I'm using one COM component(exe), which implements the connection points also.
I have a client which implements Sink interface also. The event the server fires is a method with a single argument BSTR. When the server fires the event, client gets the notification, but the BSTR value is invalid(empty string).
The problem is also seen with ULONG parameter also. Please suggest a solution, and please
suggest is it a good idea to have parameters in the event notifications.
Also if two clients are connected to the server, only the client which caused the event to fire is getting the notification.
Thanks and regards,
Raja Pratap.
|
|
|
|
|
Could you post a bit of your code so we can see where the problem is?
---
Hakuna-Matata
It means no worries for the rest of your days...
It's our problem free, Philosophy
"I think my response was 'What idiot dreamed this up?'" -- Mary Ann Davidson, Oracle's chief security officer, in typical blunt manner, remembering her reaction to the company's scheme to brand its databases as "unbreakable."
|
|
|
|
|
The problem got soleved.
We have to make the server free threaded and make the class implementing the interface singleton and we need to in _tWinMain.. make sure that CoInitializeEx gets called.
Just trial and error caused a break through.
Thanks and regards,
Raja Pratap
|
|
|
|
|
Hi
I am trying to understand relation between queryinterface and cocretaeinstance. I read so many things still dont understand.
(For cocretaeinstance) In MSDN it says:
"This function creates on the local system a single uninitialized object of the class associated with a specified class identifier. "
I understand that
We use cocreateinstance to take instance for a class and we query for a supported interface with queryinterface.
But if we use COM for using Interface instead of class object.
So why do we take instance of a class? Isn't concept of COM using Interface instead of class object. So hiding implemantion details and avoiding name mangling etc... So why do we take a class object?
I dont understand here.
In what conditions do we need/use cocretaeinstance and queryinterface together? And in what conditions one of them is enough?
I hope i could explain the problem.
I am looking for your answers
Thanks.
|
|
|
|
|
I guess, one cannot take an instace of a COM class...As it is still abstract...
It is passed as a parameter to one of the CComObject<> varaiants to instantiate it..
If you want to access other interfaces supported by the coclass, then it can be done by queryinterface-ing the already obtained interface... instead of re-creating the Object instance...
Hope this helps,...
raja
|
|
|
|