|
Hello out there,
I have a little question, hope somebody can help.
So let's start:
I have a .dll that's normally used as a shell extension. It adds a fuctionality to windows explorers context menu. (a dialog pops up and tell's something about the internal file version).
Now I want to write an executable that exactly does the same by using the dll. starts up the dialog. the argv[1] should be used to specify the file which is as an extension the clicked one.
Normally a dll. exports a function to call with LoadLibrary and getProcAdress.
Thats the Exported Functions of the dll:
DllCanUnloadNow
DllGetClassObject
DllRegisterServer
DllUnregisterServer
Which one to call?
How the Shell calls the DialogBox?
Is there a regestry key, where the 'call' is specified?
Is it possible to call the shell extension dialog from the .exe?
ThX
drax
-- modified at 7:36 Thursday 28th September, 2006
|
|
|
|
|
Hi All,
I wrote some application that use COM.
In some place i need to close the COM object - but the main application that have the pointer to to com object still hold it.
I using "smart pointer" that release the com object in case no one have the com object - my problem is .... how can i force the com object to set the counter of the object that point to current object to be 0 ?
[ When i call release in com object i "tell" the counter to do count-- . my question is how can i force this counter to do count-- without call release ( in the com object) ]
Thanks for any help.
|
|
|
|
|
Hello Yanshof,
>> how can i force the com object to set the counter of the object that point to current object to be 0 ?
Doing so violates the basic principles of COM - that is, to ensure objects remain alive as long as a client holds a reference to it.
The only concept that is vaguely similar to what you want to do is when a COM EXE server, running as a visible application, is terminated by the user. In such a situation, prior to shutting down, the EXE server calls the CoDisconnectObject() API to release external connections to all its running objects. Each object will then take steps to notify its proxy that it is about to shut down.
The outcome of such an arrangement is to enable a proxy to respond to all subsequent calls from its client by returning RPC_E_DISCONNECTED or CO_E_OBJECTNOTCONNECTED rather than attempting to forward the calls on to the original object. When the client receives such a return value, it must destroy the proxy.
My suggestion to you is that : if you need to close (I guess you mean destroy) the COM object at some point in its usage, you should arrange for an event to be fired to your client so that it can be made ready for such a situation.
Best Regards,
Bio.
|
|
|
|
|
Calling StartServiceCtrlDispatcher with paramaters Servicename and Pointer to serviceMain Function is getting failed, can any one tell me why it is happening
mpk1979
|
|
|
|
|
What is the error code?
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
The Error Code which it returns is 1073 i.e service alredy running...but no service is running with that name
|
|
|
|
|
In StartServiceCtrlDispatcher documentation, MSDN says -
The process has already called StartServiceCtrlDispatcher. Each process can call StartServiceCtrlDispatcher only one time.
Are you doing anything like this?
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
How to create a custom Calendar control in asp.net web application??
please send me codes, methods or articles, creating calendar components creating calendar asemblies that can solve this problem... please..
|
|
|
|
|
I want to integrate outlook in an existing CRM. I think I have to make a outlook Addin for that.
I want to achieve certain things with it.
a. whenever some person emails there should be an automatic unique referece number generated for that email (a support ticket) and should be automtically sent to the sender.
b. audit trail of outlook messages
c. reporting
I am at loss to understand that how can I do these things.
An idea is to develop a web service and add in for outlook when executed should parse through all of the emails and send unique IDs to the senders or a webservice running in the background should do it automtically each time the user sends the email. once the emails are there then the addin should somehow expose the CRM database to the outlook client and the emails with associated attributes should be stored in a table at CRM... am I right???? and once its in table then reporting is not a big problem
am I on the right track
any thoughts on this,, I have this university project which I have to do ,, please help me
thanks
drequinox
|
|
|
|
|
Hello all,
I have another problem using navigate2 method of IWebBrowser2 interface. I'm tring to send a javascript function (the string passed is like this: "javascript:functionname()" ) from an activex control to internet explorer. The first time that I call Navigate2 all goes fine but IE don't release the resource. The others times that I'm tring to call Navigate2 the resource appears busy.
I'm calling navigate2 in this way:
<br />
locHR = locBrowser->Navigate2(&vaURL,&noArg,&vaTarget,&noArg,&noArg);
where
COleVariant noArg;<br />
COleVariant vaURL((LPCTSTR) "javascript:functionname()");<br />
COleVariant vaTarget((LPCTSTR) "_self");<br />
Is this the correct way to post data (through http_get) to IE?
Thanks a lot
Carlo
|
|
|
|
|
Hi cp-users,
I hope this is the correct message board to post this message...
I've a problem with Event Queue in my ActiveX Control. I'have generated some method to fire events to javascript. When I call MFC FireEvent (with same eventid) several time, javascript function is not called only one time per call but for the number of foregoing calls + 1. I suppose that I must clear the event queue manually but I don't have found any documentation in MSDN...
Thanks for all suggestion
Carlo
|
|
|
|
|
Not directly a COM-Question, but perhaps i get lucky.
I've got this function :
typedef struct
{
int size;
[size_is(size), string] char * text;
} whatastruct;
short saysomething( [in] handle_t hl,
[in, out, ref] int *size_msg,
[out, size_is(*size_msg)] whatastruct **msg);
My server-side implementation looks like this :
short saysomething(handle_t hl, int *length_msg, whatastruct **msg)
{
*msg = new whatastruct[*length_msg];
for ( int i = 0; i < *length_msg; i++ )
{
msg[i] = new whatastruct;
msg[i]->text = new unsigned char[25];
msg[i]->size = 25;
sprintf(reinterpret_cast<char*>(msg[i]->text), "Das ist der %d. String.", i);
}
return 0;
}
When i call it, the client crashes during unmarshaling after the return of the function. Can anyone help me or give me a hint ? Google isn't very helpfull on this topic, and MSDN isn't either...
|
|
|
|
|
Hello All,
I have little knowledge about MFC , I have been asked to convert my present MFC project to COM , so just started learning COM from Developer’s Workshop to COM & ATL 3.0 by Andrew. Book is good but feeling very difficult to understand ..can anyone help me like how to start with COM things and how to get started and anyone have any notes please pass it to me or any demo of COM projects please pass it to me, so that i can understand it better.
Thanking you,
Suresh.
|
|
|
|
|
|
Hi Sohail,
Thanks for the reply.. I will check them now.
|
|
|
|
|
Code Project is the best option for u ...select com as a beginner and u will fine some codes and basic knowledge of com ...andu may also search softlookup.com ....
|
|
|
|
|
Did you see Com on CodeProject
|
|
|
|
|
Open MSDN
Goto 'Search' Tab
Search for 'COM'.
Read 'From CPP to COM' first.
|
|
|
|
|
Hi all,
I am writing a COM server program. In that I created a interface "MyIDL". Here is the source.,
import "Unknwn.idl";
//My Interface
[
object,
uuid(E0985393-CD6E-4a1f-8737-C250238FC8FC),
helpstring("My Interface"),
pointer_default(unique)
]
interface IX : IUnknown
{
HRESULT Function([out]char *str)=0;
};
When I compile I am getting these errors.
1] error MIDL2311 : statements outside library block are illegal in mktyplib compatability mode : [ Interface 'IX' ]
2] error MIDL2096 : duplicated attribute : [helpstring] [ Interface 'IX' ]
3] error MIDL2096 : duplicated attribute : [uuid] [ Interface 'IX' ]
How can resolve this? I know these questions might be silly. But please anybody help me. So that I could learn COM Components.
|
|
|
|
|
Doesn't this[^] reply satisfy your answer?
|
|
|
|
|
No.,
You told you have to try on COM forum. Thats why I came here.
I tried as you said. That is working . Fine
Thanks.
|
|
|
|
|
Sakthiu wrote: No.,
Why ? Why you want go with the option that is obsolete ?
Sakthiu wrote: You told you have to try on COM forum. Thats why I came here.
Its always better to post in respective forums. That stops people annoying, you get quick and expert's input.
Sakthiu wrote: I tried as you said. That is working . Fine
|
|
|
|
|
My problem describes as follows:
A server module fires events through its COM interfaces.
For that the pointer to the interface is retrieved by GetInterfaceFromGlobal().
m_CPMTCritSec.Lock();
LPUNKNOWN pUnk = NULL;
DWORD dwGITCookie = (DWORD)(m_vec.GetAt(nConnectionIndex));
if (dwGITCookie != NULL)
{
IID iid;
GetConnectionInterface(&iid);
HRESULT hr = m_pGIT->GetInterfaceFromGlobal(
dwGITCookie, iid, reinterpret_cast<void **="">(&pUnk));
ATLASSERT(hr == S_OK);
}
m_CPMTCritSec.Unlock();
The client implements event dispinterfaces (IDispEventImpl) and establishs with DispAdvise() connections with the event sources.
When software starts up client and server are created, the server starts to fire events
and the client establishs connections and receives the events.
That works in most cases fine. But some times (10%) the software hangs.
The problem occurs always at the same situation:
the server is firing events and trys to get the interface pointer with GetInterfaceFromGlobal()
while the client trys to connect with DispAdvise().
|
|
|
|
|
I assume your client sits in an STA, so both client and server try to get to the same apartment and are locked out. You should not use a critical section in an STA!
|
|
|
|
|
Thank you for your reply! Unfortunately I forgot to mention that client and server are two different processes. So this couldn't be my problem.
|
|
|
|