|
Interesting. Maybe it it is an error. Otherwise, the server is testing to make sure the client has released all pointers and m_cRef is actually at zero. One situation is multithreading.
Kuphryn
|
|
|
|
|
I think it might be a typo mistake.. i feel it should be interlockeddecrement() function called instead of the increment!! for otherwise.. the component will never die..! or the cref==0 will never happen! as each time the value will always increase!
Aravinthan
<hr>
Visit me:
http:
When you know something.. its meant to share with others :-) for otherwise that knowledge has no worth:-)
mail me:
aravinthan@rediffmail.com
<hr>
|
|
|
|
|
The activeX has to read the information of a file which locates on the sever.
I notify the activeX the file URL(such as "http://10.0.10.10/test.i3d"), how can the activeX control download the specified file?
stanley
|
|
|
|
|
One solution is winsock.
Kuphryn
|
|
|
|
|
Hi,
I need to access the native COM provided by adobe for manipulating PDF's in my .NET application. Once i added a reference to it through the .NET IDE, i am not able to create an object as all the members within the namespace are interfaces. Am i doing something wrong?? If not can somebody suggest a work around for this???
Regards,
SLN
|
|
|
|
|
Hi,
I am trying to integrate (initiate calls) to a third party software application sitting on another box (BOX B) which only provides a set of function calls exported from its own dynamic link library (.dll). The vendor for the third party application sitting on another box I'm trying to integrate to doesn't want to do any development effort, other than to provide the .dll file. They provided interface examples for VB, C/C++, and MicroFocus Cobol. However, these codes will only work if the it is sitting in the same box (BOX B) as that app.
On my part, the integration software (in BOX A) I'm using will be able to initiate to invoke DCOM objects. However, I'm completely at a lost as to how to create a DCOM object which is able to invoke the dll on BOX B. Can anyone advise and help me in this matter?
Regards,
KY
|
|
|
|
|
Im getting a COM+ error which is like
The system has called a custom component and that component has failed and generated an exception. This indicates a problem with the custom component. Notify the developer of this component that a failure has occurred and provide them with the information below.
Component Prog ID:
Server Application ID: {5C36819D-0094-454E-B9D2-C5B9C8FA34CE}
Server Application Name: TransactOnline
The serious nature of this error has caused the process to terminate.
Exception: C0000005
Address: 0x779D9256
Call Stack:
OLEAUT32!SysFreeString + 0x46
RPCRT4!NdrServerInitialize + 0x288
RPCRT4!NdrStubCall2 + 0x570
RPCRT4!CStdStubBuffer_Invoke + 0xC5
OLEAUT32!UserEXCEPINFO_free_local + 0x2114
+ 0xFFFFFFF7
+ 0x8820B0A8
------------------------------------------------
I have found out the that error to a particular structure which is
typedef struct XXXX
{
BSTR A_account;
BSTR B_Date;
BSTR C_Date;
BSTR D_Date;
} YYYY
In Sysfreestring(YYYY.B_Date),it is failing and giving errors.
I have initialised this structure through VB and passed to COM.
Moreover,when i build this on my machine (all params and environments are same), this works good.
The only difference between the "original Build machine" and my machine is i have Visual Studio SP5.
Any suggestions?..
|
|
|
|
|
Sounds like you need to dump out what the values (and addresses) in the structure are. The error you're getting sounds like a BSTR being freed twice, or similar.
Steve S
[This signature space available for rent]
|
|
|
|
|
I feel this B_Date is already freed somewhere else..!
check if b_date is not null and pointing to a valid address!
-Aravinthan
<hr>
Visit me:
http:
When you know something.. its meant to share with others :-) for otherwise that knowledge has no worth:-)
mail me:
aravinthan@rediffmail.com
<hr>
|
|
|
|
|
Any COM experts around here?
If an inproc server is implemented in a DLL then is it possible that two clients running in two different process (in the same machine) can load the same COM server DLL into thier own address space?
Inproc COM servers are implemented in DLL's, does that mean I can create as many instances of this server as possible (just like a DLL?) ?
|
|
|
|
|
|
Yep, and the really cool thing is, on NT, they are mapped to the same binary file, and don't know it, though of course they do not have each others data mapped, just the binary image of the DLL.
Thats how you can have say 100 processes running all making use of user32.dll don't eat up loads of memory as NT hides that fact that its shared.
"Je pense, donc je mange." - Rene Descartes 1689 - Just before his mother put his tea on the table.
Shameless Plug - Distributed Database Transactions in .NET using COM+
|
|
|
|
|
Hi everyone,
Does anyone know why I can't seem to run multiple MSWord applications simultaneously? I am running a multithreaded server that opens a Word application per thread. The server then open documents and prints them. It works fine if I put a sleep statement in the code, which suggests that there is a synchronization issue. Here is psuedo code to help explain:
#include <atlbase.h>
#import "C:\WINNT\ServicePackFiles\i386\mqoa.dll" no_namespace
#import "C:\Program Files\Microsoft Office\Office\mso9.dll" raw_interfaces_only
#import "C:\Program Files\Microsoft Office\Office\msword9.olb" raw_interfaces_only rename("ExitWindows","WordExitWindows")
class MSWord()
{
public:
MSWord ()
{
m_hResults = CLSIDFromProgID(“Word.Application”, &clsid);
if (FAILED(m_hResults))
{
throw “Error”;
}
m_hResults = m_pWord.CreateInstance(clsid, NULL);
m_hResults = m_pWord->get_Documents(&m_pDocs);
}
void printDoc(string strDoc)
{
CComBSTR comBstr = strFile.c_str();
CComVariant var(comBstr);
VARIANT vOpt;
vOpt.vt = VT_ERROR;
vOpt.scode = DISP_E_PARAMNOTFOUND;
m_hResults = m_pDocs->Open(&var, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &pDoc);
if (FAILED(m_hResults))
return;
m_hResults = pDoc->PrintOut(&vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &var, &vOpt);
if (FAILED(m_hResults))
{
cout << " Failed to print " << endl;
return;
}
Sleep(20);
pDoc->Close(COleVariant((short)false), &vOpt, &vOpt);
::SysFreeString(comBstr);
}
private:
Word::_ApplicationPtr m_pWord;
Word::DocumentsPtr m_pDocs;
Word::_DocumentPtr pDoc;
CLSID clsid;
};
static void Foo()
{
MSWord msWord;
MsWord.PrintDoc(“Hello.doc”);
}
void main(void)
{
HANDLE hThreads[10];
for (int I = 0; I < 10; ++I)
hThreads[I] = CreateThread(Foo);
WaitForMultipleObjects(hThreads, INFINITE);
}
Is there a way to create only one Word application and pass it to all of the threads? I’m using MSVisual C++ 6.6 compiler.
Any help would be greatly appreciated.
Ken
|
|
|
|
|
<quote>Is there a way to create only one Word application and pass it to all of the threads?
MSWord ()
{
m_hResults = CLSIDFromProgID("Word.Application", &clsid);
if (FAILED(m_hResults))
{
throw "Error";
}
m_pWord.GetActiveObject(clsid);
if( !m_pWord )
m_hResults = m_pWord.CreateInstance(clsid, NULL);
if( m_pWord )
m_hResults = m_pWord->get_Documents(&m_pDocs);
}
With best wishes,
Vita
|
|
|
|
|
Hi, thanks for the help.
I tried your suggestion but I can't get it to work. When I pass a pointer of MSWord to each of the threads the threads error on the open function.
m_hResults = m_pDocs->Open(&var, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt, &vOpt,
&vOpt, &vOpt, &vOpt, &vOpt, &pDoc);
If I create an instance of MSWord object in each thread then each thread gets its own instance of Word.exe from the "m_hResults = m_pWord.CreateInstance(clsid, NULL)" function. That’s because m_pWord is NULL for each object’s constructor that is created by each thread.
So, I’m still wondering how to get one instance of MSWord in each of the threads.
Thanks again,
Ken
|
|
|
|
|
Hi all,
I'm writing an ActiveX button control that uses the Caption stock property to display the text on the face of the button. I'm having a big problem getting the caption stock property to work correctly. I've added the caption stock property to my control class using the automation tab of classwizard, and added the appropriate drawing code in my OnDraw() function of the control. Everything works fine using the activex test container, but everything goes haywire in the program I embed the control in. In the application, the button face displays the caption as entered into the property page of the control, but when I try to change the caption using the stock caption put property method, the first time it will change, then any subsequent changes are not reflected, and the text on the button face is frozen (cannot be changed). This is also reflected in the VC++ 6.0 IDE. When I open the control property page in the IDE of the project I'm embedding the control in, and set the caption for the first time, it looks fine. But when if I need to change the caption in the IDE using the property page, it reverts back to the original caption. Does anyone have any ideas?
I've tried using MSDN to no avail, and can't find anything like this on google.com.
The activex control project runs under windows 2000, and compiles and registers fine. The project I'm embeding the control under also runs under windows 2000 and has no compile errors, but also uses the directx sdk.
I'm willing to send the source code for both projects to anyone willing to help me with this issue.
Please help!! This problem is maddening to me.
Thanks all,
Marion
|
|
|
|
|
hi there...
i have some interfaces and i need to be able to handle these interfaces by creating the relevant objects in the DllGetClassObject..
But for that i need to know which interfaces are createable..how do i know that???
thanks
regards
|
|
|
|
|
You generally will want to setup if/else logic from within DllGetClassObject to test for the different CLSID's in your server.(The only interfaces you will want to return through DllGetClassObject are IID_IClassFactory or IID_IUnknown since the class factories QueryInterface logic will only be checking for those two identifiers).
For example:
<br />
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void** ppv)<br />
{<br />
HRESULT hr;<br />
if (rclsid == CLSID_MyFirstCoClass)<br />
{ <br />
MyFirstCoClassFactory* pCF1 = new MyFirstCoClassFactory();<br />
hr = pCF1->QueryInterface(riid, ppv);<br />
if (FAILED(hr))<br />
{<br />
delete pCF1;<br />
}<br />
}<br />
else if (rclsid == CLSID_MySecondCoClass)<br />
{<br />
MySecondCoClassFactory* pCF2 = new MySecondCoClassFactory();<br />
hr = pCF2->QueryInterface(riid, ppv);<br />
if (FAILED(hr))<br />
{<br />
delete pCF2;<br />
}<br />
}<br />
else<br />
{<br />
hr = CLASS_E_CLASSNOTAVAILABLE;<br />
}<br />
return hr;<br />
}<br />
Hope this answers your question!
-John
|
|
|
|
|
Thanks a lot John..
The information you provided was certainly helpful..But i wanted to know that if i have 5 or 6 interfaces already defined with me and i want to determine which of them is cocreateable..how do i know that??
If i know that a specific interface is createable only then will i call it and check for it in the DllGetClassObject..
regards
|
|
|
|
|
hi there..
i am working on an ole control and need to implement the method DllGetClassObject..
ne ideas???? what to do?
thanks
|
|
|
|
|
DllGetClassObject is one of four DLL server exports that are required.
DllGetClassObject exposes class factories for all objects in a given server. This export will return an IClassFactory pointer to the client.
Instantiate a class factory object (using the C++ new operator) and then call QueryInterface to obtain an IUnknown or IClassFactory interface pointer. Check the return value of the QueryInterface invocation with the FAILED or SUCCEEDED macros. If the call failed delete your class factory object and then return the HRESULT.
Regards,
|
|
|
|
|
hello,
i want to do some IE programming. in .net
but i am not able to have the componet that i should add.
can someone guide me on this.
ASIM
Asim
|
|
|
|
|
Hi all, i'm writting a Add-in to the visual studio 6, and i need to catch event before the document is being saved, while the IApplicationEvents supplies DocumentSave which is fired after it was saved.
Does anyone knows how to solve my problem?
Amir Harel
My boss always tell me: Why we always search for the generic solution for a specific problem...
|
|
|
|
|
|
hi there
i needed help regarding the first paramenter of the method ITypeInfo::Invoke(
VOID FAR* pvInstance,
MEMBERID memid,
unsigned short wFlags,
DISPPARAMS FAR* pDispParams,
VARIANT FAR* pVarResult,
EXCEPINFO FAR* pExcepInfo,
unsigned int FAR* puArgErr
);
from where or how do i get pvInstance?
thanks
regards
|
|
|
|
|