|
I have a local server that I thought was pretty standard. When my client goes to launch it, it pauses for about a minute before returning 0x80080005 (CO_E_SERVER_EXEC_FAILURE). I broke it down and just called CoGetClassObject(), but it behaved the same way.
I googled for the error message and came up with a few postings, but all of them were in reference to remote objects and security issues. This is most definitely a local object, and the security settings are all defaults.
Anyone else seen this before?
J
"You can get anything you want at Alice's Restaurant."
|
|
|
|
|
Have a compile time error. Trying to compile a COM object - when the compile gets to
"Linking...
Creating library Debug/C2PCGWSettings.lib and object Debug/C2PCGWSettings.exp
Registering ActiveX Control.."
Error reading key....
C2PCGWSettings.dll - 1 error(s), 0 warning(s)
Any ideas?
Thanks
|
|
|
|
|
Hi,
I'm kinda stuck at the moment so i hope some of you guys can help me out. Ok here's the question:
How can you get the method id's of a [default, source] interface using smart pointers only. It is not a dispinterface (since then you had to supply id's), but a normal interface which derives from IDispatch. I can't create an instance or query for the interface, because it's a [source] interface...right. So how can i get these id's.
Any help would be greatly appreciated.
|
|
|
|
|
nevermind....already found it out myself.......but thanx for not replying though.
|
|
|
|
|
hi there!
i wanted to know the EXACT purpose that The Macros DECLARE_DISPATCH_MAP and DECLARE_OLECREATE_EX do?
and where are they used?
thanks...
&
regards
safee
|
|
|
|
|
Hi, I wonder if anyone else stumbled on this problem - I have an ATL/COM server, which normally works just fine, being instantiated from both ASP and MFC projects.
However, once in a while, w/o any apparent reason, ::CoCreateInstance fails, returning "Class Not Registered". Usually a reboot and or rebuilding the COM component helps, but sometimes it doesnt.
Needless to say, that the class *is* registered, and can be seen using the OLE/COM Viewer.
Any ideas?
VL
|
|
|
|
|
check if the dll is already in use some where else in some other process...i think this should solve your problem....
regards
|
|
|
|
|
If your COM server happens to be a .exe, then be sure to know that by default IIS won't start more than 2 .exe COM instances.
|
|
|
|
|
Hi All,
I’m handling events of ADO in an ATL out-of-process server, and for some reasons when I use _ATL_FREE_THREADED declaration event ConnectComplete is not called when I establish an asynchronous connection, thou it is called when I use a synchronous connection. Changing the memory model to _ATL_APARTMENT_THREADED solves the problem, but what is the reason of such strange behaviour anyway, and what’s the
proper solution?
Regards,
Vitaly Tomilov
|
|
|
|
|
I'm implementing a COM add-in for Outlook using C#. I have added an event handler to the Outlook.Explorer BeforeFolderSwitch event as follows:
m_activeExp.BeforeFolderSwitch += new Outlook.ExplorerEvents_10_BeforeFolderSwitchEventHandler( this.OnBeforeFolderSwitch );
The event handler method is as follows:
public void OnBeforeFolderSwitch( object newFolder, ref bool cancel )<br />
{<br />
MAPIFolder oNewFolder = (MAPIFolder)newFolder;<br />
if ( oNewFolder.Name.Equals( "Rhythmyx" ) )<br />
{<br />
if ( m_psSessionID == null || m_psSessionID.Trim().Equals( "" ) )<br />
{<br />
LoginForm loginForm = new LoginForm();<br />
if ( loginForm.ShowDialog() == DialogResult.OK )<br />
{<br />
}<br />
else<br />
{<br />
cancel = true;
}<br />
loginForm.Dispose();<br />
}<br />
}<br />
}
The "cancel = true;" statement should prevent the folder switching, but for some reason, it does not. FWIW, I have the same code in a VBA module (prototype), and setting the cancel parameter to True indeed prevents the folder switch.
Any ideas why this is not behaving as expected?
Thanks,
--
Roy ![Unsure | :~](https://www.codeproject.com/script/Forums/Images/smiley_squeamish.gif)
|
|
|
|
|
May be a dummy note, but are you sure cancel = true; is executed ? (ref bool cancel is the right parameter signature, it should work!).
|
|
|
|
|
Not a dummy note at all -- and thank you for the reply.
I am sure, and here's the call stack after I set cancel to true:
> rx5.dll!Rx5.Connect.OnBeforeFolderSwitch(System.Object newFolder = {System.__ComObject}, bool cancel = true) Line 221 C#
The only thing that makes me wandr is why the call stack does not show the cancel parameter as a ref parameter -- the method signature is as follows:
public void OnBeforeFolderSwitch( Object newFolder, ref bool cancel)
Could it be that the Outlook interop DLL somehow treats cancel as a value parameter?
I'd be more then happy to send me code for someone else to try it out.
--
Roy
|
|
|
|
|
I am trying to write a DLL to be called from VB. Thus I had to use SAFEARRAY.
I have a problem that when I am accessing all the elements in the array I can change their values but when I try to access a specific element it seems not to accept the new value I try to assign.
For example, I have these functions:
void Set2DSafeArrayPtr(SAFEARRAY * psaiInOut, long val)
{
long ai[2];
int x,y;
LRESULT hres;
int xMin = psaiInOut->rgsabound[0].lLbound;
int xMax = xMin + (int)psaiInOut->rgsabound[0].cElements - 1;
int yMin = psaiInOut->rgsabound[1].lLbound;
int yMax = yMin + (int)psaiInOut->rgsabound[1].cElements - 1;
// Set up dimension array and pointer to receive value.
long * piInOut;
if (hres = SafeArrayLock(psaiInOut)) throw hres;
for (x = xMin; x <= xMax; x++) {
ai[0] = x;
for (y = yMin; y <= yMax; y++) {
ai[1] = y;
hres = SafeArrayPtrOfIndex(psaiInOut, ai, (void **)&piInOut);
if (hres) throw hres;
// Equivalent to: aiInOut(x, y) = aiInOut(x, y) + 1.
(*piInOut) = val;
}
}
if (hres = SafeArrayUnlock(psaiInOut)) throw hres;
}
void SetElementPtr(SAFEARRAY * psaiInOut, int x, int y, long val)
{
LRESULT hres;
long * piInOut;
long ai[2];
if (hres = SafeArrayLock(psaiInOut)) throw hres;
ai[0] = x;
ai[1] = y;
hres = SafeArrayPtrOfIndex(psaiInOut, ai, (void **)&piInOut);
if (hres) throw hres;
(*piInOut) = val;
if (hres = SafeArrayUnlock(psaiInOut)) throw hres;
}
my program
void main{
...
SAFEARRAYBOUND bDim[2];
bDim[0].lLbound = 0;
bDim[0].cElements = 6;
bDim[1].lLbound = 0;
bDim[1].cElements = 6;
psaiNew = SafeArrayCreate(VT_I4, 2, bDim);
if(psaiNew == NULL){
cout << "Unable to initialize array. Not enough memory" << endl;
return;
}
hres = SafeArrayLock(psaiNew);
Set2DSafeArrayPtr(psaiNew, 15);
SetElementPtr(psaiNew, 1,2,30);
hres = SafeArrayUnlock(psaiNew);
...
}
The Set2DSafeArrayPtr seems to work fine but the SetElementPtr doesn't seem to work.
Any idea why? What am I doing wrong?
I'd also like to know of a good place I can find references/examples (other then MSDN)...
|
|
|
|
|
This code works fine in a MDI application. The error must come from somewhere else.
rechi
|
|
|
|
|
I have written a COM component in VC++ that connects to a ODBC (.mdb file) through OLE DB. When i try to use it in .asp page i get error (0x80004005 - unspecified error). The same component (same asp file) works fine with PWS under Win98. When i run the same with IIS5 in Win2000 and WinXP i get error. I couldn't find out what might be the problem. Can you help me out?
Thanx in advance
Mahesh
|
|
|
|
|
hi there..
thanks for your time first..
i wanted to know if you may have some source of information on what does the variable m_ObjectType does in the Class CAutomationObject does??
help is desparately needed..
thanks
regards
safee
|
|
|
|
|
I compiled and linked some sample source code got from Microsoft SDK, there were some strange link errors:"error LNK2001: unresolved external symbol "error LNK2001: unresolved external symbol "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z)" and "error LNK2001: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z)", it caused by such code:"_TCHAR *szName = new _TCHAR[100]" and "delete []szName".I tried to change the project setting option, but it still happened. I just wonder if there is anyone once met such problem before and how to solve it. Thank you.
Ray
|
|
|
|
|
It seems like you have problems with unicode.
Are the settings OK for that?
|
|
|
|
|
How to extract the content of the _variant_t if
the VARTYPE is VT_DISPATCH?
thank you
|
|
|
|
|
Cast it to LPDISPATCH .
rechi
|
|
|
|
|
ppdispVal
[ It is possible to represent everything in this universe by using 0 and 1 ]
|
|
|
|
|
I have project that is based MFC, in this project, i want to catch new event of Word in AutoMation, and now i can catch sample enent, such as "DocumentChange", "Quit", but i can't catch "DocumentOpen" "DocumentSelectChange" etc new event, why? please tell me
how to do, thanks a lot!
Hello everyone
|
|
|
|
|
http://www.codeproject.com/com/adWordAddin.asp
|
|
|
|
|
Hi all,
Can I build ActiveX Control that implements the multithread features? What I means is the control that operate the background process and user can stop its operation.
Why do I need this control? It seems like a console UI control that I can key any commands on this control and then it sends the command to a hardware via serial comm port. After that the hardware send back data to buffer. The control reads back and display on the console. I found some difficulties on this model. If the hardware sends a long operation data, UI control is freezed, I can't key any commands to break it.
Thank you very much
champ
|
|
|
|
|
Please read this article [^] before applying any threading work inside ActiveX control.
|
|
|
|