|
I would also recommend using the OLE/COM Object Viewer to establish whether your interface has been correctly registered.
You could write a short VBScript to test your server. If this works, then you would know that you have a problem with your client.
In response to your email, please note that I unable to debug your code for you, as I do not have the time and I do not need the acknowledgement. I am willing to help through these postings on this message board just as long as this is a two-way process.
|
|
|
|
|
|
First of all thank you "FearlessBurner" for your interest and swift response !
I finally found the bug , which caused my "COM EXE Server / MFC Doc View hybrid" not to register properly. A line of code is missing in the Microsoft sample code (can happen, of course) . Here is an extract of the inserted code section from article Q175190, inluding the missing line (indicated as such).After inserting the line I stopped receiving the "Class not registered" error messagbox alerts (caused by the missing line "OBJECT_ENTRY(CLSID_ImageProcess, CImageProcess)") :
CExeModule _Module;
LONG CExeModule::Unlock()
{
LONG l = CComModule::Unlock();
if (l == 0)
{
#if _WIN32_WINNT >= 0x0400
if (CoSuspendClassObjects() == S_OK)
PostThreadMessage(dwThreadID, WM_QUIT, 0, 0);
#else
PostThreadMessage(dwThreadID, WM_QUIT, 0, 0);
#endif
}
return l;
}
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_ImageProcess, CImageProcess) <--- ----------------------------------------------MISSING LINE
END_OBJECT_MAP()
LPCTSTR FindOneOf(LPCTSTR p1, LPCTSTR p2)
{
while (*p1 != NULL)
{
LPCTSTR p = p2;
while (*p != NULL)
{
if (*p1 == *p++)
return p1+1;
}
p1++;
}
return NULL;
}
Source code available to anyone requesting (Client and server demo applications)
Send your email address...
Rubi
|
|
|
|
|
Excellent. I am very pleased that you were able to discover the problem yourself and put it up as a response. This should benefit the next programmer who wants to do something similar.
|
|
|
|
|
I have an object that calls a private method, 'populate', in a loop. I need each call to 'populate' to initiate a COM+ transaction.
'populate' instantiates and uses external objects which are configured to participate in the root transaction, but without creating a new root object with only a 'populate' method, I don't know how to initiate and commit the transaction.
Don't get ripped-off by the life assurance industry.
|
|
|
|
|
Hi,
I was wondering whether its a good practise to use optional[^] attribute in IDL. Also I would like to know about using defaultvalue attribute along with optional attrbute.
Please help me with this.
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
|
MSComm32.ocx has the properties:
1) HRESULT CommID([in] long plCommID);
2) HRESULT CommID([out, retval] long* plCommID);
Note: lCommID is the handle to comm-port.
Now according to the MSDN Library, only the second one exist and is only accessible at run-time.
Question: Is it possible to assess the first one at run-time, in order to supply an existing handle.
I am writing a simple replacement TAPI control (replacing an existing unsupport simple control). The customer would prefer it is I used the MS Comm control, instead of the current Comm control (from same company as origanal TAPPI control).
Note: Origanal TAPI control has a bug in it.
Thanks!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
How to have a safearray with of its data type as Safearray itself? How to put and get SafeArray within a safearray
Eg:Safearray of type VT_VARIANT can have int(VT_INT),bstr(VT_BSTR)similarly its should also safearray(VT_ARRAY)
Alamelu
|
|
|
|
|
I tried to make a DCOM, and got one problem, it work allright when the dll is placed on my computer with Windows XP, and client on another computer with the same OS, but if another computer Windows 2000 or something else it doesn't work, and client programm says "Invalid Pointer"
|
|
|
|
|
|
Hi there,
Can anyone tell me how to set the initial postion of a deskband.
I have succesfull executed the Band Object Implementation Sample from MSDN
But the desk band Initially is always, docked on the taskbar.
What I want is, initially, the deskband to be docked on the right side of the screen.
Thanks in advance,
Kumar.
|
|
|
|
|
I've been given a task by my manager which I think is not possible to do. Our clients will be given an activeX control in which they will instantiate and make calls into. What we are trying to do is validate those calls into the activeX control. That is, when those calls are made, the parameters need to be checked and verified for proper values. Now the solution I have come up with, is to provide clients with my own activex control, which basically IS the actual activeX control they will be using except I added my own code to the implementation to do my validation and report to a file. Now in order for this to work, the client will need to instantiate MY activeX control instead of the real one, use MY activex control as if they were using the real one, and then I can validate that they are doing things properly. This of course requires the client to instantiate MY activex control hence build against my activex control. What she wants is this to be totally transparent to the client. That is, somehow do my validation on their calls to the real activex control but without getting them to have to rebuild against mine. So in other words, somehow intercept the calls from the client to the activex control and validate it with them knowing it. This sounds pretty serious in terms of security, and doesn’t seem doable. The real issue here is this: how do I get a client to use my activex control without them having to rebuild or even know that they're using my activex control? How could I make this validation totally transparent to the client? Can it be done?
|
|
|
|
|
Presumably you don't supply the original ActiveX control, or you'd simply add the validation code into that...
In terms of whether this is a security issue, I'd defer to Keith Brown; he's written a Universal Delegator, which will pretty much help you to do what you need. He's also the expert's expert on Windows Security, pretty much...
Check out this; Clickety[^]
Steve S
Developer for hire
|
|
|
|
|
yes, i wish i could modify the original activex to do my validation!
i'm going to check out that link. so i guess i'm right? without chaging the client code or rebuilding, they can't (normally) transparently do this.
|
|
|
|
|
thanks for the link. checked it out, but my question still remains. for the client to use this delegater that lets me do post-processing, the client still would need to build with this wrapper object, and use THAT object, right? that would still create the dependency for the client on using this delegator. this is essentially a wrapper, no? the key here is to keep the client totally oblivious to what's going on.
|
|
|
|
|
Hi Folks,
I am trying to add EVENT HANDLING in the COM component (attributed) in Visual C++ 7.1. But, it takes a lot of time (around 250 ms on my machine) while executing "__raise" method call for each event. This is a serious problem for me as a typical operation in my program throws around 50 events and when 250 ms are clubbed together for these 50 events, the overall operation takes hell lot of time)
Following is the event related code I have added in my program:
*****************************************************************
[
dispinterface,
nonextensible,
uuid("4700BB55-A9D2-46f8-A453-EF8F9658E56F"),
helpstring("_IMyEvents Interface")
]
__interface _IMyEvents
{
[id(1), helpstring("method OnDataChanged")] HRESULT OnDataChanged();
}
class ATL_NO_VTABLE CMyData : public IMyData
{
public:
CMyData ();
virtual ~CMyData ();
__event __interface _IMyEvents;
HRESULT FireOnDataChanged()
{
__raise OnDataChanged(); // THIS CALL TAKES TIME
}
----------
----------
}
*****************************************************************
I would look forward to your suggestions & comments.
Regards,
Arun.
|
|
|
|
|
One more clue:
This COM component accesses a webservice and invoke some methods on it. The webservice is deployed in the Tomcat Container.
(May be this is creating some problem)
|
|
|
|
|
Hi all,
Does anyonesee the following problem?
I built a COM component, and when I run my program, there's an eeror message:
Debug assertion failed!
Program: D:programs\...
File: dbgdel.cpp
Line: 47
Expression: _BLOCK_TYPE_IS_VALID(pHeap->nBlockUse)
The strange this is that if I build a dll file only (not use COM technique), that problem doesn't happen even the codes in COM and dll are exactly the same.
Thanks in advance for any help.
Nga
|
|
|
|
|
Hi,
I have created an ATL dll which has a modeless dialog box containing a WebBrowser control. My problem is that whenever I'm pressing TAB key over the WebBrowser control, the focus is not shifting to other controls or links within the web page which is getting displayed within the control.
I have implemented a hook to trap WH_GETMESSAGE message, after that I'm able to get response from the 4 arrow keys and TAB key, but that too within the dialog box.
I have to make the TAB key acting normal within the WebBrowser control that is within that dialog box.
Can anyone of you help me out? Thanks in advance.
Regards,
Ashish
|
|
|
|
|
Hi,
Does anyone know how to throw exception in COM.
Thanks in advance
|
|
|
|
|
tpndtbk wrote:
Does anyone know how to throw exception in COM.
Till i know COM
doen't support any Exception handlling.
but there other way or hack to do that
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi Alok,
You mean we can't throw exception in a COm interface function?
So what can we do if the exception happens??
|
|
|
|
|
Implement ISupportErrorInfo interface, and always try to get the HRESULT code. HRESULT tells whether the method executed successfully or some error occured.
I think this might be of your help.
|
|
|
|
|
Thanks very much.
Year, I always use HRESULT code... But I mean, how to throw an error message that the user can catch it and see it.
|
|
|
|