|
Please note that in method 1 i just create the object and assign it to pointer
in method 2 i am checking that if it was already created then i dont want it now and want to create a new object and assign it to the pointer.
but in method2 when i try to delete the object which was created in method1
it causes exception of unknown type.
Thanks
Thanks & Regards,
Dhana
|
|
|
|
|
Its seems diificult to judge. But, Initialize pointer you are talking about in c'tor of your coclass. I'm sure in method2, you are deleting uninitilized pointer(which is not set to NULL).
|
|
|
|
|
Hi to All,
Could any one Help me, How to create the plug-in toolbar for windows live Messenger using vc++?
What should I do?
Advance thanks
Ramana AV
|
|
|
|
|
Hi,
I have an existing COM which is up and running...now i have added another method in the COM but when i am trying to call that method from the client application I am getting an exception:
0x80004003:Invalid Pointer
Both my COM and the client application are written in VC++
Can anyone help me out with this??
Thnx,
Priya
|
|
|
|
|
When you modify interface, you need to change either major version number or minor version number. Have you done that ?
Refer this[^] for more inof.
|
|
|
|
|
Hi,
I haven't changed any version. So can u tell me how to change the version??
I am new to COM and so i donno this...
Thanks
Priya
|
|
|
|
|
In your .idl file , there must be block like this,
[
uuid(2EF0C5B1-0E6D-4793-8897-51BC19A18F58),
version(1.0),//this is version number
helpstring("Project name 1.0 Type Library")
]
Modify this to,
[
uuid(2EF0C5B1-0E6D-4793-8897-51BC19A18F58),
version(1.1),//this is version number
helpstring("Project name 1.1 Type Library")
]
|
|
|
|
|
Hi,
Thnx for the help..I tried it out but it didn't work!!
I changed the version number and the helpstring and tried attaching that COM .tlb file again..but still the same error is coming..
Any other solution??
Thnx
Priya.
|
|
|
|
|
I dont see any ohter problem. See, using your component, in other clients like VB.
I'm feeling, some how , your added method is not getting recognized.
|
|
|
|
|
Hi
The COM interfaces in my application derive from IUnknown. But some interface functions are declared using the "THIS_" parameter, some with "THIS" and some with none. For example:
1. STDMETHOD(DoBlah1) (THIS_ UINT uNum) PURE;
2. STDMETHOD(DoBlah2) (UINT uNum) PURE;
3. STDMETHOD(DoBlah3) (THIS_) PURE;
4. STDMETHOD(DoBlah4) (THIS) PURE;
5. STDMETHOD(DoBlah5) () PURE;
I would like to know whether the "THIS_" or "THIS" keywords are necessary, and what would be the difference between these functions.
(I couldn't find the definitions of THIS or THIS_ in the VC browser or on the net... )
Cheers
d3m0n
|
|
|
|
|
THIS_ , THIS and PURE are macros defined in basetyps.h and objbase.h. They are used for portability reasons with plain C, thus the code will compile with a C-compiler if written correctly.
Have a look at Jeff Glatt's article serie about COM in plain C. You'll find the first article here[^].
You'll find the other parts, 2 to 8, in various chapters below the COM section here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thank you very much Roger, that is a perfect answer for me.
I'll ensure that all my interfaces contain the THIS_ and THIS macros.
Cheers
d3m0n
|
|
|
|
|
I am using capicom and doing the encryption , the algorithm is 3DES. I am encryting a value and using this value I am doing an encryted login to a site.
I have set the source of the iframe as this url , in which the encrypted value is passed as a query string.
My problem is , I am able to view the page some times and other insatnces I get a "Page Cannot be displayed " message i.e. Error 404 .
Is this due to some problem in encrytion or decrytion. Or is it due to something that is related a .Net while doin an encrypted login.
I am not sure how to trace at who's end the problem is.
Have any body faced a problem like this, please help
Thanks in advance
|
|
|
|
|
在一个COM事件中,有这么个事件接口
dispinterface _IATLDiceObjEvents
{
properties:
methods:
[id(1)] void Test([in]double x, [in] double y);
};
然而在我的事件接收代码中,得到的x,y值是不是原来激发时所传递的.
接收事件的是一个ATL的对话框类,代码如下:
// MyDialog.h : Declaration of the CMyDialog
#ifndef __MYDIALOG_H_
#define __MYDIALOG_H_
#include "resource.h" // main symbols
#include <atlhost.h>
#import "E:\AtlOcx\Debug\AtlOcx.dll" raw_interfaces_only, raw_native_types, no_namespace, named_guids
/////////////////////////////////////////////////////////////////////////////
// CMyDialog
class CMyDialog :
public CAxDialogImpl<cmydialog>,
public IDispEventImpl<idc_atldiceobj1, cmydialog="">//,&DIID__IATLDiceObjEvents,&LIBID_ATLOCXLib, 1, 0>
{
public:
CMyDialog()
{
m_pATLDiceObj = NULL;
}
~CMyDialog()
{
}
enum { IDD = IDD_MYDIALOG };
BEGIN_MSG_MAP(CMyDialog)
MESSAGE_HANDLER(WM_LBUTTONDBLCLK, OnLButtonDblClk)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
COMMAND_HANDLER(IDC_OPEN_BUTTON, BN_CLICKED, OnClickedOpen_button)
MESSAGE_HANDLER(WM_CLOSE, OnClose)
END_MSG_MAP()
// Handler prototypes:
// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
// LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
// LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
LRESULT OnLButtonDblClk(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
return 0;
}
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
AtlAdviseSinkMap(this, TRUE);// 增加监听连接
return 1; // Let the system set the focus
}
LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
AtlAdviseSinkMap(this, FALSE);
EndDialog(wID);
return 0;
}
public :
BEGIN_SINK_MAP(CMyDialog)
//Make sure the Event Handlers have __stdcall calling convention
SINK_ENTRY(IDC_ATLDICEOBJ1, 0x1, OnTest)
END_SINK_MAP()
HRESULT __stdcall OnTest(DOUBLE x, DOUBLE y)
{
CComVariant varResult;
// TODO : Add Code for event handler.
// here x,y is changed.
return varResult.scode;
}
};
#endif //__MYDIALOG_H_
请问为什么在事件触发中,参数类型为'double'的数据会发生变化?
Thanks in advance!
|
|
|
|
|
Hai,
Plz anyone give the solution for ,How to install .dll files in the windows Registry using Regsvr32 ?
Please Clearly state the steps for installation.
|
|
|
|
|
senthil_rajesh wrote: How to install .dll files in the windows Registry using Regsvr32
Is your dll is self registrable dll(COM dll) ?
If yes, then from command line you need to use regsvr32 "dll path" .
|
|
|
|
|
I also did like that ,but error message occured that " .dll was loaded but unable to find the Entry point.so it was unable to registered.".
|
|
|
|
|
I asked you , whether your dll is self registrable ? If yes, then only you can use Regsvr32 .
Make sure, there is function DllRegistrServer present in your code. Make sure, you are giving valid path using "\\".
|
|
|
|
|
Actually i got the software which contains .dll and an .exe files ,how to find that .dll files is self registerable or not?.i want to execute the software through the HTML Link in ASP.NET.Plz guide me.
|
|
|
|
|
In case of dlls, its not needed to register it. In case of COM dlls only it is needed. At least you can ask this from person, you got this software from.
If its a COM dlls, use dependency walker to see exported function, there should be function DllRegisterServer .
|
|
|
|
|
The Software is SIM card Reader.We are creating the Real time WebApplication for the Mobile users.In particular Asp.net Page Having a link Which Calls that sIM CARD Reader Software.But the error was created that (one of the dll).dll was required.But that dll already with in that folder.we are get confused.plz suggest me a suitable solution to run that software in asp.net page link.
|
|
|
|
|
Have you used dependency walker as said in previous reply ?
Dependency walker will be presented in VS--> visual studio tools .
|
|
|
|
|
ya,using dependency walker i able to open an .dll file.how to register?,what is the use of dependency walker?.i didn't work before related to .dll files.
|
|
|
|
|
|
Hi
Tell me some books which is suitable for begineers in COM,
and it contians only COM concepts.
Beacuse many books introduce COM in last three Chapter.
When I read them ,its really teadious to understand what they are coming to say.
Please dont say any e books or search in googlee.
Please help me.
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|